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

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

Issue 1146913004: Service Worker: Add ServiceWorkerContainer.getRegistrations() method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactor GetRegistrationsForOrigin to get real registrations. Created 5 years, 7 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_storage.h
diff --git a/content/browser/service_worker/service_worker_storage.h b/content/browser/service_worker/service_worker_storage.h
index 1bfa737d83679f42b96dda6b49c652117d56a3c3..f5b715d847d8c60e2c7413c570e1f67e80442741 100644
--- a/content/browser/service_worker/service_worker_storage.h
+++ b/content/browser/service_worker/service_worker_storage.h
@@ -53,9 +53,10 @@ class CONTENT_EXPORT ServiceWorkerStorage
typedef base::Callback<void(ServiceWorkerStatusCode status,
const scoped_refptr<ServiceWorkerRegistration>&
registration)> FindRegistrationCallback;
- typedef base::Callback<
- void(const std::vector<ServiceWorkerRegistrationInfo>& registrations)>
- GetRegistrationsInfosCallback;
+ typedef base::Callback<void(const std::vector<ServiceWorkerRegistration*>&
+ registrations)> GetRegistrationsCallback;
+ typedef base::Callback<void(const std::vector<ServiceWorkerRegistrationInfo>&
+ registrations)> GetRegistrationsInfosCallback;
typedef base::Callback<
void(ServiceWorkerStatusCode status, bool are_equal)>
CompareCallback;
@@ -109,13 +110,12 @@ class CONTENT_EXPORT ServiceWorkerStorage
ServiceWorkerRegistration* GetUninstallingRegistration(const GURL& scope);
- // Returns info about all stored and initially installing registrations for
- // a given origin.
- void GetRegistrationsForOrigin(
- const GURL& origin, const GetRegistrationsInfosCallback& callback);
+ // Returns all stored registrations for a given origin.
+ void GetRegistrationsForOrigin(const GURL& origin,
+ const GetRegistrationsCallback& callback);
// Returns info about all stored and initially installing registrations.
- void GetAllRegistrations(const GetRegistrationsInfosCallback& callback);
+ void GetAllRegistrationsInfos(const GetRegistrationsInfosCallback& callback);
// Commits |registration| with the installed but not activated |version|
// to storage, overwritting any pre-existing registration data for the scope.
@@ -253,6 +253,7 @@ class CONTENT_EXPORT ServiceWorkerStorage
};
typedef std::vector<ServiceWorkerDatabase::RegistrationData> RegistrationList;
+ typedef std::vector<ResourceList> ResourceListList;
falken 2015/06/05 02:58:22 nit: It's subjective but feels nicer to me to just
jungkees 2015/06/05 06:58:07 Removed the typedef. Seems ListList sounded odd an
falken 2015/06/08 04:59:09 Yea ListList is weird and generally it's easier fo
typedef std::map<int64, scoped_refptr<ServiceWorkerRegistration> >
RegistrationRefsById;
typedef base::Callback<void(
@@ -319,11 +320,15 @@ class CONTENT_EXPORT ServiceWorkerStorage
const ServiceWorkerDatabase::RegistrationData& data,
const ResourceList& resources,
ServiceWorkerDatabase::Status status);
- void DidGetRegistrations(
- const GetRegistrationsInfosCallback& callback,
- RegistrationList* registrations,
- const GURL& origin_filter,
- ServiceWorkerDatabase::Status status);
+ void DidGetRegistrations(const GetRegistrationsCallback& callback,
+ RegistrationList* registrations,
+ ResourceListList* resource_lists,
+ const GURL& origin_filter,
+ ServiceWorkerDatabase::Status status);
+ void DidGetRegistrationsInfos(const GetRegistrationsInfosCallback& callback,
+ RegistrationList* registrations,
+ const GURL& origin_filter,
+ ServiceWorkerDatabase::Status status);
void DidStoreRegistration(
const StatusCallback& callback,
const ServiceWorkerDatabase::RegistrationData& new_version,

Powered by Google App Engine
This is Rietveld 408576698