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

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

Issue 1146913004: Service Worker: Add ServiceWorkerContainer.getRegistrations() method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make GetRegistrationsForOrigin() handle nullptr for resource param. 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 unified diff | Download patch
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 <string> 10 #include <string>
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 // Reads origins that have one or more than one registration from the 95 // Reads origins that have one or more than one registration from the
96 // database. Returns OK if they are successfully read or not found. 96 // database. Returns OK if they are successfully read or not found.
97 // Otherwise, returns an error. 97 // Otherwise, returns an error.
98 Status GetOriginsWithRegistrations(std::set<GURL>* origins); 98 Status GetOriginsWithRegistrations(std::set<GURL>* origins);
99 99
100 // Reads registrations for |origin| from the database. Returns OK if they are 100 // Reads registrations for |origin| from the database. Returns OK if they are
101 // successfully read or not found. Otherwise, returns an error. 101 // successfully read or not found. Otherwise, returns an error.
102 Status GetRegistrationsForOrigin( 102 Status GetRegistrationsForOrigin(
103 const GURL& origin, 103 const GURL& origin,
104 std::vector<RegistrationData>* registrations); 104 std::vector<RegistrationData>* registrations,
105 std::vector<std::vector<ResourceRecord>>* resource_lists);
michaeln 2015/06/05 21:50:41 since this param may be null, please name it |opt_
jungkees 2015/06/06 13:55:11 Renamed it |opt_resources_list|. Note that I found
105 106
106 // Reads all registrations from the database. Returns OK if successfully read 107 // Reads all registrations from the database. Returns OK if successfully read
107 // or not found. Otherwise, returns an error. 108 // or not found. Otherwise, returns an error.
108 Status GetAllRegistrations(std::vector<RegistrationData>* registrations); 109 Status GetAllRegistrations(std::vector<RegistrationData>* registrations);
109 110
110 // Saving, retrieving, and updating registration data. 111 // Saving, retrieving, and updating registration data.
111 // (will bump next_avail_xxxx_ids as needed) 112 // (will bump next_avail_xxxx_ids as needed)
112 // (resource ids will be added/removed from the uncommitted/purgeable 113 // (resource ids will be added/removed from the uncommitted/purgeable
113 // lists as needed) 114 // lists as needed)
114 115
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 UserData_UninitializedDatabase); 378 UserData_UninitializedDatabase);
378 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DestroyDatabase); 379 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DestroyDatabase);
379 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, UpgradeSchemaToVersion2); 380 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, UpgradeSchemaToVersion2);
380 381
381 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase); 382 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase);
382 }; 383 };
383 384
384 } // namespace content 385 } // namespace content
385 386
386 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ 387 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698