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

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

Issue 871853002: ServiceWorker: add ServiceWorkerClients.claim() support (2/3). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fetch registrations from DB Created 5 years, 11 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_registration.h
diff --git a/content/browser/service_worker/service_worker_registration.h b/content/browser/service_worker/service_worker_registration.h
index 6a8d11fcac988e4ed81c51d19563e83879575f50..26184839c417c45962630e80c2b0e8fde3454119 100644
--- a/content/browser/service_worker/service_worker_registration.h
+++ b/content/browser/service_worker/service_worker_registration.h
@@ -109,6 +109,10 @@ class CONTENT_EXPORT ServiceWorkerRegistration
// initiated immediately.
void ActivateWaitingVersionWhenReady();
+ // Takes over control of provider hosts which are currently not controlled or
+ // controlled by other registrations.
+ void ClaimClients(const StatusCallback& callback);
+
// Triggers the [[ClearRegistration]] algorithm when the currently
// active version has no controllees. Deletes this registration
// from storage immediately.
@@ -163,6 +167,14 @@ class CONTENT_EXPORT ServiceWorkerRegistration
scoped_refptr<ServiceWorkerVersion> version,
ServiceWorkerStatusCode status);
+ void DidGetRegistrationsForClaimClients(
+ const StatusCallback& callback,
+ scoped_refptr<ServiceWorkerVersion> version,
+ const std::vector<ServiceWorkerRegistrationInfo>& registrations);
+ bool ShouldClaim(
+ ServiceWorkerProviderHost* provider_host,
+ const std::vector<ServiceWorkerRegistrationInfo>& registration_infos);
+
const GURL pattern_;
const int64 registration_id_;
bool is_deleted_;

Powered by Google App Engine
This is Rietveld 408576698