OLD | NEW |
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 Loading... |
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); |
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 Loading... |
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_ |
OLD | NEW |