| 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 <map> | 10 #include <map> |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
| 19 #include "base/sequence_checker.h" | 19 #include "base/sequence_checker.h" |
| 20 #include "base/time/time.h" | 20 #include "base/time/time.h" |
| 21 #include "content/common/content_export.h" | 21 #include "content/common/content_export.h" |
| 22 #include "content/common/service_worker/service_worker_status_code.h" | 22 #include "content/common/service_worker/service_worker_status_code.h" |
| 23 #include "url/gurl.h" | 23 #include "url/gurl.h" |
| 24 #include "url/origin.h" |
| 24 | 25 |
| 25 namespace leveldb { | 26 namespace leveldb { |
| 26 class DB; | 27 class DB; |
| 27 class Env; | 28 class Env; |
| 28 class Status; | 29 class Status; |
| 29 class WriteBatch; | 30 class WriteBatch; |
| 30 } | 31 } |
| 31 | 32 |
| 32 namespace content { | 33 namespace content { |
| 33 | 34 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 61 | 62 |
| 62 // Versions are first stored once they successfully install and become | 63 // Versions are first stored once they successfully install and become |
| 63 // the waiting version. Then transition to the active version. The stored | 64 // the waiting version. Then transition to the active version. The stored |
| 64 // version may be in the ACTIVATED state or in the INSTALLED state. | 65 // version may be in the ACTIVATED state or in the INSTALLED state. |
| 65 GURL script; | 66 GURL script; |
| 66 int64_t version_id; | 67 int64_t version_id; |
| 67 bool is_active; | 68 bool is_active; |
| 68 bool has_fetch_handler; | 69 bool has_fetch_handler; |
| 69 base::Time last_update_check; | 70 base::Time last_update_check; |
| 70 std::vector<GURL> foreign_fetch_scopes; | 71 std::vector<GURL> foreign_fetch_scopes; |
| 72 std::vector<url::Origin> foreign_fetch_origins; |
| 71 | 73 |
| 72 // Not populated until ServiceWorkerStorage::StoreRegistration is called. | 74 // Not populated until ServiceWorkerStorage::StoreRegistration is called. |
| 73 int64_t resources_total_size_bytes; | 75 int64_t resources_total_size_bytes; |
| 74 | 76 |
| 75 RegistrationData(); | 77 RegistrationData(); |
| 76 ~RegistrationData(); | 78 ~RegistrationData(); |
| 77 }; | 79 }; |
| 78 | 80 |
| 79 struct ResourceRecord { | 81 struct ResourceRecord { |
| 80 int64_t resource_id; | 82 int64_t resource_id; |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, | 378 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, |
| 377 UserData_UninitializedDatabase); | 379 UserData_UninitializedDatabase); |
| 378 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DestroyDatabase); | 380 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DestroyDatabase); |
| 379 | 381 |
| 380 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase); | 382 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase); |
| 381 }; | 383 }; |
| 382 | 384 |
| 383 } // namespace content | 385 } // namespace content |
| 384 | 386 |
| 385 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ | 387 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ |
| OLD | NEW |