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

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

Issue 1221643014: Service Worker: Migrate to version_uuid and surface ServiceWorker.id. (Chromium 2/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 8dd0b623eac0fcdb2b411aee2e36aad9b3c36de8..58a809043afca73435e914791d3ec51ba43dd36d 100644
--- a/content/browser/service_worker/service_worker_database.h
+++ b/content/browser/service_worker/service_worker_database.h
@@ -60,7 +60,7 @@ class CONTENT_EXPORT ServiceWorkerDatabase {
// the waiting version. Then transition to the active version. The stored
// version may be in the ACTIVATED state or in the INSTALLED state.
GURL script;
- int64 version_id;
+ std::string version_uuid;
bool is_active;
bool has_fetch_handler;
base::Time last_update_check;
@@ -89,7 +89,6 @@ class CONTENT_EXPORT ServiceWorkerDatabase {
// OK if they are not found in the database. Otherwise, returns an error.
Status GetNextAvailableIds(
int64* next_avail_registration_id,
- int64* next_avail_version_id,
int64* next_avail_resource_id);
// Used for diskcache migration (http://crbug.com/487482). Returns true if the
@@ -142,7 +141,7 @@ class CONTENT_EXPORT ServiceWorkerDatabase {
// - If an old version of the registration exists, deletes it and sets
// |deleted_version| to the old version registration data object
// |newly_purgeable_resources| to its resources. Otherwise, sets
- // |deleted_version->version_id| to -1.
+ // |deleted_version->version_uuid| to -1.
// - Bumps the next registration id and the next version id if needed.
// - Removes |resources| from the uncommitted list if exist.
// Returns OK they are successfully written. Otherwise, returns an error.
@@ -166,8 +165,9 @@ class CONTENT_EXPORT ServiceWorkerDatabase {
// Deletes a registration for |registration_id| and moves resource records
// associated with it into the purgeable list. If deletion occurred, sets
- // |version_id| to the id of the version that was deleted and
- // |newly_purgeable_resources| to its resources; otherwise, sets |version_id|
+ // |version_uuid| to the id of the version that was deleted and
+ // |newly_purgeable_resources| to its resources; otherwise, sets
+ // |version_uuid|
// to -1. Returns OK if it's successfully deleted or not found in the
// database. Otherwise, returns an error.
Status DeleteRegistration(int64 registration_id,
@@ -276,20 +276,19 @@ class CONTENT_EXPORT ServiceWorkerDatabase {
const GURL& origin,
RegistrationData* registration);
- // Reads resource records for |version_id| from the database. Returns OK if
+ // Reads resource records for |version_uuid| from the database. Returns OK if
// it's successfully read or not found in the database. Otherwise, returns an
// error.
- Status ReadResourceRecords(
- int64 version_id,
- std::vector<ResourceRecord>* resources);
+ Status ReadResourceRecords(std::string version_uuid,
+ std::vector<ResourceRecord>* resources);
- // Deletes resource records for |version_id| from the database. Returns OK if
+ // Deletes resource records for |version_uuid| from the database. Returns OK
+ // if
// they are successfully deleted or not found in the database. Otherwise,
// returns an error.
- Status DeleteResourceRecords(
- int64 version_id,
- std::vector<int64>* newly_purgeable_resources,
- leveldb::WriteBatch* batch);
+ Status DeleteResourceRecords(std::string version_uuid,
+ std::vector<int64>* newly_purgeable_resources,
+ leveldb::WriteBatch* batch);
// Reads resource ids for |id_key_prefix| from the database. Returns OK if
// it's successfully read or not found in the database. Otherwise, returns an
@@ -342,9 +341,6 @@ class CONTENT_EXPORT ServiceWorkerDatabase {
void BumpNextResourceIdIfNeeded(
int64 used_id,
leveldb::WriteBatch* batch);
- void BumpNextVersionIdIfNeeded(
- int64 used_id,
- leveldb::WriteBatch* batch);
bool IsOpen();
@@ -367,7 +363,6 @@ class CONTENT_EXPORT ServiceWorkerDatabase {
int64 next_avail_registration_id_;
int64 next_avail_resource_id_;
- int64 next_avail_version_id_;
enum State {
UNINITIALIZED,

Powered by Google App Engine
This is Rietveld 408576698