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

Unified Diff: content/browser/service_worker/service_worker_provider_host.h

Issue 558873003: Better coordinate what's responsible for associating a registration to a document. During navigatio… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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_provider_host.h
diff --git a/content/browser/service_worker/service_worker_provider_host.h b/content/browser/service_worker/service_worker_provider_host.h
index 6a6134a1472ba111ccd064d7da378ebe2ecdddf6..a025c5f1d3a10bc85eac82e9c03164879dbe35f3 100644
--- a/content/browser/service_worker/service_worker_provider_host.h
+++ b/content/browser/service_worker/service_worker_provider_host.h
@@ -99,6 +99,10 @@ class CONTENT_EXPORT ServiceWorkerProviderHost
// Returns true if |registration| can be associated with this provider.
bool CanAssociateRegistration(ServiceWorkerRegistration* registration);
+ // For use by the ServiceWorkerControlleeRequestHandler to disallow
+ // registration association while a navigation is occurring.
+ void SetAllowAssociation(bool allow) { allow_association_ = allow; }
+
// Returns true if the context referred to by this host (i.e. |context_|) is
// still alive.
bool IsContextAlive();
@@ -151,6 +155,7 @@ class CONTENT_EXPORT ServiceWorkerProviderHost
scoped_refptr<ServiceWorkerVersion> running_hosted_version_;
base::WeakPtr<ServiceWorkerContextCore> context_;
ServiceWorkerDispatcherHost* dispatcher_host_;
+ bool allow_association_;
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost);
};

Powered by Google App Engine
This is Rietveld 408576698