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 85e1a72b40cf26b92c2967ebd2efd24bd870956f..b7ace309b8967d244bc772656ae5c54e1d979b6a 100644 |
--- a/content/browser/service_worker/service_worker_storage.h |
+++ b/content/browser/service_worker/service_worker_storage.h |
@@ -5,6 +5,7 @@ |
#ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_STORAGE_H_ |
#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_STORAGE_H_ |
+#include <algorithm> |
#include <deque> |
#include <map> |
#include <set> |
@@ -57,6 +58,8 @@ class CONTENT_EXPORT ServiceWorkerStorage |
typedef base::Callback< |
void(ServiceWorkerStatusCode status, bool are_equal)> |
CompareCallback; |
+ typedef base::Callback<void(const std::map<GURL, int64>& origin_usage)> |
+ OriginUsageCallback; |
~ServiceWorkerStorage() override; |
@@ -95,14 +98,17 @@ class CONTENT_EXPORT ServiceWorkerStorage |
// Returns info about all stored and initially installing registrations. |
void GetAllRegistrations(const GetAllRegistrationInfosCallback& callback); |
+ void GetAllUsageByOrigin(const OriginUsageCallback& callback); |
+ |
// Commits |registration| with the installed but not activated |version| |
- // to storage, overwritting any pre-existing registration data for the scope. |
- // A pre-existing version's script resources remain available if that version |
+ // to storage, overwritting any pre-existing registration data for the |
+ // scope. |
+ // A pre-existing version's script resources remain available if that |
+ // version |
// is live. PurgeResources should be called when it's OK to delete them. |
michaeln
2014/10/24 23:15:47
how the comment is wrapped is on with one word lin
dmurph
2014/10/27 21:37:06
Done.
|
- void StoreRegistration( |
- ServiceWorkerRegistration* registration, |
- ServiceWorkerVersion* version, |
- const StatusCallback& callback); |
+ void StoreRegistration(ServiceWorkerRegistration* registration, |
+ ServiceWorkerVersion* version, |
+ const StatusCallback& callback); |
// Updates the state of the registration's stored version to active. |
void UpdateToActiveState( |
@@ -207,11 +213,11 @@ class CONTENT_EXPORT ServiceWorkerStorage |
typedef base::Callback<void( |
InitialData* data, |
ServiceWorkerDatabase::Status status)> InitializeCallback; |
- typedef base::Callback< |
- void(const GURL& origin, |
- int64 deleted_version_id, |
- const std::vector<int64>& newly_purgeable_resources, |
- ServiceWorkerDatabase::Status status)> WriteRegistrationCallback; |
+ typedef base::Callback<void( |
+ const GURL& origin, |
+ const ServiceWorkerDatabase::RegistrationData& deleted_version_data, |
+ const std::vector<int64>& newly_purgeable_resources, |
+ ServiceWorkerDatabase::Status status)> WriteRegistrationCallback; |
typedef base::Callback< |
void(bool origin_is_deletable, |
int64 version_id, |
@@ -263,11 +269,16 @@ class CONTENT_EXPORT ServiceWorkerStorage |
const GetAllRegistrationInfosCallback& callback, |
RegistrationList* registrations, |
ServiceWorkerDatabase::Status status); |
- void DidStoreRegistration(const StatusCallback& callback, |
- const GURL& origin, |
- int64 deleted_version_id, |
- const std::vector<int64>& newly_purgeable_resources, |
- ServiceWorkerDatabase::Status status); |
+ void DidGetRegistrationsForUsage(const OriginUsageCallback& callback, |
+ RegistrationList* registrations, |
+ ServiceWorkerDatabase::Status status); |
+ void DidStoreRegistration( |
+ const StatusCallback& callback, |
+ const ServiceWorkerDatabase::RegistrationData& new_version, |
+ const GURL& origin, |
+ const ServiceWorkerDatabase::RegistrationData& deleted_version, |
+ const std::vector<int64>& newly_purgeable_resources, |
+ ServiceWorkerDatabase::Status status); |
void DidUpdateToActiveState( |
const StatusCallback& callback, |
ServiceWorkerDatabase::Status status); |