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 26 matching lines...) Expand all Loading... |
37 static scoped_refptr<base::SequencedTaskRunner> GetTaskRunnerForFile( | 37 static scoped_refptr<base::SequencedTaskRunner> GetTaskRunnerForFile( |
38 const FilePath& pref_filename, | 38 const FilePath& pref_filename, |
39 base::SequencedWorkerPool* worker_pool); | 39 base::SequencedWorkerPool* worker_pool); |
40 | 40 |
41 // |sequenced_task_runner| is must be a shutdown-blocking task runner, ideally | 41 // |sequenced_task_runner| is must be a shutdown-blocking task runner, ideally |
42 // created by GetTaskRunnerForFile() method above. | 42 // created by GetTaskRunnerForFile() method above. |
43 JsonPrefStore(const FilePath& pref_filename, | 43 JsonPrefStore(const FilePath& pref_filename, |
44 base::SequencedTaskRunner* sequenced_task_runner); | 44 base::SequencedTaskRunner* sequenced_task_runner); |
45 | 45 |
46 // PrefStore overrides: | 46 // PrefStore overrides: |
47 virtual ReadResult GetValue(const std::string& key, | 47 virtual bool GetValue(const std::string& key, |
48 const base::Value** result) const OVERRIDE; | 48 const base::Value** result) const OVERRIDE; |
49 virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE; | 49 virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE; |
50 virtual void RemoveObserver(PrefStore::Observer* observer) OVERRIDE; | 50 virtual void RemoveObserver(PrefStore::Observer* observer) OVERRIDE; |
51 virtual size_t NumberOfObservers() const OVERRIDE; | 51 virtual size_t NumberOfObservers() const OVERRIDE; |
52 virtual bool IsInitializationComplete() const OVERRIDE; | 52 virtual bool IsInitializationComplete() const OVERRIDE; |
53 | 53 |
54 // PersistentPrefStore overrides: | 54 // PersistentPrefStore overrides: |
55 virtual ReadResult GetMutableValue(const std::string& key, | 55 virtual bool GetMutableValue(const std::string& key, |
56 base::Value** result) OVERRIDE; | 56 base::Value** result) OVERRIDE; |
57 virtual void SetValue(const std::string& key, base::Value* value) OVERRIDE; | 57 virtual void SetValue(const std::string& key, base::Value* value) OVERRIDE; |
58 virtual void SetValueSilently(const std::string& key, | 58 virtual void SetValueSilently(const std::string& key, |
59 base::Value* value) OVERRIDE; | 59 base::Value* value) OVERRIDE; |
60 virtual void RemoveValue(const std::string& key) OVERRIDE; | 60 virtual void RemoveValue(const std::string& key) OVERRIDE; |
61 virtual void MarkNeedsEmptyValue(const std::string& key) OVERRIDE; | 61 virtual void MarkNeedsEmptyValue(const std::string& key) OVERRIDE; |
62 virtual bool ReadOnly() const OVERRIDE; | 62 virtual bool ReadOnly() const OVERRIDE; |
63 virtual PrefReadError GetReadError() const OVERRIDE; | 63 virtual PrefReadError GetReadError() const OVERRIDE; |
64 virtual PrefReadError ReadPrefs() OVERRIDE; | 64 virtual PrefReadError ReadPrefs() OVERRIDE; |
65 virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) OVERRIDE; | 65 virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) OVERRIDE; |
66 virtual void CommitPendingWrite() OVERRIDE; | 66 virtual void CommitPendingWrite() OVERRIDE; |
(...skipping 27 matching lines...) Expand all Loading... |
94 | 94 |
95 bool initialized_; | 95 bool initialized_; |
96 PrefReadError read_error_; | 96 PrefReadError read_error_; |
97 | 97 |
98 std::set<std::string> keys_need_empty_value_; | 98 std::set<std::string> keys_need_empty_value_; |
99 | 99 |
100 DISALLOW_COPY_AND_ASSIGN(JsonPrefStore); | 100 DISALLOW_COPY_AND_ASSIGN(JsonPrefStore); |
101 }; | 101 }; |
102 | 102 |
103 #endif // BASE_PREFS_JSON_PREF_STORE_H_ | 103 #endif // BASE_PREFS_JSON_PREF_STORE_H_ |
OLD | NEW |