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

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

Issue 1404163003: ServiceWorker: Remove unnecessary accessors for uncommitted/purgeable resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_database.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6b7dea0d3b83aa9b5ab2e1433850c72296471539 100644
--- a/content/browser/service_worker/service_worker_database.h
+++ b/content/browser/service_worker/service_worker_database.h
@@ -200,39 +200,34 @@ class CONTENT_EXPORT ServiceWorkerDatabase {
const std::string& user_data_name,
std::vector<std::pair<int64, std::string>>* user_data);
- // As new resources are put into the diskcache, they go into an uncommitted
- // list. When a registration is saved that refers to those ids, they're
- // removed from that list. When a resource no longer has any registrations or
+ // Resources should belong to one of following resource lists: uncommitted,
+ // committed and purgeable.
+ // As new resources are put into the diskcache, they go into the uncommitted
+ // list. When a registration is saved that refers to those ids, they're moved
+ // to the committed list. When a resource no longer has any registrations or
// caches referring to it, it's added to the purgeable list. Periodically,
// the purgeable list can be purged from the diskcache. At system startup, all
// uncommitted ids are moved to the purgeable list.
- // Reads uncommitted resource ids from the database. Returns OK on success.
+ // Reads resource ids from the uncommitted list. Returns OK on success.
// Otherwise clears |ids| and returns an error.
Status GetUncommittedResourceIds(std::set<int64>* ids);
- // Writes |ids| into the database as uncommitted resources. Returns OK on
- // success. Otherwise writes nothing and returns an error.
+ // Writes resource ids into the uncommitted list. Returns OK on success.
+ // Otherwise writes nothing and returns an error.
Status WriteUncommittedResourceIds(const std::set<int64>& ids);
- // Deletes uncommitted resource ids specified by |ids| from the database.
- // Returns OK on success. Otherwise deletes nothing and returns an error.
- Status ClearUncommittedResourceIds(const std::set<int64>& ids);
-
- // Reads purgeable resource ids from the database. Returns OK on success.
+ // Reads resource ids from the purgeable list. Returns OK on success.
// Otherwise clears |ids| and returns an error.
Status GetPurgeableResourceIds(std::set<int64>* ids);
- // Writes |ids| into the database as purgeable resources. Returns OK on
- // success. Otherwise writes nothing and returns an error.
- Status WritePurgeableResourceIds(const std::set<int64>& ids);
-
- // Deletes purgeable resource ids specified by |ids| from the database.
- // Returns OK on success. Otherwise deletes nothing and returns an error.
+ // Deletes resource ids from the purgeable list. Returns OK on success.
+ // Otherwise deletes nothing and returns an error.
Status ClearPurgeableResourceIds(const std::set<int64>& ids);
- // Moves |ids| from the uncommitted list to the purgeable list.
- // Returns OK on success. Otherwise deletes nothing and returns an error.
+ // Writes resource ids into the purgeable list and removes them from the
+ // uncommitted list. Returns OK on success. Otherwise writes nothing and
+ // returns an error.
Status PurgeUncommittedResourceIds(const std::set<int64>& ids);
// Deletes all data for |origins|, namely, unique origin, registrations and
@@ -300,9 +295,6 @@ class CONTENT_EXPORT ServiceWorkerDatabase {
// Write resource ids for |id_key_prefix| into the database. Returns OK on
// success. Otherwise, returns writes nothing and returns an error.
- Status WriteResourceIds(
- const char* id_key_prefix,
- const std::set<int64>& ids);
Status WriteResourceIdsInBatch(
const char* id_key_prefix,
const std::set<int64>& ids,
@@ -311,9 +303,6 @@ class CONTENT_EXPORT ServiceWorkerDatabase {
// Deletes resource ids for |id_key_prefix| from the database. Returns OK if
// it's successfully deleted or not found in the database. Otherwise, returns
// an error.
- Status DeleteResourceIds(
- const char* id_key_prefix,
- const std::set<int64>& ids);
Status DeleteResourceIdsInBatch(
const char* id_key_prefix,
const std::set<int64>& ids,
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698