| 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/pref_store.h" | 11 #include "base/prefs/pref_store.h" |
| 11 | 12 |
| 12 // This interface is complementary to the PrefStore interface, declaring | 13 // This interface is complementary to the PrefStore interface, declaring |
| 13 // additional functionality that adds support for setting values and persisting | 14 // additional functionality that adds support for setting values and persisting |
| 14 // the data to some backing store. | 15 // the data to some backing store. |
| 15 class PersistentPrefStore : public PrefStore { | 16 class BASE_PREFS_EXPORT PersistentPrefStore : public PrefStore { |
| 16 public: | 17 public: |
| 17 // Unique integer code for each type of error so we can report them | 18 // Unique integer code for each type of error so we can report them |
| 18 // distinctly in a histogram. | 19 // distinctly in a histogram. |
| 19 // NOTE: Don't change the order here as it will change the server's meaning | 20 // NOTE: Don't change the order here as it will change the server's meaning |
| 20 // of the histogram. | 21 // of the histogram. |
| 21 enum PrefReadError { | 22 enum PrefReadError { |
| 22 PREF_READ_ERROR_NONE = 0, | 23 PREF_READ_ERROR_NONE = 0, |
| 23 PREF_READ_ERROR_JSON_PARSE, | 24 PREF_READ_ERROR_JSON_PARSE, |
| 24 PREF_READ_ERROR_JSON_TYPE, | 25 PREF_READ_ERROR_JSON_TYPE, |
| 25 PREF_READ_ERROR_ACCESS_DENIED, | 26 PREF_READ_ERROR_ACCESS_DENIED, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) = 0; | 86 virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) = 0; |
| 86 | 87 |
| 87 // Lands any pending writes to disk. | 88 // Lands any pending writes to disk. |
| 88 virtual void CommitPendingWrite() = 0; | 89 virtual void CommitPendingWrite() = 0; |
| 89 | 90 |
| 90 protected: | 91 protected: |
| 91 virtual ~PersistentPrefStore() {} | 92 virtual ~PersistentPrefStore() {} |
| 92 }; | 93 }; |
| 93 | 94 |
| 94 #endif // BASE_PREFS_PERSISTENT_PREF_STORE_H_ | 95 #endif // BASE_PREFS_PERSISTENT_PREF_STORE_H_ |
| OLD | NEW |