michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsContentSupportMap.h" michael@0: #include "nsXULElement.h" michael@0: michael@0: void michael@0: nsContentSupportMap::Init() michael@0: { michael@0: PL_DHashTableInit(&mMap, PL_DHashGetStubOps(), nullptr, michael@0: sizeof(Entry), PL_DHASH_MIN_SIZE); michael@0: } michael@0: michael@0: void michael@0: nsContentSupportMap::Finish() michael@0: { michael@0: if (mMap.ops) michael@0: PL_DHashTableFinish(&mMap); michael@0: } michael@0: michael@0: nsresult michael@0: nsContentSupportMap::Remove(nsIContent* aElement) michael@0: { michael@0: if (!mMap.ops) michael@0: return NS_ERROR_NOT_INITIALIZED; michael@0: michael@0: nsIContent* child = aElement; michael@0: do { michael@0: PL_DHashTableOperate(&mMap, child, PL_DHASH_REMOVE); michael@0: child = child->GetNextNode(aElement); michael@0: } while(child); michael@0: michael@0: return NS_OK; michael@0: } michael@0: michael@0: