OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 BASE_PREFS_PERSISTENT_PREF_STORE_H_ | 5 #ifndef BASE_PREFS_PERSISTENT_PREF_STORE_H_ |
6 #define BASE_PREFS_PERSISTENT_PREF_STORE_H_ | 6 #define BASE_PREFS_PERSISTENT_PREF_STORE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/prefs/base_prefs_export.h" | 10 #include "base/prefs/base_prefs_export.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 PREF_READ_ERROR_ACCESS_DENIED = 3, | 26 PREF_READ_ERROR_ACCESS_DENIED = 3, |
27 PREF_READ_ERROR_FILE_OTHER = 4, | 27 PREF_READ_ERROR_FILE_OTHER = 4, |
28 PREF_READ_ERROR_FILE_LOCKED = 5, | 28 PREF_READ_ERROR_FILE_LOCKED = 5, |
29 PREF_READ_ERROR_NO_FILE = 6, | 29 PREF_READ_ERROR_NO_FILE = 6, |
30 PREF_READ_ERROR_JSON_REPEAT = 7, | 30 PREF_READ_ERROR_JSON_REPEAT = 7, |
31 // PREF_READ_ERROR_OTHER = 8, // Deprecated. | 31 // PREF_READ_ERROR_OTHER = 8, // Deprecated. |
32 PREF_READ_ERROR_FILE_NOT_SPECIFIED = 9, | 32 PREF_READ_ERROR_FILE_NOT_SPECIFIED = 9, |
33 // Indicates that ReadPrefs() couldn't complete synchronously and is waiting | 33 // Indicates that ReadPrefs() couldn't complete synchronously and is waiting |
34 // for an asynchronous task to complete first. | 34 // for an asynchronous task to complete first. |
35 PREF_READ_ERROR_ASYNCHRONOUS_TASK_INCOMPLETE = 10, | 35 PREF_READ_ERROR_ASYNCHRONOUS_TASK_INCOMPLETE = 10, |
36 PREF_READ_ERROR_LEVELDB_IO = 11, | |
37 PREF_READ_ERROR_LEVELDB_CORRUPTION_READ_ONLY = 12, | |
38 PREF_READ_ERROR_LEVELDB_CORRUPTION = 13, | |
39 PREF_READ_ERROR_MAX_ENUM | 36 PREF_READ_ERROR_MAX_ENUM |
40 }; | 37 }; |
41 | 38 |
42 class ReadErrorDelegate { | 39 class ReadErrorDelegate { |
43 public: | 40 public: |
44 virtual ~ReadErrorDelegate() {} | 41 virtual ~ReadErrorDelegate() {} |
45 | 42 |
46 virtual void OnError(PrefReadError error) = 0; | 43 virtual void OnError(PrefReadError error) = 0; |
47 }; | 44 }; |
48 | 45 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) = 0; | 78 virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) = 0; |
82 | 79 |
83 // Lands any pending writes to disk. | 80 // Lands any pending writes to disk. |
84 virtual void CommitPendingWrite() = 0; | 81 virtual void CommitPendingWrite() = 0; |
85 | 82 |
86 protected: | 83 protected: |
87 virtual ~PersistentPrefStore() {} | 84 virtual ~PersistentPrefStore() {} |
88 }; | 85 }; |
89 | 86 |
90 #endif // BASE_PREFS_PERSISTENT_PREF_STORE_H_ | 87 #endif // BASE_PREFS_PERSISTENT_PREF_STORE_H_ |
OLD | NEW |