From 78f744d40d24739f2164ec3ecde2e1764e190252 Mon Sep 17 00:00:00 2001 From: Junior Hsu Date: Fri, 26 May 2017 03:08:00 +0200 Subject: [PATCH] Bug 1363659 - Ensure not sending cookie service constructor when shutting down, r=ehsan --- netwerk/cookie/CookieServiceChild.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/netwerk/cookie/CookieServiceChild.cpp b/netwerk/cookie/CookieServiceChild.cpp index ba9879976f84..842fc96cd9df 100644 --- a/netwerk/cookie/CookieServiceChild.cpp +++ b/netwerk/cookie/CookieServiceChild.cpp @@ -6,6 +6,7 @@ #include "mozilla/net/CookieServiceChild.h" #include "mozilla/LoadInfo.h" #include "mozilla/BasePrincipal.h" +#include "mozilla/dom/ContentChild.h" #include "mozilla/ipc/URIUtils.h" #include "mozilla/net/NeckoChild.h" #include "nsIChannel.h" @@ -47,6 +48,12 @@ CookieServiceChild::CookieServiceChild() { NS_ASSERTION(IsNeckoChild(), "not a child process"); + mozilla::dom::ContentChild* cc = + static_cast(gNeckoChild->Manager()); + if (cc->IsShuttingDown()) { + return; + } + // This corresponds to Release() in DeallocPCookieService. NS_ADDREF_THIS();