Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsContentSupportMap.h"
7 #include "nsXULElement.h"
9 void
10 nsContentSupportMap::Init()
11 {
12 PL_DHashTableInit(&mMap, PL_DHashGetStubOps(), nullptr,
13 sizeof(Entry), PL_DHASH_MIN_SIZE);
14 }
16 void
17 nsContentSupportMap::Finish()
18 {
19 if (mMap.ops)
20 PL_DHashTableFinish(&mMap);
21 }
23 nsresult
24 nsContentSupportMap::Remove(nsIContent* aElement)
25 {
26 if (!mMap.ops)
27 return NS_ERROR_NOT_INITIALIZED;
29 nsIContent* child = aElement;
30 do {
31 PL_DHashTableOperate(&mMap, child, PL_DHASH_REMOVE);
32 child = child->GetNextNode(aElement);
33 } while(child);
35 return NS_OK;
36 }