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

Unified Diff: content/child/service_worker/service_worker_dispatcher.h

Issue 1146913004: Service Worker: Add ServiceWorkerContainer.getRegistrations() method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update tools/metrics/histograms/histograms.xml. Created 5 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/child/service_worker/service_worker_dispatcher.h
diff --git a/content/child/service_worker/service_worker_dispatcher.h b/content/child/service_worker/service_worker_dispatcher.h
index 28b9f4f98677b0094ab07abfcd9bcd53f32c5629..01b88cc638a301a9d57cf5190ced17ee87bc6cd2 100644
--- a/content/child/service_worker/service_worker_dispatcher.h
+++ b/content/child/service_worker/service_worker_dispatcher.h
@@ -52,6 +52,9 @@ class CONTENT_EXPORT ServiceWorkerDispatcher
typedef
blink::WebServiceWorkerProvider::WebServiceWorkerGetRegistrationCallbacks
WebServiceWorkerGetRegistrationCallbacks;
+ typedef
+ blink::WebServiceWorkerProvider::WebServiceWorkerGetRegistrationsCallbacks
+ WebServiceWorkerGetRegistrationsCallbacks;
typedef blink::WebServiceWorkerProvider::
WebServiceWorkerGetRegistrationForReadyCallbacks
WebServiceWorkerGetRegistrationForReadyCallbacks;
@@ -78,6 +81,10 @@ class CONTENT_EXPORT ServiceWorkerDispatcher
int provider_id,
const GURL& document_url,
WebServiceWorkerRegistrationCallbacks* callbacks);
+ // Corresponds to navigator.serviceWorker.getRegistrations()
+ void GetRegistrations(
+ int provider_id,
+ WebServiceWorkerGetRegistrationsCallbacks* callbacks);
void GetRegistrationForReady(
int provider_id,
@@ -137,6 +144,8 @@ class CONTENT_EXPORT ServiceWorkerDispatcher
IDMapOwnPointer> UnregistrationCallbackMap;
typedef IDMap<WebServiceWorkerGetRegistrationCallbacks,
IDMapOwnPointer> GetRegistrationCallbackMap;
+ typedef IDMap<WebServiceWorkerGetRegistrationsCallbacks,
+ IDMapOwnPointer> GetRegistrationsCallbackMap;
typedef IDMap<WebServiceWorkerGetRegistrationForReadyCallbacks,
IDMapOwnPointer> GetRegistrationForReadyCallbackMap;
@@ -177,6 +186,11 @@ class CONTENT_EXPORT ServiceWorkerDispatcher
int request_id,
const ServiceWorkerRegistrationObjectInfo& info,
const ServiceWorkerVersionAttributes& attrs);
+ void OnDidGetRegistrations(
+ int thread_id,
+ int request_id,
+ const std::vector<ServiceWorkerRegistrationObjectInfo>& infos,
+ const std::vector<ServiceWorkerVersionAttributes>& attrs);
void OnDidGetRegistrationForReady(
int thread_id,
int request_id,
@@ -195,6 +209,11 @@ class CONTENT_EXPORT ServiceWorkerDispatcher
int request_id,
blink::WebServiceWorkerError::ErrorType error_type,
const base::string16& message);
+ void OnGetRegistrationsError(
+ int thread_id,
+ int request_id,
+ blink::WebServiceWorkerError::ErrorType error_type,
+ const base::string16& message);
void OnServiceWorkerStateChanged(int thread_id,
int handle_id,
blink::WebServiceWorkerState state);
@@ -239,6 +258,7 @@ class CONTENT_EXPORT ServiceWorkerDispatcher
RegistrationCallbackMap pending_registration_callbacks_;
UnregistrationCallbackMap pending_unregistration_callbacks_;
GetRegistrationCallbackMap pending_get_registration_callbacks_;
+ GetRegistrationsCallbackMap pending_get_registrations_callbacks_;
GetRegistrationForReadyCallbackMap get_for_ready_callbacks_;
ProviderClientMap provider_clients_;

Powered by Google App Engine
This is Rietveld 408576698