Skip to content

Commit

Permalink
Bug 1166598 (part 3) - Use PLDHashTable2 in nsCommandParams. r=froydnj.
Browse files Browse the repository at this point in the history
--HG--
extra : rebase_source : 8e7e616c93cae653440a6ea2e11cd1c6da2e8821
  • Loading branch information
nnethercote committed May 6, 2015
1 parent 51dc9c3 commit bf1839c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion embedding/components/build/nsEmbeddingModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsWebBrowserFind)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWebBrowserPersist)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsControllerCommandTable)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsCommandManager)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsCommandParams, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsCommandParams)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsControllerCommandGroup)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBaseCommandController)

Expand Down
10 changes: 1 addition & 9 deletions embedding/components/commandhandler/nsCommandParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,12 @@ const PLDHashTableOps nsCommandParams::sHashOps =
NS_IMPL_ISUPPORTS(nsCommandParams, nsICommandParams)

nsCommandParams::nsCommandParams()
: mValuesHash(&sHashOps, sizeof(HashEntry), 2)
{
// init the hash table later
}

nsCommandParams::~nsCommandParams()
{
PL_DHashTableFinish(&mValuesHash);
}

nsresult
nsCommandParams::Init()
{
PL_DHashTableInit(&mValuesHash, &sHashOps, sizeof(HashEntry), 2);
return NS_OK;
}

NS_IMETHODIMP
Expand Down
4 changes: 1 addition & 3 deletions embedding/components/commandhandler/nsCommandParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ class nsCommandParams : public nsICommandParams
NS_DECL_ISUPPORTS
NS_DECL_NSICOMMANDPARAMS

nsresult Init();

protected:
virtual ~nsCommandParams();

Expand Down Expand Up @@ -126,7 +124,7 @@ class nsCommandParams : public nsICommandParams

static void HashClearEntry(PLDHashTable* aTable, PLDHashEntryHdr* aEntry);

PLDHashTable mValuesHash;
PLDHashTable2 mValuesHash;

static const PLDHashTableOps sHashOps;
};
Expand Down

0 comments on commit bf1839c

Please sign in to comment.