mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backout 250a95a6ff00 (bug 828114) for mochitest timeouts on a CLOSED TREE
This commit is contained in:
parent
4c21802bb7
commit
51e3bb2179
@ -646,11 +646,6 @@ struct DelayedDeleteContentParentTask : public nsRunnable
|
||||
void
|
||||
ContentParent::ActorDestroy(ActorDestroyReason why)
|
||||
{
|
||||
if (mForceKillTask) {
|
||||
mForceKillTask->Cancel();
|
||||
mForceKillTask = nullptr;
|
||||
}
|
||||
|
||||
nsRefPtr<nsFrameMessageManager> ppm = mMessageManager;
|
||||
if (ppm) {
|
||||
ppm->ReceiveMessage(static_cast<nsIContentFrameMessageManager*>(ppm.get()),
|
||||
@ -756,35 +751,9 @@ ContentParent::ActorDestroy(ActorDestroyReason why)
|
||||
NS_DispatchToCurrentThread(new DelayedDeleteContentParentTask(this));
|
||||
}
|
||||
|
||||
void
|
||||
ContentParent::NotifyTabDestroying(PBrowserParent* aTab)
|
||||
{
|
||||
// There can be more than one PBrowser for a given app process
|
||||
// because of popup windows. PBrowsers can also destroy
|
||||
// concurrently. When all the PBrowsers are destroying, kick off
|
||||
// another task to ensure the child process *really* shuts down,
|
||||
// even if the PBrowsers themselves never finish destroying.
|
||||
int32_t numLiveTabs = ManagedPBrowserParent().Length();
|
||||
++mNumDestroyingTabs;
|
||||
if (mNumDestroyingTabs != numLiveTabs) {
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(!mForceKillTask);
|
||||
int32_t timeoutSecs =
|
||||
Preferences::GetInt("dom.ipc.tabs.shutdownTimeoutSecs", 5);
|
||||
if (timeoutSecs > 0) {
|
||||
MessageLoop::current()->PostDelayedTask(
|
||||
FROM_HERE,
|
||||
mForceKillTask = NewRunnableMethod(this, &ContentParent::KillHard),
|
||||
timeoutSecs * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ContentParent::NotifyTabDestroyed(PBrowserParent* aTab)
|
||||
{
|
||||
--mNumDestroyingTabs;
|
||||
// There can be more than one PBrowser for a given app process
|
||||
// because of popup windows. When the last one closes, shut
|
||||
// us down.
|
||||
@ -828,8 +797,6 @@ ContentParent::ContentParent(const nsAString& aAppManifestURL,
|
||||
, mRunToCompletionDepth(0)
|
||||
, mShouldCallUnblockChild(false)
|
||||
, mAppManifestURL(aAppManifestURL)
|
||||
, mForceKillTask(nullptr)
|
||||
, mNumDestroyingTabs(0)
|
||||
, mIsAlive(true)
|
||||
, mIsDestroyed(false)
|
||||
, mSendPermissionUpdates(false)
|
||||
@ -888,10 +855,6 @@ ContentParent::ContentParent(const nsAString& aAppManifestURL,
|
||||
|
||||
ContentParent::~ContentParent()
|
||||
{
|
||||
if (mForceKillTask) {
|
||||
mForceKillTask->Cancel();
|
||||
}
|
||||
|
||||
if (OtherProcess())
|
||||
base::CloseProcessHandle(OtherProcess());
|
||||
|
||||
@ -1479,7 +1442,6 @@ ContentParent::GetOrCreateActorForBlob(nsIDOMBlob* aBlob)
|
||||
void
|
||||
ContentParent::KillHard()
|
||||
{
|
||||
mForceKillTask = nullptr;
|
||||
// This ensures the process is eventually killed, but doesn't
|
||||
// immediately KILLITWITHFIRE because we want to get a minidump if
|
||||
// possible. After a timeout though, the process is forceably
|
||||
|
@ -104,8 +104,6 @@ public:
|
||||
virtual bool CheckPermission(const nsAString& aPermission);
|
||||
virtual bool CheckManifestURL(const nsAString& aManifestURL);
|
||||
|
||||
/** Notify that a tab is beginning its destruction sequence. */
|
||||
void NotifyTabDestroying(PBrowserParent* aTab);
|
||||
/** Notify that a tab was destroyed during normal operation. */
|
||||
void NotifyTabDestroyed(PBrowserParent* aTab);
|
||||
|
||||
@ -355,15 +353,6 @@ private:
|
||||
const nsString mAppManifestURL;
|
||||
nsRefPtr<nsFrameMessageManager> mMessageManager;
|
||||
|
||||
// After we initiate shutdown, we also start a timer to ensure
|
||||
// that even content processes that are 100% blocked (say from
|
||||
// SIGSTOP), are still killed eventually. This task enforces that
|
||||
// timer.
|
||||
CancelableTask* mForceKillTask;
|
||||
// How many tabs we're waiting to finish their destruction
|
||||
// sequence. Precisely, how many TabParents have called
|
||||
// NotifyTabDestroying() but not called NotifyTabDestroyed().
|
||||
int32_t mNumDestroyingTabs;
|
||||
// True only while this is ready to be used to host remote tabs.
|
||||
// This must not be used for new purposes after mIsAlive goes to
|
||||
// false, but some previously scheduled IPC traffic may still pass
|
||||
|
@ -124,9 +124,6 @@ TabParent::Destroy()
|
||||
frame->Destroy();
|
||||
}
|
||||
mIsDestroyed = true;
|
||||
|
||||
ContentParent* cp = static_cast<ContentParent*>(Manager());
|
||||
cp->NotifyTabDestroying(this);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -1762,10 +1762,6 @@ pref("dom.ipc.plugins.hangUITimeoutSecs", 5);
|
||||
// Minimum time that the plugin hang UI will be displayed
|
||||
pref("dom.ipc.plugins.hangUIMinDisplaySecs", 10);
|
||||
#endif
|
||||
// How long a content process can take before closing its IPC channel
|
||||
// after shutdown is initiated. If the process exceeds the timeout,
|
||||
// we fear the worst and kill it.
|
||||
pref("dom.ipc.tabs.shutdownTimeoutSecs", 5);
|
||||
#else
|
||||
// No timeout in DEBUG builds
|
||||
pref("dom.ipc.plugins.timeoutSecs", 0);
|
||||
@ -1775,7 +1771,6 @@ pref("dom.ipc.plugins.parentTimeoutSecs", 0);
|
||||
pref("dom.ipc.plugins.hangUITimeoutSecs", 0);
|
||||
pref("dom.ipc.plugins.hangUIMinDisplaySecs", 0);
|
||||
#endif
|
||||
pref("dom.ipc.tabs.shutdownTimeoutSecs", 0);
|
||||
#endif
|
||||
|
||||
#ifdef XP_WIN
|
||||
|
Loading…
Reference in New Issue
Block a user