Bug 1166598 (part 3) - Use PLDHashTable2 in nsCommandParams. r=froydnj.

This commit is contained in:
Nicholas Nethercote 2015-05-05 18:23:39 -07:00
parent 6112d60b2b
commit 580e6bae9c
3 changed files with 3 additions and 13 deletions

View File

@ -31,7 +31,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsWebBrowserFind)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWebBrowserPersist) NS_GENERIC_FACTORY_CONSTRUCTOR(nsWebBrowserPersist)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsControllerCommandTable) NS_GENERIC_FACTORY_CONSTRUCTOR(nsControllerCommandTable)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsCommandManager) 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(nsControllerCommandGroup)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBaseCommandController) NS_GENERIC_FACTORY_CONSTRUCTOR(nsBaseCommandController)

View File

@ -25,20 +25,12 @@ const PLDHashTableOps nsCommandParams::sHashOps =
NS_IMPL_ISUPPORTS(nsCommandParams, nsICommandParams) NS_IMPL_ISUPPORTS(nsCommandParams, nsICommandParams)
nsCommandParams::nsCommandParams() nsCommandParams::nsCommandParams()
: mValuesHash(&sHashOps, sizeof(HashEntry), 2)
{ {
// init the hash table later
} }
nsCommandParams::~nsCommandParams() nsCommandParams::~nsCommandParams()
{ {
PL_DHashTableFinish(&mValuesHash);
}
nsresult
nsCommandParams::Init()
{
PL_DHashTableInit(&mValuesHash, &sHashOps, sizeof(HashEntry), 2);
return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP

View File

@ -20,8 +20,6 @@ public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS
NS_DECL_NSICOMMANDPARAMS NS_DECL_NSICOMMANDPARAMS
nsresult Init();
protected: protected:
virtual ~nsCommandParams(); virtual ~nsCommandParams();
@ -126,7 +124,7 @@ protected:
static void HashClearEntry(PLDHashTable* aTable, PLDHashEntryHdr* aEntry); static void HashClearEntry(PLDHashTable* aTable, PLDHashEntryHdr* aEntry);
PLDHashTable mValuesHash; PLDHashTable2 mValuesHash;
static const PLDHashTableOps sHashOps; static const PLDHashTableOps sHashOps;
}; };