Bug 1295349 - Assert in UDPSocketParent::Init(). r=hurley
authorJason Duell <jduell.mcbugs@gmail.com>
Thu, 18 Aug 2016 21:55:00 -0400
changeset 311008 5e4e6204c2227c8de851689633dc8fbab4ff0e20
parent 311007 b357fab2feb46ce6295c63e6b8386c72e78c50cb
child 311009 268f50cd097c7d48d8f3d756fd40ff6aa0904ad2
push id30599
push userryanvm@gmail.com
push dateThu, 25 Aug 2016 12:11:16 +0000
treeherdermozilla-central@e56ac7b94f39 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershurley
bugs1295349
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1295349 - Assert in UDPSocketParent::Init(). r=hurley
netwerk/ipc/NeckoCommon.cpp
netwerk/ipc/NeckoCommon.h
netwerk/ipc/NeckoParent.cpp
--- a/netwerk/ipc/NeckoCommon.cpp
+++ b/netwerk/ipc/NeckoCommon.cpp
@@ -7,13 +7,12 @@
 
 #include "NeckoCommon.h"
 
 namespace mozilla {
 namespace net {
 
 namespace NeckoCommonInternal {
   bool gSecurityDisabled = true;
-  bool gRegisteredBool = false;
 } // namespace NeckoCommonInternal
 
 } // namespace net
 } // namespace mozilla
--- a/netwerk/ipc/NeckoCommon.h
+++ b/netwerk/ipc/NeckoCommon.h
@@ -100,22 +100,16 @@ namespace NeckoCommonInternal {
   extern bool gSecurityDisabled;
   extern bool gRegisteredBool;
 } // namespace NeckoCommonInternal
 
 // This should always return true unless xpcshell tests are being used
 inline bool
 UsingNeckoIPCSecurity()
 {
-
-  if (!NeckoCommonInternal::gRegisteredBool) {
-    Preferences::AddBoolVarCache(&NeckoCommonInternal::gSecurityDisabled,
-                                 "network.disable.ipc.security");
-    NeckoCommonInternal::gRegisteredBool = true;
-  }
   return !NeckoCommonInternal::gSecurityDisabled;
 }
 
 inline bool
 MissingRequiredTabChild(mozilla::dom::TabChild* tabChild,
                         const char* context)
 {
   if (UsingNeckoIPCSecurity()) {
--- a/netwerk/ipc/NeckoParent.cpp
+++ b/netwerk/ipc/NeckoParent.cpp
@@ -71,16 +71,25 @@ NeckoParent::NeckoParent()
   // Init HTTP protocol handler now since we need atomTable up and running very
   // early (IPDL argument handling for PHttpChannel constructor needs it) so
   // normal init (during 1st Http channel request) isn't early enough.
   nsCOMPtr<nsIProtocolHandler> proto =
     do_GetService("@mozilla.org/network/protocol;1?name=http");
 
   mObserver = new OfflineObserver(this);
   gNeckoParent = this;
+
+  // only register once--we will have multiple NeckoParents if there are
+  // multiple child processes.
+  static bool registeredBool = false;
+  if (!registeredBool) {
+    Preferences::AddBoolVarCache(&NeckoCommonInternal::gSecurityDisabled,
+                                 "network.disable.ipc.security");
+    registeredBool = true;
+  }
 }
 
 NeckoParent::~NeckoParent()
 {
   gNeckoParent = nullptr;
   if (mObserver) {
     mObserver->RemoveObserver();
   }