Bug 1313641 - Initialize nsProtocolProxyService earlier. r=bsmedberg
authorLiang-Heng Chen <xeonchen@mozilla.com>
Tue, 08 Nov 2016 19:56:00 -0500
changeset 348848 161d052b3e74251f4ddf7f6300dcb02180b8b3af
parent 348847 3ae375b7fab132700fe66e8d179ed5bb723a9e67
child 348849 0c62b9c32517f75912b9c4b8d602cabab7dd5f85
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs1313641
milestone52.0a1
Bug 1313641 - Initialize nsProtocolProxyService earlier. r=bsmedberg MozReview-Commit-ID: BzKW9hwVTSu
dom/plugins/base/nsPluginHost.cpp
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -270,16 +270,22 @@ nsPluginHost::nsPluginHost()
   // has a zeroing operator new.
 {
   // Bump the pluginchanged epoch on startup. This insures content gets a
   // good plugin list the first time it requests it. Normally we'd just
   // init this to 1, but due to the unique nature of our ctor we need to do
   // this manually.
   if (XRE_IsParentProcess()) {
     IncrementChromeEpoch();
+  } else {
+    // When NPAPI requests the proxy setting by calling |FindProxyForURL|,
+    // the service is requested and initialized asynchronously, but
+    // |FindProxyForURL| is synchronous, so we should initialize this earlier.
+    nsCOMPtr<nsIProtocolProxyService> proxyService =
+      do_GetService(NS_PROTOCOLPROXYSERVICE_CONTRACTID);
   }
 
   // check to see if pref is set at startup to let plugins take over in
   // full page mode for certain image mime types that we handle internally
   mOverrideInternalTypes =
     Preferences::GetBool("plugin.override_internal_types", false);
 
   mPluginsDisabled = Preferences::GetBool("plugin.disable", false);