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

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

Issue 355163003: Don't prematurely delete script resources when registration is deleted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: redesign Created 6 years, 5 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
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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 const GURL& origin); 130 const GURL& origin);
131 131
132 // Updates last check time of a registration for |registration_id| by |time|. 132 // Updates last check time of a registration for |registration_id| by |time|.
133 // Returns OK if it's successfully updated. Otherwise, returns an error. 133 // Returns OK if it's successfully updated. Otherwise, returns an error.
134 Status UpdateLastCheckTime( 134 Status UpdateLastCheckTime(
135 int64 registration_id, 135 int64 registration_id,
136 const GURL& origin, 136 const GURL& origin,
137 const base::Time& time); 137 const base::Time& time);
138 138
139 // Deletes a registration for |registration_id| and moves resource records 139 // Deletes a registration for |registration_id| and moves resource records
140 // associated with it into the purgeable list. Returns OK if it's successfully 140 // associated with it into the purgeable list. Sets |version_id| to the
141 // deleted or not found in the database. Otherwise, returns an error. 141 // id of the version that was stored and |newly_purgeable_resources| to its
142 Status DeleteRegistration( 142 // resources. Returns OK if it's successfully deleted or not found in the
143 int64 registration_id, 143 // database. Otherwise, returns an error.
144 const GURL& origin, 144 Status DeleteRegistration(int64 registration_id,
145 std::vector<int64>* newly_purgeable_resources); 145 const GURL& origin,
146 int64* version_id,
147 std::vector<int64>* newly_purgeable_resources);
146 148
147 // As new resources are put into the diskcache, they go into an uncommitted 149 // As new resources are put into the diskcache, they go into an uncommitted
148 // list. When a registration is saved that refers to those ids, they're 150 // list. When a registration is saved that refers to those ids, they're
149 // removed from that list. When a resource no longer has any registrations or 151 // removed from that list. When a resource no longer has any registrations or
150 // caches referring to it, it's added to the purgeable list. Periodically, 152 // caches referring to it, it's added to the purgeable list. Periodically,
151 // the purgeable list can be purged from the diskcache. At system startup, all 153 // the purgeable list can be purged from the diskcache. At system startup, all
152 // uncommitted ids are moved to the purgeable list. 154 // uncommitted ids are moved to the purgeable list.
153 155
154 // Reads uncommitted resource ids from the database. Returns OK on success. 156 // Reads uncommitted resource ids from the database. Returns OK on success.
155 // Otherwise clears |ids| and returns an error. 157 // Otherwise clears |ids| and returns an error.
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DatabaseVersion); 317 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DatabaseVersion);
316 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, GetNextAvailableIds); 318 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, GetNextAvailableIds);
317 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DestroyDatabase); 319 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DestroyDatabase);
318 320
319 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase); 321 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase);
320 }; 322 };
321 323
322 } // namespace content 324 } // namespace content
323 325
324 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ 326 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698