content/xul/templates/src/nsContentSupportMap.cpp

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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 }

mercurial