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..9ce72f1d56e347f4c7cdf48d48fcd7ab4d232b4f 100644 |
--- a/content/browser/service_worker/service_worker_database.h |
+++ b/content/browser/service_worker/service_worker_database.h |
@@ -92,6 +92,16 @@ class CONTENT_EXPORT ServiceWorkerDatabase { |
int64* next_avail_version_id, |
int64* next_avail_resource_id); |
+ // Used for diskcache migration (http://crbug.com/487482). Returns true if the |
+ // storage needs to migrate a disk cache. |
+ Status IsDiskCacheMigrationNeeded(bool* migration_needed); |
+ Status SetDiskCacheMigrationNotNeeded(); |
+ |
+ // Used for diskcache migration (http://crbug.com/487482). Returns true if the |
+ // storage needs to delete an old disk cache. |
+ Status IsOldDiskCacheDeletionNeeded(bool* deletion_needed); |
+ Status SetOldDiskCacheDeletionNotNeeded(); |
+ |
// 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. |
@@ -366,6 +376,11 @@ class CONTENT_EXPORT ServiceWorkerDatabase { |
}; |
State state_; |
+ void set_skip_writing_diskcache_migration_state_on_init_for_testing() { |
+ skip_writing_diskcache_migration_state_on_init_for_testing_ = true; |
+ } |
+ bool skip_writing_diskcache_migration_state_on_init_for_testing_; |
+ |
base::SequenceChecker sequence_checker_; |
FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, OpenDatabase); |
@@ -377,7 +392,12 @@ class CONTENT_EXPORT ServiceWorkerDatabase { |
FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, |
UserData_UninitializedDatabase); |
FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DestroyDatabase); |
+ FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DiskCacheMigrationState); |
FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, UpgradeSchemaToVersion2); |
+ FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDiskCacheMigratorTest, |
+ MigrateOnDiskCacheAccess); |
+ FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDiskCacheMigratorTest, |
+ NotMigrateOnDatabaseAccess); |
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase); |
}; |