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

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: 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
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. Returns OK if it's successfully
141 // deleted or not found in the database. Otherwise, returns an error. 141 // deleted or not found in the database. Otherwise, returns an error.
142 Status DeleteRegistration( 142 Status DeleteRegistration(int64 registration_id, const GURL& origin);
michaeln 2014/06/28 02:29:31 The database class should not need to change. It d
143 int64 registration_id, 143
144 const GURL& origin, 144 Status DeleteVersionResources(int64 version_id,
michaeln 2014/06/28 02:29:31 The seperate DeleteVersionResources method should
145 std::vector<int64>* newly_purgeable_resources); 145 std::vector<int64>* newly_purgeable_resources);
146 146
147 // As new resources are put into the diskcache, they go into an uncommitted 147 // 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 148 // 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 149 // 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, 150 // 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 151 // the purgeable list can be purged from the diskcache. At system startup, all
152 // uncommitted ids are moved to the purgeable list. 152 // uncommitted ids are moved to the purgeable list.
153 153
154 // Reads uncommitted resource ids from the database. Returns OK on success. 154 // Reads uncommitted resource ids from the database. Returns OK on success.
155 // Otherwise clears |ids| and returns an error. 155 // 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); 315 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DatabaseVersion);
316 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, GetNextAvailableIds); 316 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, GetNextAvailableIds);
317 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DestroyDatabase); 317 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DestroyDatabase);
318 318
319 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase); 319 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase);
320 }; 320 };
321 321
322 } // namespace content 322 } // namespace content
323 323
324 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ 324 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698