| 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 COMPONENTS_PREFS_PERSISTENT_PREF_STORE_H_ |
| 6 #define BASE_PREFS_PERSISTENT_PREF_STORE_H_ | 6 #define COMPONENTS_PREFS_PERSISTENT_PREF_STORE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "components/prefs/base_prefs_export.h" | 10 #include "components/prefs/base_prefs_export.h" |
| 11 #include "components/prefs/writeable_pref_store.h" | 11 #include "components/prefs/writeable_pref_store.h" |
| 12 | 12 |
| 13 // This interface is complementary to the PrefStore interface, declaring | 13 // This interface is complementary to the PrefStore interface, declaring |
| 14 // additional functionality that adds support for setting values and persisting | 14 // additional functionality that adds support for setting values and persisting |
| 15 // the data to some backing store. | 15 // the data to some backing store. |
| 16 class BASE_PREFS_EXPORT PersistentPrefStore : public WriteablePrefStore { | 16 class COMPONENTS_PREFS_EXPORT PersistentPrefStore : public WriteablePrefStore { |
| 17 public: | 17 public: |
| 18 // 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 |
| 19 // distinctly in a histogram. | 19 // distinctly in a histogram. |
| 20 // NOTE: Don't change the explicit values of the enums as it will change the | 20 // NOTE: Don't change the explicit values of the enums as it will change the |
| 21 // server's meaning of the histogram. | 21 // server's meaning of the histogram. |
| 22 enum PrefReadError { | 22 enum PrefReadError { |
| 23 PREF_READ_ERROR_NONE = 0, | 23 PREF_READ_ERROR_NONE = 0, |
| 24 PREF_READ_ERROR_JSON_PARSE = 1, | 24 PREF_READ_ERROR_JSON_PARSE = 1, |
| 25 PREF_READ_ERROR_JSON_TYPE = 2, | 25 PREF_READ_ERROR_JSON_TYPE = 2, |
| 26 PREF_READ_ERROR_ACCESS_DENIED = 3, | 26 PREF_READ_ERROR_ACCESS_DENIED = 3, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // Schedule a write if there is any lossy data pending. Unlike | 67 // Schedule a write if there is any lossy data pending. Unlike |
| 68 // CommitPendingWrite() this does not immediately sync to disk, instead it | 68 // CommitPendingWrite() this does not immediately sync to disk, instead it |
| 69 // triggers an eventual write if there is lossy data pending and if there | 69 // triggers an eventual write if there is lossy data pending and if there |
| 70 // isn't one scheduled already. | 70 // isn't one scheduled already. |
| 71 virtual void SchedulePendingLossyWrites() = 0; | 71 virtual void SchedulePendingLossyWrites() = 0; |
| 72 | 72 |
| 73 protected: | 73 protected: |
| 74 ~PersistentPrefStore() override {} | 74 ~PersistentPrefStore() override {} |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 #endif // BASE_PREFS_PERSISTENT_PREF_STORE_H_ | 77 #endif // COMPONENTS_PREFS_PERSISTENT_PREF_STORE_H_ |
| OLD | NEW |