mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-06 12:43:53 +00:00
Bug 1184432 - Use nsClassHashtable::ConstIter in GeckoMediaPluginServiceParent::AsyncShutdownPluginStates. r=cpearce
This commit is contained in:
parent
ac4e47349f
commit
35f6d9fd0f
@ -423,7 +423,23 @@ GeckoMediaPluginServiceParent::AsyncShutdownPluginStates::Update(const nsCString
|
|||||||
state->mStateSequence += aId;
|
state->mStateSequence += aId;
|
||||||
state->mLastStateDescription = aState;
|
state->mLastStateDescription = aState;
|
||||||
note += '{';
|
note += '{';
|
||||||
mStates.EnumerateRead(EnumReadPlugins, ¬e);
|
bool firstPlugin = true;
|
||||||
|
for (auto pluginIt = mStates.ConstIter(); !pluginIt.Done(); pluginIt.Next()) {
|
||||||
|
if (!firstPlugin) { note += ','; } else { firstPlugin = false; }
|
||||||
|
note += pluginIt.GetKey();
|
||||||
|
note += ":{";
|
||||||
|
bool firstInstance = true;
|
||||||
|
for (auto instanceIt = pluginIt.GetData()->ConstIter(); !instanceIt.Done(); instanceIt.Next()) {
|
||||||
|
if (!firstInstance) { note += ','; } else { firstInstance = false; }
|
||||||
|
note += instanceIt.GetKey();
|
||||||
|
note += ":\"";
|
||||||
|
note += instanceIt.GetData()->mStateSequence;
|
||||||
|
note += '=';
|
||||||
|
note += instanceIt.GetData()->mLastStateDescription;
|
||||||
|
note += '"';
|
||||||
|
}
|
||||||
|
note += '}';
|
||||||
|
}
|
||||||
note += '}';
|
note += '}';
|
||||||
LOGD(("%s::%s states[%s][%s]='%c'/'%s' -> %s", __CLASS__, __FUNCTION__,
|
LOGD(("%s::%s states[%s][%s]='%c'/'%s' -> %s", __CLASS__, __FUNCTION__,
|
||||||
aPlugin.get(), aInstance.get(), aId, aState.get(), note.get()));
|
aPlugin.get(), aInstance.get(), aId, aState.get(), note.get()));
|
||||||
@ -431,40 +447,6 @@ GeckoMediaPluginServiceParent::AsyncShutdownPluginStates::Update(const nsCString
|
|||||||
NS_LITERAL_CSTRING("AsyncPluginShutdownStates"),
|
NS_LITERAL_CSTRING("AsyncPluginShutdownStates"),
|
||||||
note);
|
note);
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
|
||||||
PLDHashOperator
|
|
||||||
GeckoMediaPluginServiceParent::AsyncShutdownPluginStates::EnumReadPlugins(
|
|
||||||
StateInstancesByPlugin::KeyType aKey,
|
|
||||||
StateInstancesByPlugin::UserDataType aData,
|
|
||||||
void* aUserArg)
|
|
||||||
{
|
|
||||||
nsCString& note = *static_cast<nsCString*>(aUserArg);
|
|
||||||
if (note.Last() != '{') { note += ','; }
|
|
||||||
note += aKey;
|
|
||||||
note += ":{";
|
|
||||||
aData->EnumerateRead(EnumReadInstances, ¬e);
|
|
||||||
note += '}';
|
|
||||||
return PL_DHASH_NEXT;
|
|
||||||
}
|
|
||||||
|
|
||||||
// static
|
|
||||||
PLDHashOperator
|
|
||||||
GeckoMediaPluginServiceParent::AsyncShutdownPluginStates::EnumReadInstances(
|
|
||||||
StatesByInstance::KeyType aKey,
|
|
||||||
StatesByInstance::UserDataType aData,
|
|
||||||
void* aUserArg)
|
|
||||||
{
|
|
||||||
nsCString& note = *static_cast<nsCString*>(aUserArg);
|
|
||||||
if (note.Last() != '{') { note += ','; }
|
|
||||||
note += aKey;
|
|
||||||
note += ":\"";
|
|
||||||
note += aData->mStateSequence;
|
|
||||||
note += '=';
|
|
||||||
note += aData->mLastStateDescription;
|
|
||||||
note += '"';
|
|
||||||
return PL_DHASH_NEXT;
|
|
||||||
}
|
|
||||||
#endif // MOZ_CRASHREPORTER
|
#endif // MOZ_CRASHREPORTER
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -152,12 +152,6 @@ private:
|
|||||||
struct State { nsAutoCString mStateSequence; nsCString mLastStateDescription; };
|
struct State { nsAutoCString mStateSequence; nsCString mLastStateDescription; };
|
||||||
typedef nsClassHashtable<nsCStringHashKey, State> StatesByInstance;
|
typedef nsClassHashtable<nsCStringHashKey, State> StatesByInstance;
|
||||||
typedef nsClassHashtable<nsCStringHashKey, StatesByInstance> StateInstancesByPlugin;
|
typedef nsClassHashtable<nsCStringHashKey, StatesByInstance> StateInstancesByPlugin;
|
||||||
static PLDHashOperator EnumReadPlugins(StateInstancesByPlugin::KeyType aKey,
|
|
||||||
StateInstancesByPlugin::UserDataType aData,
|
|
||||||
void* aUserArg);
|
|
||||||
static PLDHashOperator EnumReadInstances(StatesByInstance::KeyType aKey,
|
|
||||||
StatesByInstance::UserDataType aData,
|
|
||||||
void* aUserArg);
|
|
||||||
StateInstancesByPlugin mStates;
|
StateInstancesByPlugin mStates;
|
||||||
} mAsyncShutdownPluginStates;
|
} mAsyncShutdownPluginStates;
|
||||||
#endif // MOZ_CRASHREPORTER
|
#endif // MOZ_CRASHREPORTER
|
||||||
|
Loading…
Reference in New Issue
Block a user