Bug 1363659 - Ensure not sending cookie service constructor when shutting down, r=ehsan

This commit is contained in:
Junior Hsu 2017-05-26 03:08:00 +02:00
Родитель 6f1e15db21
Коммит 78f744d40d
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -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<mozilla::dom::ContentChild*>(gNeckoChild->Manager());
if (cc->IsShuttingDown()) {
return;
}
// This corresponds to Release() in DeallocPCookieService.
NS_ADDREF_THIS();