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_JSON_PREF_STORE_H_ | 5 #ifndef BASE_PREFS_JSON_PREF_STORE_H_ |
6 #define BASE_PREFS_JSON_PREF_STORE_H_ | 6 #define BASE_PREFS_JSON_PREF_STORE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 class BASE_PREFS_EXPORT JsonPrefStore | 30 class BASE_PREFS_EXPORT JsonPrefStore |
31 : public PersistentPrefStore, | 31 : public PersistentPrefStore, |
32 public base::ImportantFileWriter::DataSerializer { | 32 public base::ImportantFileWriter::DataSerializer { |
33 public: | 33 public: |
34 // |file_message_loop_proxy| is the MessageLoopProxy for a thread on which | 34 // |file_message_loop_proxy| is the MessageLoopProxy for a thread on which |
35 // file I/O can be done. | 35 // file I/O can be done. |
36 JsonPrefStore(const FilePath& pref_filename, | 36 JsonPrefStore(const FilePath& pref_filename, |
37 base::MessageLoopProxy* file_message_loop_proxy); | 37 base::MessageLoopProxy* file_message_loop_proxy); |
38 | 38 |
39 // PrefStore overrides: | 39 // PrefStore overrides: |
40 virtual ReadResult GetValue(const std::string& key, | 40 virtual bool GetValue(const std::string& key, |
41 const base::Value** result) const OVERRIDE; | 41 const base::Value** result) const OVERRIDE; |
42 virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE; | 42 virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE; |
43 virtual void RemoveObserver(PrefStore::Observer* observer) OVERRIDE; | 43 virtual void RemoveObserver(PrefStore::Observer* observer) OVERRIDE; |
44 virtual size_t NumberOfObservers() const OVERRIDE; | 44 virtual size_t NumberOfObservers() const OVERRIDE; |
45 virtual bool IsInitializationComplete() const OVERRIDE; | 45 virtual bool IsInitializationComplete() const OVERRIDE; |
46 | 46 |
47 // PersistentPrefStore overrides: | 47 // PersistentPrefStore overrides: |
48 virtual ReadResult GetMutableValue(const std::string& key, | 48 virtual bool GetMutableValue(const std::string& key, |
49 base::Value** result) OVERRIDE; | 49 base::Value** result) OVERRIDE; |
50 virtual void SetValue(const std::string& key, base::Value* value) OVERRIDE; | 50 virtual void SetValue(const std::string& key, base::Value* value) OVERRIDE; |
51 virtual void SetValueSilently(const std::string& key, | 51 virtual void SetValueSilently(const std::string& key, |
52 base::Value* value) OVERRIDE; | 52 base::Value* value) OVERRIDE; |
53 virtual void RemoveValue(const std::string& key) OVERRIDE; | 53 virtual void RemoveValue(const std::string& key) OVERRIDE; |
54 virtual void MarkNeedsEmptyValue(const std::string& key) OVERRIDE; | 54 virtual void MarkNeedsEmptyValue(const std::string& key) OVERRIDE; |
55 virtual bool ReadOnly() const OVERRIDE; | 55 virtual bool ReadOnly() const OVERRIDE; |
56 virtual PrefReadError GetReadError() const OVERRIDE; | 56 virtual PrefReadError GetReadError() const OVERRIDE; |
57 virtual PrefReadError ReadPrefs() OVERRIDE; | 57 virtual PrefReadError ReadPrefs() OVERRIDE; |
58 virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) OVERRIDE; | 58 virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) OVERRIDE; |
59 virtual void CommitPendingWrite() OVERRIDE; | 59 virtual void CommitPendingWrite() OVERRIDE; |
(...skipping 27 matching lines...) Expand all Loading... |
87 | 87 |
88 bool initialized_; | 88 bool initialized_; |
89 PrefReadError read_error_; | 89 PrefReadError read_error_; |
90 | 90 |
91 std::set<std::string> keys_need_empty_value_; | 91 std::set<std::string> keys_need_empty_value_; |
92 | 92 |
93 DISALLOW_COPY_AND_ASSIGN(JsonPrefStore); | 93 DISALLOW_COPY_AND_ASSIGN(JsonPrefStore); |
94 }; | 94 }; |
95 | 95 |
96 #endif // BASE_PREFS_JSON_PREF_STORE_H_ | 96 #endif // BASE_PREFS_JSON_PREF_STORE_H_ |
OLD | NEW |