Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(498)

Side by Side Diff: content/browser/notifications/notification_database.h

Issue 1006493005: Introduce the PlatformNotificationContext class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-db-ReadWriteDelete
Patch Set: y Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/notifications/notification_database.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // The database is built on top of a LevelDB database, either in memory or on
30 // made on a thread or sequenced task runner that allows file I/O. The same 29 // the filesystem depending on the path passed to the constructor. When writing
31 // thread or task runner must be used for all method calls. 30 // a new notification, it will be assigned an id guaranteed to be unique for the
31 // lifetime of the database.
32 //
33 // This class must only be used on a thread or sequenced task runner that allows
34 // file I/O. The same thread or task runner must be used for all method calls.
32 class CONTENT_EXPORT NotificationDatabase { 35 class CONTENT_EXPORT NotificationDatabase {
33 public: 36 public:
34 // Result status codes for interations with the database. Will be used for 37 // Result status codes for interations with the database. Will be used for
35 // UMA, so the assigned ids must remain stable. 38 // UMA, so the assigned ids must remain stable.
36 enum Status { 39 enum Status {
37 STATUS_OK = 0, 40 STATUS_OK = 0,
38 41
39 // The database, a notification, or a LevelDB key associated with the 42 // The database, a notification, or a LevelDB key associated with the
40 // operation could not be found. 43 // operation could not be found.
41 STATUS_ERROR_NOT_FOUND = 1, 44 STATUS_ERROR_NOT_FOUND = 1,
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 State state_ = STATE_UNINITIALIZED; 122 State state_ = STATE_UNINITIALIZED;
120 123
121 base::SequenceChecker sequence_checker_; 124 base::SequenceChecker sequence_checker_;
122 125
123 DISALLOW_COPY_AND_ASSIGN(NotificationDatabase); 126 DISALLOW_COPY_AND_ASSIGN(NotificationDatabase);
124 }; 127 };
125 128
126 } // namespace content 129 } // namespace content
127 130
128 #endif // CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_H_ 131 #endif // CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/notifications/notification_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698