Index: content/browser/service_worker/service_worker_database.h |
diff --git a/content/browser/service_worker/service_worker_database.h b/content/browser/service_worker/service_worker_database.h |
index a43521239015e3c4e90700a83440c843d8167e16..0fc6d6172904a83a09c4e8050311a4e3a9d4398c 100644 |
--- a/content/browser/service_worker/service_worker_database.h |
+++ b/content/browser/service_worker/service_worker_database.h |
@@ -92,6 +92,29 @@ class CONTENT_EXPORT ServiceWorkerDatabase { |
int64* next_avail_version_id, |
int64* next_avail_resource_id); |
+ enum DiskCacheMigrationState { |
+ // A diskcache has not been used yet. |
+ DISKCACHE_NOT_USED, |
+ |
+ // A diskcache needs to be migrated. |
+ DISKCACHE_NEEDS_TO_MIGRATE, |
+ |
+ // A diskcache was migrated but an old diskcache still exists. |
+ DISKCACHE_NEEDS_TO_DELETE_OLD, |
+ |
+ // A diskcache was migrated and an old diskcache was deleted. |
+ DISKCACHE_MIGRATED, |
michaeln
2015/06/12 01:55:45
Can MIGRATED and NOT_USED be merged into MIGRATION
|
+ |
+ DISKCACHE_UNKNOWN_STATE, |
+ }; |
+ |
+ // Reads a diskcache migration state from the database. |
+ Status ReadDiskCacheMigrationState(DiskCacheMigrationState* state); |
+ |
+ // Writes a diskcache migration state in the database. |state| should be |
+ // DISKCACHE_MIGRATED or DISKCACHE_NEEDS_TO_DELETE_OLD. |
+ Status WriteDiskCacheMigrationState(DiskCacheMigrationState state); |
+ |
// Reads origins that have one or more than one registration from the |
// database. Returns OK if they are successfully read or not found. |
// Otherwise, returns an error. |
@@ -371,6 +394,7 @@ class CONTENT_EXPORT ServiceWorkerDatabase { |
FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, OpenDatabase); |
FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, OpenDatabase_InMemory); |
FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DatabaseVersion); |
+ FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DiskCacheMigrationState); |
FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, GetNextAvailableIds); |
FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, |
Registration_UninitializedDatabase); |