| 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 7c82915cba2e75885bb7fd072d00e41db14b13eb..23f1af7b843459e692ee7943785fd226bfaef492 100644
|
| --- a/content/browser/service_worker/service_worker_storage.h
|
| +++ b/content/browser/service_worker/service_worker_storage.h
|
| @@ -177,6 +177,10 @@ class CONTENT_EXPORT ServiceWorkerStorage
|
| const std::string& key,
|
| const GetUserDataForAllRegistrationsCallback& callback);
|
|
|
| + // Returns true if any service workers at |origin| have registered for foreign
|
| + // fetch.
|
| + bool OriginHasForeignFetchRegistrations(const GURL& origin);
|
| +
|
| // Deletes the storage and starts over.
|
| void DeleteAndStartOver(const StatusCallback& callback);
|
|
|
| @@ -249,6 +253,7 @@ class CONTENT_EXPORT ServiceWorkerStorage
|
| std::set<GURL> origins;
|
| bool disk_cache_migration_needed;
|
| bool old_disk_cache_deletion_needed;
|
| + std::set<GURL> foreign_fetch_origins;
|
|
|
| InitialData();
|
| ~InitialData();
|
| @@ -264,6 +269,16 @@ class CONTENT_EXPORT ServiceWorkerStorage
|
| ~DidDeleteRegistrationParams();
|
| };
|
|
|
| + enum class OriginState {
|
| + // Other registrations with foreign fetch scopes exist for the origin.
|
| + KEEP_ALL,
|
| + // Other registrations exist at this origin, but none of them have foreign
|
| + // fetch scopes.
|
| + DELETE_FROM_FOREIGN_FETCH,
|
| + // No other registrations exist at this origin.
|
| + DELETE_FROM_ALL
|
| + };
|
| +
|
| typedef std::vector<ServiceWorkerDatabase::RegistrationData> RegistrationList;
|
| typedef std::map<int64, scoped_refptr<ServiceWorkerRegistration> >
|
| RegistrationRefsById;
|
| @@ -278,7 +293,7 @@ class CONTENT_EXPORT ServiceWorkerStorage
|
| const std::vector<int64>& newly_purgeable_resources,
|
| ServiceWorkerDatabase::Status status)> WriteRegistrationCallback;
|
| typedef base::Callback<void(
|
| - bool origin_is_deletable,
|
| + OriginState origin_state,
|
| const ServiceWorkerDatabase::RegistrationData& deleted_version_data,
|
| const std::vector<int64>& newly_purgeable_resources,
|
| ServiceWorkerDatabase::Status status)> DeleteRegistrationCallback;
|
| @@ -357,7 +372,7 @@ class CONTENT_EXPORT ServiceWorkerStorage
|
| ServiceWorkerDatabase::Status status);
|
| void DidDeleteRegistration(
|
| const DidDeleteRegistrationParams& params,
|
| - bool origin_is_deletable,
|
| + OriginState origin_state,
|
| const ServiceWorkerDatabase::RegistrationData& deleted_version,
|
| const std::vector<int64>& newly_purgeable_resources,
|
| ServiceWorkerDatabase::Status status);
|
| @@ -494,6 +509,7 @@ class CONTENT_EXPORT ServiceWorkerStorage
|
|
|
| // Origins having registations.
|
| std::set<GURL> registered_origins_;
|
| + std::set<GURL> foreign_fetch_origins_;
|
|
|
| // Pending database tasks waiting for initialization.
|
| std::vector<base::Closure> pending_tasks_;
|
|
|