Bug 1070755: Fix invalid key for module init histogram; r=vladan
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -1399,24 +1399,16 @@ PluginModuleParent::NP_Initialize(NPNets
return NS_ERROR_FAILURE;
}
else if (*error != NPERR_NO_ERROR) {
Close();
return NS_OK;
}
TimeStamp callNpInitEnd = TimeStamp::Now();
mTimeBlocked += (callNpInitEnd - callNpInitStart);
- /** mTimeBlocked measures the time that the main thread has been blocked
- * on plugin module initialization. As implemented, this is the sum of
- * plugin-container launch + NP_Initialize
- */
- Telemetry::Accumulate(Telemetry::BLOCKED_ON_PLUGIN_MODULE_INIT_MS,
- GetHistogramKey(),
- static_cast<uint32_t>(mTimeBlocked.ToMilliseconds()));
- mTimeBlocked = TimeDuration();
}
SetPluginFuncs(pFuncs);
return NS_OK;
}
#else
nsresult
@@ -1467,27 +1459,16 @@ PluginModuleChromeParent::NP_Initialize(
iconPath)))
unused << SendSetAudioSessionData(id, sessionName, iconPath);
#endif
#ifdef MOZ_CRASHREPORTER_INJECTOR
InitializeInjector();
#endif
- /** This Accumulate must be placed below the call to InitializeInjector()
- * because mTimeBlocked is modified in that function.
- * mTimeBlocked measures the time that the main thread has been blocked
- * on plugin module initialization. As implemented, this is the sum of
- * plugin-container launch + toolhelp32 snapshot + NP_Initialize
- */
- Telemetry::Accumulate(Telemetry::BLOCKED_ON_PLUGIN_MODULE_INIT_MS,
- GetHistogramKey(),
- static_cast<uint32_t>(mTimeBlocked.ToMilliseconds()));
- mTimeBlocked = TimeDuration();
-
return NS_OK;
}
#endif
nsresult
PluginModuleParent::NP_Shutdown(NPError* error)
{
PLUGIN_LOG_DEBUG_METHOD;
@@ -1569,16 +1550,26 @@ PluginModuleParent::NPP_New(NPMIMEType p
if (mShutdown) {
*error = NPERR_GENERIC_ERROR;
return NS_ERROR_FAILURE;
}
if (mPluginName.IsEmpty()) {
GetPluginDetails(mPluginName, mPluginVersion);
+ /** mTimeBlocked measures the time that the main thread has been blocked
+ * on plugin module initialization. As implemented, this is the sum of
+ * plugin-container launch + toolhelp32 snapshot + NP_Initialize.
+ * We don't accumulate its value until here because the plugin info
+ * is not available until *after* NP_Initialize.
+ */
+ Telemetry::Accumulate(Telemetry::BLOCKED_ON_PLUGIN_MODULE_INIT_MS,
+ GetHistogramKey(),
+ static_cast<uint32_t>(mTimeBlocked.ToMilliseconds()));
+ mTimeBlocked = TimeDuration();
}
// create the instance on the other side
InfallibleTArray<nsCString> names;
InfallibleTArray<nsCString> values;
for (int i = 0; i < argc; ++i) {
names.AppendElement(NullableString(argn[i]));