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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 RegistrationData* registration); | 264 RegistrationData* registration); |
265 | 265 |
266 // Parses |serialized| as a RegistrationData object and pushes it into |out|. | 266 // Parses |serialized| as a RegistrationData object and pushes it into |out|. |
267 ServiceWorkerDatabase::Status ParseRegistrationData( | 267 ServiceWorkerDatabase::Status ParseRegistrationData( |
268 const std::string& serialized, | 268 const std::string& serialized, |
269 RegistrationData* out); | 269 RegistrationData* out); |
270 | 270 |
271 void WriteRegistrationDataInBatch(const RegistrationData& registration, | 271 void WriteRegistrationDataInBatch(const RegistrationData& registration, |
272 leveldb::WriteBatch* batch); | 272 leveldb::WriteBatch* batch); |
273 | 273 |
274 // Reads resource records for |version_id| from the database. Returns OK if | 274 // Reads resource records for |registration| from the database. Returns OK if |
275 // it's successfully read or not found in the database. Otherwise, returns an | 275 // it's successfully read or not found in the database. Otherwise, returns an |
276 // error. | 276 // error. |
277 Status ReadResourceRecords(int64_t version_id, | 277 Status ReadResourceRecords(const RegistrationData& registration, |
278 std::vector<ResourceRecord>* resources); | 278 std::vector<ResourceRecord>* resources); |
279 | 279 |
280 // Parses |serialized| as a ResourceRecord object and pushes it into |out|. | 280 // Parses |serialized| as a ResourceRecord object and pushes it into |out|. |
281 ServiceWorkerDatabase::Status ParseResourceRecord( | 281 ServiceWorkerDatabase::Status ParseResourceRecord( |
282 const std::string& serialized, | 282 const std::string& serialized, |
283 ResourceRecord* out); | 283 ResourceRecord* out); |
284 | 284 |
285 void WriteResourceRecordInBatch(const ResourceRecord& resource, | 285 void WriteResourceRecordInBatch(const ResourceRecord& resource, |
286 int64_t version_id, | 286 int64_t version_id, |
287 leveldb::WriteBatch* batch); | 287 leveldb::WriteBatch* batch); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, | 380 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, |
381 UserData_UninitializedDatabase); | 381 UserData_UninitializedDatabase); |
382 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DestroyDatabase); | 382 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DestroyDatabase); |
383 | 383 |
384 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase); | 384 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase); |
385 }; | 385 }; |
386 | 386 |
387 } // namespace content | 387 } // namespace content |
388 | 388 |
389 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ | 389 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ |
OLD | NEW |