Chromium Code Reviews| 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 <vector> | 10 #include <vector> |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 // Should NOT be used on the IO thread since this does blocking | 32 // Should NOT be used on the IO thread since this does blocking |
| 33 // file io. The ServiceWorkerStorage class owns this class and | 33 // file io. The ServiceWorkerStorage class owns this class and |
| 34 // is responsible for only calling it serially on background | 34 // is responsible for only calling it serially on background |
| 35 // non-IO threads (ala SequencedWorkerPool). | 35 // non-IO threads (ala SequencedWorkerPool). |
| 36 class CONTENT_EXPORT ServiceWorkerDatabase { | 36 class CONTENT_EXPORT ServiceWorkerDatabase { |
| 37 public: | 37 public: |
| 38 // We do leveldb stuff in |path| or in memory if |path| is empty. | 38 // We do leveldb stuff in |path| or in memory if |path| is empty. |
| 39 explicit ServiceWorkerDatabase(const base::FilePath& path); | 39 explicit ServiceWorkerDatabase(const base::FilePath& path); |
| 40 ~ServiceWorkerDatabase(); | 40 ~ServiceWorkerDatabase(); |
| 41 | 41 |
| 42 enum Status { | 42 enum Status { |
|
michaeln
2014/05/29 23:46:28
please comment about these being used in uma so fu
nhiroki
2014/06/02 04:54:47
Done.
| |
| 43 STATUS_OK, | 43 STATUS_OK, |
| 44 STATUS_ERROR_NOT_FOUND, | 44 STATUS_ERROR_NOT_FOUND, |
| 45 STATUS_ERROR_IO_ERROR, | |
| 45 STATUS_ERROR_CORRUPTED, | 46 STATUS_ERROR_CORRUPTED, |
| 46 STATUS_ERROR_FAILED, | 47 STATUS_ERROR_FAILED, |
| 48 STATUS_ERROR_MAX, | |
| 47 }; | 49 }; |
| 48 | 50 |
| 49 struct CONTENT_EXPORT RegistrationData { | 51 struct CONTENT_EXPORT RegistrationData { |
| 50 // These values are immutable for the life of a registration. | 52 // These values are immutable for the life of a registration. |
| 51 int64 registration_id; | 53 int64 registration_id; |
| 52 GURL scope; | 54 GURL scope; |
| 53 GURL script; | 55 GURL script; |
| 54 | 56 |
| 55 // Versions are first stored once they successfully install and become | 57 // Versions are first stored once they successfully install and become |
| 56 // the waiting version. Then transition to the active version. The stored | 58 // the waiting version. Then transition to the active version. The stored |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 298 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, OpenDatabase_InMemory); | 300 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, OpenDatabase_InMemory); |
| 299 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DatabaseVersion); | 301 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DatabaseVersion); |
| 300 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, GetNextAvailableIds); | 302 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, GetNextAvailableIds); |
| 301 | 303 |
| 302 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase); | 304 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase); |
| 303 }; | 305 }; |
| 304 | 306 |
| 305 } // namespace content | 307 } // namespace content |
| 306 | 308 |
| 307 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ | 309 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ |
| OLD | NEW |