Issue #2654 - Remove pre-allocated process manager.

Resolves #2654
This commit is contained in:
Moonchild 2024-11-19 13:18:31 +01:00 • committed by roytam1
commit 75d698133f
22 changed files with 16 additions and 879 deletions

View file

@ -557,7 +557,6 @@ ContentChild::Init(MessageLoop* aIOLoop,
#endif
SendGetProcessAttributes(&mID, &mIsForBrowser);
InitProcessAttributes();
#ifdef NS_PRINTING
// Force the creation of the nsPrintingProxy so that it's IPC counterpart,
@ -568,12 +567,6 @@ ContentChild::Init(MessageLoop* aIOLoop,
return true;
}
void
ContentChild::InitProcessAttributes()
{
SetProcessName(NS_LITERAL_STRING("Web Content"), true);
}
void
ContentChild::SetProcessName(const nsAString& aName, bool aDontOverride)
{
@ -1245,15 +1238,6 @@ ContentChild::RecvBidiKeyboardNotify(const bool& aIsLangRTL,
return true;
}
static CancelableRunnable* sFirstIdleTask;
static void FirstIdle(void)
{
MOZ_ASSERT(sFirstIdleTask);
sFirstIdleTask = nullptr;
ContentChild::GetSingleton()->SendFirstIdle();
}
mozilla::jsipc::PJavaScriptChild *
ContentChild::AllocPJavaScriptChild()
{
@ -1322,22 +1306,6 @@ ContentChild::RecvPBrowserConstructor(PBrowserChild* aActor,
os->NotifyObservers(tc, "tab-child-created", nullptr);
}
static bool hasRunOnce = false;
if (!hasRunOnce) {
hasRunOnce = true;
MOZ_ASSERT(!sFirstIdleTask);
RefPtr<CancelableRunnable> firstIdleTask = NewCancelableRunnableFunction(FirstIdle);
sFirstIdleTask = firstIdleTask;
MessageLoop::current()->PostIdleTask(firstIdleTask.forget());
// Redo InitProcessAttributes() when the app or browser is really
// launching so the attributes will be correct.
mID = aCpID;
mIsForBrowser = aIsForBrowser;
InitProcessAttributes();
}
return true;
}
@ -1786,9 +1754,6 @@ ContentChild::ActorDestroy(ActorDestroyReason why)
// keep persistent state.
ProcessChild::QuickExit();
#else
if (sFirstIdleTask) {
sFirstIdleTask->Cancel();
}
nsHostObjectProtocolHandler::RemoveDataEntries();
@ -2082,16 +2047,6 @@ ContentChild::RecvCycleCollect()
return true;
}
static void
PreloadSlowThings()
{
// This fetches and creates all the built-in stylesheets.
nsLayoutStylesheetCache::Get()->UserContentSheet();
TabChild::PreloadSlowThings();
}
bool
ContentChild::RecvAppInfo(const nsCString& version, const nsCString& buildID,
const nsCString& name, const nsCString& UAName,
@ -2107,25 +2062,6 @@ ContentChild::RecvAppInfo(const nsCString& version, const nsCString& buildID,
return true;
}
bool
ContentChild::RecvAppInit()
{
if (!Preferences::GetBool("dom.ipc.processPrelaunch.enabled", false)) {
return true;
}
// If we're part of the mozbrowser machinery, go ahead and start
// preloading things. We can only do this for mozbrowser because
// PreloadSlowThings() may set the docshell of the first TabChild
// inactive, and we can only safely restore it to active from
// BrowserElementChild.js.
if (mIsForBrowser) {
PreloadSlowThings();
}
return true;
}
bool
ContentChild::RecvInitServiceWorkers(const ServiceWorkerConfiguration& aConfig)
{