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 <memory> | 10 #include <memory> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 | 54 |
| 55 // General failure code. More specific failures should be used if available. | 55 // General failure code. More specific failures should be used if available. |
| 56 STATUS_ERROR_FAILED = 3, | 56 STATUS_ERROR_FAILED = 3, |
| 57 | 57 |
| 58 // leveldb failed due to I/O error (read-only, full disk, etc.). | 58 // leveldb failed due to I/O error (read-only, full disk, etc.). |
| 59 STATUS_IO_ERROR = 4, | 59 STATUS_IO_ERROR = 4, |
| 60 | 60 |
| 61 // leveldb operation not supported | 61 // leveldb operation not supported |
| 62 STATUS_NOT_SUPPORTED = 5, | 62 STATUS_NOT_SUPPORTED = 5, |
| 63 | 63 |
| 64 // Invalid database ID or snapshot ID provided. | |
| 65 STATUS_INVALID_ARGUMENT = 6, | |
|
Peter Beverloo
2016/06/21 11:00:33
Please update the NotificationDatabaseStatus enume
| |
| 66 | |
| 64 // Number of entries in the status enumeration. Used by UMA. Must always be | 67 // Number of entries in the status enumeration. Used by UMA. Must always be |
| 65 // one higher than the otherwise highest value in this enumeration. | 68 // one higher than the otherwise highest value in this enumeration. |
| 66 STATUS_COUNT = 6 | 69 STATUS_COUNT = 7 |
| 67 }; | 70 }; |
| 68 | 71 |
| 69 explicit NotificationDatabase(const base::FilePath& path); | 72 explicit NotificationDatabase(const base::FilePath& path); |
| 70 ~NotificationDatabase(); | 73 ~NotificationDatabase(); |
| 71 | 74 |
| 72 // Opens the database. If |path| is non-empty, it will be created on the given | 75 // Opens the database. If |path| is non-empty, it will be created on the given |
| 73 // directory on the filesystem. If |path| is empty, the database will be | 76 // directory on the filesystem. If |path| is empty, the database will be |
| 74 // created in memory instead, and its lifetime will be tied to this instance. | 77 // created in memory instead, and its lifetime will be tied to this instance. |
| 75 // |create_if_missing| determines whether to create the database if necessary. | 78 // |create_if_missing| determines whether to create the database if necessary. |
| 76 Status Open(bool create_if_missing); | 79 Status Open(bool create_if_missing); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 State state_ = STATE_UNINITIALIZED; | 198 State state_ = STATE_UNINITIALIZED; |
| 196 | 199 |
| 197 base::SequenceChecker sequence_checker_; | 200 base::SequenceChecker sequence_checker_; |
| 198 | 201 |
| 199 DISALLOW_COPY_AND_ASSIGN(NotificationDatabase); | 202 DISALLOW_COPY_AND_ASSIGN(NotificationDatabase); |
| 200 }; | 203 }; |
| 201 | 204 |
| 202 } // namespace content | 205 } // namespace content |
| 203 | 206 |
| 204 #endif // CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_H_ | 207 #endif // CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_H_ |
| OLD | NEW |