зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1425559 - "content-child-will-shutdown" notification when the content process starts the shutting down, r=smaug
This commit is contained in:
Родитель
dd2cca5c61
Коммит
6f1cf8bc7a
|
@ -2936,6 +2936,19 @@ ContentChild::ForceKillTimerCallback(nsITimer* aTimer, void* aClosure)
|
||||||
|
|
||||||
mozilla::ipc::IPCResult
|
mozilla::ipc::IPCResult
|
||||||
ContentChild::RecvShutdown()
|
ContentChild::RecvShutdown()
|
||||||
|
{
|
||||||
|
nsCOMPtr<nsIObserverService> os = services::GetObserverService();
|
||||||
|
if (os) {
|
||||||
|
os->NotifyObservers(static_cast<nsIContentChild*>(this),
|
||||||
|
"content-child-will-shutdown", nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ShutdownInternal();
|
||||||
|
return IPC_OK();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ContentChild::ShutdownInternal()
|
||||||
{
|
{
|
||||||
// If we receive the shutdown message from within a nested event loop, we want
|
// If we receive the shutdown message from within a nested event loop, we want
|
||||||
// to wait for that event loop to finish. Otherwise we could prematurely
|
// to wait for that event loop to finish. Otherwise we could prematurely
|
||||||
|
@ -2956,9 +2969,10 @@ ContentChild::RecvShutdown()
|
||||||
// then.
|
// then.
|
||||||
MessageLoop::current()->PostDelayedTask(
|
MessageLoop::current()->PostDelayedTask(
|
||||||
NewRunnableMethod(
|
NewRunnableMethod(
|
||||||
"dom::ContentChild::RecvShutdown", this, &ContentChild::RecvShutdown),
|
"dom::ContentChild::RecvShutdown", this,
|
||||||
|
&ContentChild::ShutdownInternal),
|
||||||
100);
|
100);
|
||||||
return IPC_OK();
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mShuttingDown = true;
|
mShuttingDown = true;
|
||||||
|
@ -3005,8 +3019,6 @@ ContentChild::RecvShutdown()
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCShutdownState"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCShutdownState"),
|
||||||
sent ? NS_LITERAL_CSTRING("SendFinishShutdown (sent)")
|
sent ? NS_LITERAL_CSTRING("SendFinishShutdown (sent)")
|
||||||
: NS_LITERAL_CSTRING("SendFinishShutdown (failed)"));
|
: NS_LITERAL_CSTRING("SendFinishShutdown (failed)"));
|
||||||
|
|
||||||
return IPC_OK();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PBrowserOrId
|
PBrowserOrId
|
||||||
|
|
|
@ -727,6 +727,8 @@ private:
|
||||||
static void ForceKillTimerCallback(nsITimer* aTimer, void* aClosure);
|
static void ForceKillTimerCallback(nsITimer* aTimer, void* aClosure);
|
||||||
void StartForceKillTimer();
|
void StartForceKillTimer();
|
||||||
|
|
||||||
|
void ShutdownInternal();
|
||||||
|
|
||||||
virtual void ActorDestroy(ActorDestroyReason why) override;
|
virtual void ActorDestroy(ActorDestroyReason why) override;
|
||||||
|
|
||||||
virtual void ProcessingError(Result aCode, const char* aReason) override;
|
virtual void ProcessingError(Result aCode, const char* aReason) override;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче