mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 965912 - Initialize DateCacheCleaner (which registers an observer to the chrome process) after forking from the Nuwa process. r=khuey
This commit is contained in:
parent
0a498d5914
commit
9801876ee5
@ -134,6 +134,7 @@
|
||||
#include "AudioChannelService.h"
|
||||
#include "JavaScriptChild.h"
|
||||
#include "mozilla/dom/telephony/PTelephonyChild.h"
|
||||
#include "mozilla/dom/time/DateCacheCleaner.h"
|
||||
#include "mozilla/net/NeckoMessageUtils.h"
|
||||
|
||||
using namespace base;
|
||||
@ -311,6 +312,15 @@ NS_IMPL_ISUPPORTS1(SystemMessageHandledObserver, nsIObserver)
|
||||
|
||||
ContentChild* ContentChild::sSingleton;
|
||||
|
||||
// Performs initialization that is not fork-safe, i.e. that must be done after
|
||||
// forking from the Nuwa process.
|
||||
static void
|
||||
InitOnContentProcessCreated()
|
||||
{
|
||||
// This will register cross-process observer.
|
||||
mozilla::dom::time::InitializeDateCacheCleaner();
|
||||
}
|
||||
|
||||
ContentChild::ContentChild()
|
||||
: mID(uint64_t(-1))
|
||||
#ifdef ANDROID
|
||||
@ -462,6 +472,10 @@ ContentChild::InitXPCOM()
|
||||
nsRefPtr<SystemMessageHandledObserver> sysMsgObserver =
|
||||
new SystemMessageHandledObserver();
|
||||
sysMsgObserver->Init();
|
||||
|
||||
#ifndef MOZ_NUWA_PROCESS
|
||||
InitOnContentProcessCreated();
|
||||
#endif
|
||||
}
|
||||
|
||||
PMemoryReportRequestChild*
|
||||
@ -1623,6 +1637,10 @@ public:
|
||||
|
||||
toplevel = toplevel->getNext();
|
||||
}
|
||||
|
||||
// Perform other after-fork initializations.
|
||||
InitOnContentProcessCreated();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
};
|
||||
|
@ -66,7 +66,7 @@ CrashReporterParent::CrashReporterParent()
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
mNotes(4),
|
||||
#endif
|
||||
mStartTime(time(nullptr))
|
||||
mStartTime(::time(nullptr))
|
||||
, mInitialized(false)
|
||||
{
|
||||
MOZ_COUNT_CTOR(CrashReporterParent);
|
||||
|
@ -130,7 +130,6 @@ using namespace mozilla;
|
||||
using namespace mozilla::net;
|
||||
using namespace mozilla::dom;
|
||||
using namespace mozilla::dom::ipc;
|
||||
using namespace mozilla::dom::time;
|
||||
|
||||
nsrefcnt nsLayoutStatics::sLayoutStaticRefcnt = 0;
|
||||
|
||||
@ -280,8 +279,6 @@ nsLayoutStatics::Initialize()
|
||||
nsCookieService::AppClearDataObserverInit();
|
||||
nsApplicationCacheService::AppClearDataObserverInit();
|
||||
|
||||
InitializeDateCacheCleaner();
|
||||
|
||||
HTMLVideoElement::Init();
|
||||
|
||||
CacheObserver::Init();
|
||||
|
Loading…
Reference in New Issue
Block a user