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

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: remake 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..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);

Powered by Google App Engine
This is Rietveld 408576698