mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-07 12:15:51 +00:00
8bd1f6f072
This encapsulates most of the uses of PLDHashTable::ops. --HG-- extra : rebase_source : 7760ce8e46a37e87dcfe590e809a21df01fe510f
38 lines
866 B
C++
38 lines
866 B
C++
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#include "nsContentSupportMap.h"
|
|
#include "nsXULElement.h"
|
|
|
|
void
|
|
nsContentSupportMap::Init()
|
|
{
|
|
PL_DHashTableInit(&mMap, PL_DHashGetStubOps(), sizeof(Entry));
|
|
}
|
|
|
|
void
|
|
nsContentSupportMap::Finish()
|
|
{
|
|
if (mMap.IsInitialized())
|
|
PL_DHashTableFinish(&mMap);
|
|
}
|
|
|
|
nsresult
|
|
nsContentSupportMap::Remove(nsIContent* aElement)
|
|
{
|
|
if (!mMap.IsInitialized())
|
|
return NS_ERROR_NOT_INITIALIZED;
|
|
|
|
nsIContent* child = aElement;
|
|
do {
|
|
PL_DHashTableRemove(&mMap, child);
|
|
child = child->GetNextNode(aElement);
|
|
} while(child);
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
|