From 580e6bae9c6b494ac72a8f81a17efcafbb8bc37d Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 5 May 2015 18:23:39 -0700 Subject: [PATCH] Bug 1166598 (part 3) - Use PLDHashTable2 in nsCommandParams. r=froydnj. --- embedding/components/build/nsEmbeddingModule.cpp | 2 +- .../components/commandhandler/nsCommandParams.cpp | 10 +--------- embedding/components/commandhandler/nsCommandParams.h | 4 +--- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/embedding/components/build/nsEmbeddingModule.cpp b/embedding/components/build/nsEmbeddingModule.cpp index 9ab26fbd75f..48351ec3adc 100644 --- a/embedding/components/build/nsEmbeddingModule.cpp +++ b/embedding/components/build/nsEmbeddingModule.cpp @@ -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) diff --git a/embedding/components/commandhandler/nsCommandParams.cpp b/embedding/components/commandhandler/nsCommandParams.cpp index addb9711466..9aaf94744ff 100644 --- a/embedding/components/commandhandler/nsCommandParams.cpp +++ b/embedding/components/commandhandler/nsCommandParams.cpp @@ -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 diff --git a/embedding/components/commandhandler/nsCommandParams.h b/embedding/components/commandhandler/nsCommandParams.h index 32a590f0a08..ee85a5f1817 100644 --- a/embedding/components/commandhandler/nsCommandParams.h +++ b/embedding/components/commandhandler/nsCommandParams.h @@ -20,8 +20,6 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSICOMMANDPARAMS - nsresult Init(); - protected: virtual ~nsCommandParams(); @@ -126,7 +124,7 @@ protected: static void HashClearEntry(PLDHashTable* aTable, PLDHashEntryHdr* aEntry); - PLDHashTable mValuesHash; + PLDHashTable2 mValuesHash; static const PLDHashTableOps sHashOps; };