Bug 1370237 - Always increment plugin epoch when creating nsPluginHost in parent; r=bsmedberg
If we don't increment the plugin epoch in the parent process before
the first call to LoadPlugins, and all plugin info is already cached,
the epochs will match and we'll never get a complete plugin list in
the child. This patch makes sure our first parent/child epoch check
never matches, so we always update correctly.
MozReview-Commit-ID: BayHqBWQuHQ
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -296,16 +296,22 @@ nsPluginHost::nsPluginHost()
PLUGIN_LOG(PLUGIN_LOG_ALWAYS,("nsPluginHost::ctor\n"));
PR_LogFlush();
#endif
// Load plugins on creation, as there's a good chance we'll need to send them
// to content processes directly after creation.
if (XRE_IsParentProcess())
{
+ // Always increment the chrome epoch when we bring up the nsPluginHost in
+ // the parent process. If the only plugins we have are cached in
+ // pluginreg.dat, we won't see any plugin changes in LoadPlugins and the
+ // epoch will stay the same between the parent and child process, meaning
+ // plugins will never update in the child process.
+ IncrementChromeEpoch();
LoadPlugins();
}
}
nsPluginHost::~nsPluginHost()
{
PLUGIN_LOG(PLUGIN_LOG_ALWAYS,("nsPluginHost::dtor\n"));