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

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 7551e31d97657d320746a898aba159b2645aa16e..4662ddd4a9d46de812df0d8cf933b3cb24bc8fe7 100644
--- a/content/browser/service_worker/service_worker_provider_host.h
+++ b/content/browser/service_worker/service_worker_provider_host.h
@@ -99,6 +99,11 @@ 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
+ // new registration association while a navigation is occurring and
+ // an existing registration is being looked for.
+ 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();
@@ -153,6 +158,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