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 #include "base/prefs/testing_pref_store.h" | 5 #include "base/prefs/testing_pref_store.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 | 9 |
10 TestingPrefStore::TestingPrefStore() | 10 TestingPrefStore::TestingPrefStore() |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 DCHECK(!pending_async_read_); | 82 DCHECK(!pending_async_read_); |
83 error_delegate_.reset(error_delegate); | 83 error_delegate_.reset(error_delegate); |
84 if (block_async_read_) | 84 if (block_async_read_) |
85 pending_async_read_ = true; | 85 pending_async_read_ = true; |
86 else | 86 else |
87 NotifyInitializationCompleted(); | 87 NotifyInitializationCompleted(); |
88 } | 88 } |
89 | 89 |
90 void TestingPrefStore::CommitPendingWrite() { committed_ = true; } | 90 void TestingPrefStore::CommitPendingWrite() { committed_ = true; } |
91 | 91 |
| 92 void TestingPrefStore::SchedulePendingLossyWrites() {} |
| 93 |
92 void TestingPrefStore::SetInitializationCompleted() { | 94 void TestingPrefStore::SetInitializationCompleted() { |
93 NotifyInitializationCompleted(); | 95 NotifyInitializationCompleted(); |
94 } | 96 } |
95 | 97 |
96 void TestingPrefStore::NotifyPrefValueChanged(const std::string& key) { | 98 void TestingPrefStore::NotifyPrefValueChanged(const std::string& key) { |
97 FOR_EACH_OBSERVER(Observer, observers_, OnPrefValueChanged(key)); | 99 FOR_EACH_OBSERVER(Observer, observers_, OnPrefValueChanged(key)); |
98 } | 100 } |
99 | 101 |
100 void TestingPrefStore::NotifyInitializationCompleted() { | 102 void TestingPrefStore::NotifyInitializationCompleted() { |
101 DCHECK(!init_complete_); | 103 DCHECK(!init_complete_); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 read_success_ = read_success; | 167 read_success_ = read_success; |
166 } | 168 } |
167 | 169 |
168 void TestingPrefStore::set_read_error( | 170 void TestingPrefStore::set_read_error( |
169 PersistentPrefStore::PrefReadError read_error) { | 171 PersistentPrefStore::PrefReadError read_error) { |
170 DCHECK(!init_complete_); | 172 DCHECK(!init_complete_); |
171 read_error_ = read_error; | 173 read_error_ = read_error; |
172 } | 174 } |
173 | 175 |
174 TestingPrefStore::~TestingPrefStore() {} | 176 TestingPrefStore::~TestingPrefStore() {} |
OLD | NEW |