Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: content/browser/service_worker/service_worker_register_job.cc

Issue 325173002: ServiceWorker: Confirm the liveness of the associated context before handling message (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix more Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_register_job.cc
diff --git a/content/browser/service_worker/service_worker_register_job.cc b/content/browser/service_worker/service_worker_register_job.cc
index 5948dcf29240136025ce32bccbc1f7708bde7b18..6eba2e8ab82a714235f7a0b97f6822f8e3f089cd 100644
--- a/content/browser/service_worker/service_worker_register_job.cc
+++ b/content/browser/service_worker/service_worker_register_job.cc
@@ -412,6 +412,8 @@ void ServiceWorkerRegisterJob::AssociateWaitingVersionToDocuments(
!it->IsAtEnd();
it->Advance()) {
ServiceWorkerProviderHost* host = it->GetProviderHost();
+ if (!host->IsContextAlive())
+ continue;
if (ServiceWorkerUtils::ScopeMatches(version->scope(),
host->document_url())) {
// The spec's _Update algorithm says, "upgrades active version to a new
@@ -440,6 +442,8 @@ void ServiceWorkerRegisterJob::DisassociateWaitingVersionFromDocuments(
!it->IsAtEnd();
it->Advance()) {
ServiceWorkerProviderHost* host = it->GetProviderHost();
+ if (!host->IsContextAlive())
+ continue;
if (host->waiting_version() &&
host->waiting_version()->version_id() == version_id) {
host->SetWaitingVersion(NULL);

Powered by Google App Engine
This is Rietveld 408576698