Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_NOTIFICATIONS_NOTIFICATION_DATABASE_H_ | 5 #ifndef CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_H_ |
| 6 #define CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_H_ | 6 #define CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/callback.h" | |
| 11 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 12 #include "base/sequence_checker.h" | 11 #include "base/sequence_checker.h" |
| 13 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 14 | 13 |
| 15 class GURL; | 14 class GURL; |
| 16 | 15 |
| 17 namespace leveldb { | 16 namespace leveldb { |
| 18 class DB; | 17 class DB; |
| 19 class Env; | 18 class Env; |
| 20 class WriteBatch; | 19 class WriteBatch; |
| 21 } | 20 } |
| 22 | 21 |
| 23 namespace content { | 22 namespace content { |
| 24 | 23 |
| 25 struct NotificationDatabaseData; | 24 struct NotificationDatabaseData; |
| 26 | 25 |
| 27 // Implementation of the persistent notification database. | 26 // Implementation of the persistent notification database. |
| 28 // | 27 // |
| 29 // This class can be constructed on any thread, but method calls must only be | 28 // This class can be constructed on any thread, but method calls must only be |
|
Bernhard Bauer
2015/03/13 21:00:17
You could tighten this restriction now, and not de
Peter Beverloo
2015/03/16 12:06:22
Done! I also added some more information about the
| |
| 30 // made on a thread or sequenced task runner that allows file I/O. The same | 29 // made on a thread or sequenced task runner that allows file I/O. The same |
| 31 // thread or task runner must be used for all method calls. | 30 // thread or task runner must be used for all method calls. |
| 32 class CONTENT_EXPORT NotificationDatabase { | 31 class CONTENT_EXPORT NotificationDatabase { |
| 33 public: | 32 public: |
| 34 // Result status codes for interations with the database. Will be used for | 33 // Result status codes for interations with the database. Will be used for |
| 35 // UMA, so the assigned ids must remain stable. | 34 // UMA, so the assigned ids must remain stable. |
| 36 enum Status { | 35 enum Status { |
| 37 STATUS_OK = 0, | 36 STATUS_OK = 0, |
| 38 | 37 |
| 39 // The database, a notification, or a LevelDB key associated with the | 38 // The database, a notification, or a LevelDB key associated with the |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 State state_; | 116 State state_; |
| 118 | 117 |
| 119 base::SequenceChecker sequence_checker_; | 118 base::SequenceChecker sequence_checker_; |
| 120 | 119 |
| 121 DISALLOW_COPY_AND_ASSIGN(NotificationDatabase); | 120 DISALLOW_COPY_AND_ASSIGN(NotificationDatabase); |
| 122 }; | 121 }; |
| 123 | 122 |
| 124 } // namespace content | 123 } // namespace content |
| 125 | 124 |
| 126 #endif // CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_H_ | 125 #endif // CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_H_ |
| OLD | NEW |