зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 4 changesets (bug 1290116) for w-e10s(5) failures on linux 64 opt
Backed out changeset 3e95eb4821b8 (bug 1290116) Backed out changeset d6a336a1fa97 (bug 1290116) Backed out changeset c50283f07370 (bug 1290116) Backed out changeset db014dc92795 (bug 1290116)
This commit is contained in:
Родитель
ae855cdb28
Коммит
d8f6cabd88
|
@ -1304,16 +1304,9 @@ ServiceWorkerManager::WorkerIsIdle(ServiceWorkerInfo* aWorker)
|
|||
return;
|
||||
}
|
||||
|
||||
if (reg->GetActive() != aWorker) {
|
||||
return;
|
||||
if (reg->GetActive() == aWorker) {
|
||||
reg->TryToActivateAsync();
|
||||
}
|
||||
|
||||
if (!reg->IsControllingDocuments() && reg->mPendingUninstall) {
|
||||
RemoveRegistration(reg);
|
||||
return;
|
||||
}
|
||||
|
||||
reg->TryToActivateAsync();
|
||||
}
|
||||
|
||||
already_AddRefed<ServiceWorkerJobQueue>
|
||||
|
@ -2008,20 +2001,17 @@ void
|
|||
ServiceWorkerManager::StopControllingADocument(ServiceWorkerRegistrationInfo* aRegistration)
|
||||
{
|
||||
aRegistration->StopControllingADocument();
|
||||
if (aRegistration->IsControllingDocuments() || !aRegistration->IsIdle()) {
|
||||
return;
|
||||
if (!aRegistration->IsControllingDocuments()) {
|
||||
if (aRegistration->mPendingUninstall) {
|
||||
RemoveRegistration(aRegistration);
|
||||
} else {
|
||||
// We use to aggressively terminate the worker at this point, but it
|
||||
// caused problems. There are more uses for a service worker than actively
|
||||
// controlled documents. We need to let the worker naturally terminate
|
||||
// in case its handling push events, message events, etc.
|
||||
aRegistration->TryToActivateAsync();
|
||||
}
|
||||
}
|
||||
|
||||
if (aRegistration->mPendingUninstall) {
|
||||
RemoveRegistration(aRegistration);
|
||||
return;
|
||||
}
|
||||
|
||||
// We use to aggressively terminate the worker at this point, but it
|
||||
// caused problems. There are more uses for a service worker than actively
|
||||
// controlled documents. We need to let the worker naturally terminate
|
||||
// in case its handling push events, message events, etc.
|
||||
aRegistration->TryToActivateAsync();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -223,7 +223,7 @@ ServiceWorkerRegistrationInfo::TryToActivate()
|
|||
AssertIsOnMainThread();
|
||||
bool controlling = IsControllingDocuments();
|
||||
bool skipWaiting = mWaitingWorker && mWaitingWorker->SkipWaitingFlag();
|
||||
bool idle = IsIdle();
|
||||
bool idle = !mActiveWorker || mActiveWorker->WorkerPrivate()->IsIdle();
|
||||
if (idle && (!controlling || skipWaiting)) {
|
||||
Activate();
|
||||
}
|
||||
|
@ -519,10 +519,4 @@ ServiceWorkerRegistrationInfo::TransitionWaitingToActive()
|
|||
WhichServiceWorker::ACTIVE_WORKER);
|
||||
}
|
||||
|
||||
bool
|
||||
ServiceWorkerRegistrationInfo::IsIdle() const
|
||||
{
|
||||
return !mActiveWorker || mActiveWorker->WorkerPrivate()->IsIdle();
|
||||
}
|
||||
|
||||
END_WORKERS_NAMESPACE
|
||||
|
|
|
@ -171,10 +171,6 @@ public:
|
|||
// worker is updated to the Activating state.
|
||||
void
|
||||
TransitionWaitingToActive();
|
||||
|
||||
// Determine if the registration is actively performing work.
|
||||
bool
|
||||
IsIdle() const;
|
||||
};
|
||||
|
||||
} // namespace workers
|
||||
|
|
|
@ -139,7 +139,7 @@ ServiceWorkerUnregisterJob::Unregister()
|
|||
InvokeResultCallbacks(NS_OK);
|
||||
|
||||
// "If no service worker client is using registration..."
|
||||
if (!registration->IsControllingDocuments() && registration->IsIdle()) {
|
||||
if (!registration->IsControllingDocuments()) {
|
||||
// "Invoke [[Clear Registration]]..."
|
||||
swm->RemoveRegistration(registration);
|
||||
}
|
||||
|
|
|
@ -145,35 +145,4 @@ promise_test(t => {
|
|||
assert_equals(registration.active, new_worker);
|
||||
});
|
||||
}, 'skipWaiting bypasses no controllee requirement');
|
||||
|
||||
// This test is not really about activation, but otherwise is very
|
||||
// similar to the other tests here.
|
||||
promise_test(t => {
|
||||
var scope = 'resources/unregister';
|
||||
var worker_url = 'resources/mint-new-worker.py';
|
||||
var registration;
|
||||
var iframe;
|
||||
var new_worker;
|
||||
return setup_activation_test(t, scope, worker_url)
|
||||
.then(result => {
|
||||
registration = result.registration;
|
||||
iframe = result.iframe;
|
||||
// Remove the iframe.
|
||||
iframe.remove();
|
||||
return registration.unregister();
|
||||
})
|
||||
.then(() => {
|
||||
// The unregister operation should wait for the active worker to
|
||||
// finish processing its events before clearing the registration.
|
||||
new_worker = registration.waiting;
|
||||
var reached_redundant = wait_for_state(t, new_worker, 'redundant');
|
||||
registration.active.postMessage('go');
|
||||
return reached_redundant;
|
||||
})
|
||||
.then(() => {
|
||||
assert_equals(registration.installing, null);
|
||||
assert_equals(registration.waiting, null);
|
||||
assert_equals(registration.active, null);
|
||||
});
|
||||
}, 'finishing a request triggers unregister');
|
||||
</script>
|
||||
|
|
Загрузка…
Ссылка в новой задаче