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

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

Issue 535753002: ServiceWorker: Implement navigator.serviceWorker.getRegistration [2/3] (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_context_core.h
diff --git a/content/browser/service_worker/service_worker_context_core.h b/content/browser/service_worker/service_worker_context_core.h
index d3d9898d1cabd31536aa8b18593cfe5e24dbd5e2..df674fa917c3aeab19741616b009da56e50764a2 100644
--- a/content/browser/service_worker/service_worker_context_core.h
+++ b/content/browser/service_worker/service_worker_context_core.h
@@ -63,6 +63,9 @@ class CONTENT_EXPORT ServiceWorkerContextCore
int64 version_id)> RegistrationCallback;
typedef base::Callback<
void(ServiceWorkerStatusCode status)> UnregistrationCallback;
+ typedef base::Callback<
+ void(ServiceWorkerStatusCode status,
+ int64 registration_id)> GetRegistrationCallback;
typedef IDMap<ServiceWorkerProviderHost, IDMapOwnPointer> ProviderMap;
typedef IDMap<ProviderMap, IDMapOwnPointer> ProcessToProviderMap;
@@ -154,6 +157,8 @@ class CONTENT_EXPORT ServiceWorkerContextCore
const RegistrationCallback& callback);
void UnregisterServiceWorker(const GURL& pattern,
const UnregistrationCallback& callback);
+ void GetRegistration(const GURL& document_url,
+ const GetRegistrationCallback& callback);
void UpdateServiceWorker(ServiceWorkerRegistration* registration);
// This class maintains collections of live instances, this class
@@ -204,6 +209,11 @@ class CONTENT_EXPORT ServiceWorkerContextCore
const UnregistrationCallback& callback,
ServiceWorkerStatusCode status);
+ void GetRegistrationComplete(
+ const GetRegistrationCallback& callback,
+ ServiceWorkerStatusCode status,
+ const scoped_refptr<ServiceWorkerRegistration>& registration);
+
base::WeakPtrFactory<ServiceWorkerContextCore> weak_factory_;
// It's safe to store a raw pointer instead of a scoped_refptr to |wrapper_|
// because the Wrapper::Shutdown call that hops threads to destroy |this| uses

Powered by Google App Engine
This is Rietveld 408576698