Bug 1398665 - Handle the case when gNeckoChild is null properly in RequestContext::DOMContentLoaded. r=hurley
authorKershaw Chang <kechang@mozilla.com>
Tue, 12 Sep 2017 08:40:00 -0400
changeset 380329 e58e11f74cc02a5aec2b4588190385b1980654e0
parent 380328 32268f6138e0e93ac223c863d9587ff680549764
child 380330 f255ec4e8c361e4526b7bfb1083cecb41fabbdd1
push id32486
push userarchaeopteryx@coole-files.de
push dateWed, 13 Sep 2017 09:28:25 +0000
treeherdermozilla-central@987326974635 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershurley
bugs1398665
milestone57.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 1398665 - Handle the case when gNeckoChild is null properly in RequestContext::DOMContentLoaded. r=hurley In child process, during shutdown, it's possible that IsNeckoChild() is true but gNeckoChild is null. When this case happens, we have to early return in RequestContext::DOMContentLoaded() to avoid the asseration failure (MOZ_ASSERT(!IsNeckoChild())) in RequestContext::ScheduleUnblock().
netwerk/base/RequestContextService.cpp
--- a/netwerk/base/RequestContextService.cpp
+++ b/netwerk/base/RequestContextService.cpp
@@ -120,19 +120,21 @@ RequestContext::BeginLoad()
 
 NS_IMETHODIMP
 RequestContext::DOMContentLoaded()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   LOG(("RequestContext::DOMContentLoaded %p", this));
 
-  if (IsNeckoChild() && gNeckoChild) {
+  if (IsNeckoChild()) {
     // Tailing is not supported on the child process
-    gNeckoChild->SendRequestContextAfterDOMContentLoaded(mID);
+    if (gNeckoChild) {
+      gNeckoChild->SendRequestContextAfterDOMContentLoaded(mID);
+    }
     return NS_OK;
   }
 
   if (mAfterDOMContentLoaded) {
     // There is a possibility of a duplicate notification
     return NS_OK;
   }