| 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 COMPONENTS_PREFS_TESTING_PREF_STORE_H_ | 5 #ifndef COMPONENTS_PREFS_TESTING_PREF_STORE_H_ |
| 6 #define COMPONENTS_PREFS_TESTING_PREF_STORE_H_ | 6 #define COMPONENTS_PREFS_TESTING_PREF_STORE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 bool GetInteger(const std::string& key, int* value) const; | 64 bool GetInteger(const std::string& key, int* value) const; |
| 65 bool GetBoolean(const std::string& key, bool* value) const; | 65 bool GetBoolean(const std::string& key, bool* value) const; |
| 66 | 66 |
| 67 // Determines whether ReadPrefsAsync completes immediately. Defaults to false | 67 // Determines whether ReadPrefsAsync completes immediately. Defaults to false |
| 68 // (non-blocking). To block, invoke this with true (blocking) before the call | 68 // (non-blocking). To block, invoke this with true (blocking) before the call |
| 69 // to ReadPrefsAsync. To unblock, invoke again with false (non-blocking) after | 69 // to ReadPrefsAsync. To unblock, invoke again with false (non-blocking) after |
| 70 // the call to ReadPrefsAsync. | 70 // the call to ReadPrefsAsync. |
| 71 void SetBlockAsyncRead(bool block_async_read); | 71 void SetBlockAsyncRead(bool block_async_read); |
| 72 | 72 |
| 73 void ClearMutableValues() override; | 73 void ClearMutableValues() override; |
| 74 void OnStoreDeletionFromDisk() override; |
| 74 | 75 |
| 75 // Getter and Setter methods for setting and getting the state of the | 76 // Getter and Setter methods for setting and getting the state of the |
| 76 // |TestingPrefStore|. | 77 // |TestingPrefStore|. |
| 77 virtual void set_read_only(bool read_only); | 78 virtual void set_read_only(bool read_only); |
| 78 void set_read_success(bool read_success); | 79 void set_read_success(bool read_success); |
| 79 void set_read_error(PersistentPrefStore::PrefReadError read_error); | 80 void set_read_error(PersistentPrefStore::PrefReadError read_error); |
| 80 bool committed() { return committed_; } | 81 bool committed() { return committed_; } |
| 81 | 82 |
| 82 protected: | 83 protected: |
| 83 ~TestingPrefStore() override; | 84 ~TestingPrefStore() override; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 111 // mutation. | 112 // mutation. |
| 112 bool committed_; | 113 bool committed_; |
| 113 | 114 |
| 114 std::unique_ptr<ReadErrorDelegate> error_delegate_; | 115 std::unique_ptr<ReadErrorDelegate> error_delegate_; |
| 115 base::ObserverList<PrefStore::Observer, true> observers_; | 116 base::ObserverList<PrefStore::Observer, true> observers_; |
| 116 | 117 |
| 117 DISALLOW_COPY_AND_ASSIGN(TestingPrefStore); | 118 DISALLOW_COPY_AND_ASSIGN(TestingPrefStore); |
| 118 }; | 119 }; |
| 119 | 120 |
| 120 #endif // COMPONENTS_PREFS_TESTING_PREF_STORE_H_ | 121 #endif // COMPONENTS_PREFS_TESTING_PREF_STORE_H_ |
| OLD | NEW |