Bug 1288997 - We should not broadcast Blob URLs if we have only 1 content process, r=jdm a=ritu FIREFOX_50_0b6_BUILD1 FIREFOX_50_0b6_RELEASE
authorAndrea Marchesini <amarchesini@mozilla.com>
Mon, 10 Oct 2016 14:35:38 -0700
changeset 348575 70abfe99097824fd510544b188f24c588fd6d5a0
parent 348574 f48198e165031b2741df8b64367b65a63c17a263
child 348576 79bb587bcd3dcf679d2c65a0afa11834d1a3f1e7
child 348577 cefddaa8e22744692ab71228625fdb6faf5ca030
push id6476
push userkwierso@gmail.com
push dateMon, 10 Oct 2016 21:39:55 +0000
treeherdermozilla-beta@70abfe990978 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm, ritu
bugs1288997
milestone50.0
Bug 1288997 - We should not broadcast Blob URLs if we have only 1 content process, r=jdm a=ritu
dom/base/nsHostObjectProtocolHandler.cpp
--- a/dom/base/nsHostObjectProtocolHandler.cpp
+++ b/dom/base/nsHostObjectProtocolHandler.cpp
@@ -129,16 +129,21 @@ BroadcastBlobURLRegistration(const nsACS
   MOZ_ASSERT(aBlobImpl);
 
   if (XRE_IsParentProcess()) {
     ContentParent::BroadcastBlobURLRegistration(aURI, aBlobImpl,
                                                 aPrincipal);
     return;
   }
 
+  // We don't need to broadcast Blob URL if we have just 1 content process.
+  if (Preferences::GetInt("dom.ipc.processCount", 0) <= 1) {
+    return;
+  }
+
   ContentChild* cc = ContentChild::GetSingleton();
   BlobChild* actor = cc->GetOrCreateActorForBlobImpl(aBlobImpl);
   if (NS_WARN_IF(!actor)) {
     return;
   }
 
   NS_WARN_IF(!cc->SendStoreAndBroadcastBlobURLRegistration(nsCString(aURI), actor,
                                                            IPC::Principal(aPrincipal)));