Bug 1370237 - Always increment plugin epoch when creating nsPluginHost in parent; r=bsmedberg draft
authorKyle Machulis <kyle@nonpolynomial.com>
Mon, 05 Jun 2017 14:34:29 -0700
changeset 589232 abd8b72fce01b29a841d3aed441ad0869460347f
parent 589150 cad53f061da634a16ea75887558301b77f65745d
child 631801 6396224774e458df9b46e069e5df42030a8e3998
push id62286
push userbmo:kyle@nonpolynomial.com
push dateMon, 05 Jun 2017 21:36:59 +0000
reviewersbsmedberg
bugs1370237
milestone55.0a1
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
dom/plugins/base/nsPluginHost.cpp
--- 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"));