author | Nicholas Nethercote <nnethercote@mozilla.com> |
Sun, 01 Nov 2015 20:18:51 -0800 | |
changeset 271086 | c273256b3e07b1b7c1a1b039d65dcbc9862c9cd8 |
parent 271085 | 982d153e3ce6befe885bf9b6c2912acf2af125bd |
child 271087 | 17a904e9a7b2f73fee1a5525c6d1e6137fb68fa6 |
push id | 29631 |
push user | cbook@mozilla.com |
push date | Wed, 04 Nov 2015 11:00:16 +0000 |
treeherder | mozilla-central@6077f51254c6 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jimm |
bugs | 1186812 |
milestone | 45.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/plugins/ipc/PluginInstanceParent.cpp +++ b/dom/plugins/ipc/PluginInstanceParent.cpp @@ -1439,59 +1439,35 @@ PluginInstanceParent::NPP_Print(NPPrint* } PPluginScriptableObjectParent* PluginInstanceParent::AllocPPluginScriptableObjectParent() { return new PluginScriptableObjectParent(Proxy); } -#ifdef DEBUG -namespace { - -struct ActorSearchData -{ - PluginScriptableObjectParent* actor; - bool found; -}; - -PLDHashOperator -ActorSearch(NPObject* aKey, - PluginScriptableObjectParent* aData, - void* aUserData) -{ - ActorSearchData* asd = reinterpret_cast<ActorSearchData*>(aUserData); - if (asd->actor == aData) { - asd->found = true; - return PL_DHASH_STOP; - } - return PL_DHASH_NEXT; -} - -} // namespace -#endif // DEBUG - bool PluginInstanceParent::DeallocPPluginScriptableObjectParent( PPluginScriptableObjectParent* aObject) { PluginScriptableObjectParent* actor = static_cast<PluginScriptableObjectParent*>(aObject); NPObject* object = actor->GetObject(false); if (object) { NS_ASSERTION(mScriptableObjects.Get(object, nullptr), "NPObject not in the hash!"); mScriptableObjects.Remove(object); } #ifdef DEBUG else { - ActorSearchData asd = { actor, false }; - mScriptableObjects.EnumerateRead(ActorSearch, &asd); - NS_ASSERTION(!asd.found, "Actor in the hash with a null NPObject!"); + for (auto iter = mScriptableObjects.Iter(); !iter.Done(); iter.Next()) { + NS_ASSERTION(actor != iter.UserData(), + "Actor in the hash with a null NPObject!"); + } } #endif delete actor; return true; } bool