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

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

Issue 1152543002: ServiceWorker: Migrate the script cache backend from BlockFile to Simple (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: support the case that the old diskcache exists but the database does not Created 5 years, 6 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_database.h
diff --git a/content/browser/service_worker/service_worker_database.h b/content/browser/service_worker/service_worker_database.h
index a43521239015e3c4e90700a83440c843d8167e16..b9b7863e62bce56effc784522c2dc119616bd92b 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,13 @@ class CONTENT_EXPORT ServiceWorkerDatabase {
};
State state_;
+#if defined(UNIT_TEST)
nhiroki 2015/06/17 02:17:55 Hmmm... only win_chromium_compile_dbg_ng fails to
nhiroki 2015/06/17 05:41:06 This setter needs to be inlined, but the dbg-bot d
+ void set_skip_writing_diskcache_migration_state_on_init_for_testing() {
+ skip_writing_diskcache_migration_state_on_init_for_testing_ = true;
+ }
+#endif
+ bool skip_writing_diskcache_migration_state_on_init_for_testing_;
+
base::SequenceChecker sequence_checker_;
FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, OpenDatabase);
@@ -377,7 +394,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);
};
« no previous file with comments | « content/browser/appcache/appcache_disk_cache.cc ('k') | content/browser/service_worker/service_worker_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698