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

Side by Side Diff: content/browser/service_worker/service_worker_database.h

Issue 264713011: ServiceWorker: Implement DeleteAllDataForOrigin() in ServiceWorkerDatabase (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Drop DeleteAllData() and add test Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_database.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 bool GetPurgeableResourceIds(std::set<int64>* ids); 121 bool GetPurgeableResourceIds(std::set<int64>* ids);
122 122
123 // Writes |ids| into the database as purgeable resources. Returns true on 123 // Writes |ids| into the database as purgeable resources. Returns true on
124 // success. Otherwise writes nothing and returns false. 124 // success. Otherwise writes nothing and returns false.
125 bool WritePurgeableResourceIds(const std::set<int64>& ids); 125 bool WritePurgeableResourceIds(const std::set<int64>& ids);
126 126
127 // Deletes purgeable resource ids specified by |ids| from the database. 127 // Deletes purgeable resource ids specified by |ids| from the database.
128 // Returns true on success. Otherwise deletes nothing and returns false. 128 // Returns true on success. Otherwise deletes nothing and returns false.
129 bool ClearPurgeableResourceIds(const std::set<int64>& ids); 129 bool ClearPurgeableResourceIds(const std::set<int64>& ids);
130 130
131 // Delete all data for |origin|, namely, unique origin, registrations and
132 // resource records. Resources are moved to the purgeable list.
133 bool DeleteAllDataForOrigin(const GURL& origin);
134
131 bool is_disabled() const { return is_disabled_; } 135 bool is_disabled() const { return is_disabled_; }
132 bool was_corruption_detected() const { return was_corruption_detected_; } 136 bool was_corruption_detected() const { return was_corruption_detected_; }
133 137
134 private: 138 private:
135 // Opens the database at the |path_|. This is lazily called when the first 139 // Opens the database at the |path_|. This is lazily called when the first
136 // database API is called. Returns true if the database was opened. Returns 140 // database API is called. Returns true if the database was opened. Returns
137 // false if the opening failed or was not neccessary, that is, the database 141 // false if the opening failed or was not neccessary, that is, the database
138 // does not exist and |create_if_needed| is false. 142 // does not exist and |create_if_needed| is false.
139 bool LazyOpen(bool create_if_needed); 143 bool LazyOpen(bool create_if_needed);
140 144
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, Registration_Basic); 207 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, Registration_Basic);
204 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, Registration_Overwrite); 208 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, Registration_Overwrite);
205 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, Registration_Multiple); 209 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, Registration_Multiple);
206 210
207 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase); 211 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase);
208 }; 212 };
209 213
210 } // namespace content 214 } // namespace content
211 215
212 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ 216 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_
OLDNEW
« 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