Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: components/prefs/testing_pref_store.cc

Issue 2905903002: Delete the PreferenceMACs on profile deletion. (Closed)
Patch Set: Update comments Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "components/prefs/testing_pref_store.h" 5 #include "components/prefs/testing_pref_store.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 DCHECK(!init_complete_); 176 DCHECK(!init_complete_);
177 block_async_read_ = block_async_read; 177 block_async_read_ = block_async_read;
178 if (pending_async_read_ && !block_async_read_) 178 if (pending_async_read_ && !block_async_read_)
179 NotifyInitializationCompleted(); 179 NotifyInitializationCompleted();
180 } 180 }
181 181
182 void TestingPrefStore::ClearMutableValues() { 182 void TestingPrefStore::ClearMutableValues() {
183 NOTIMPLEMENTED(); 183 NOTIMPLEMENTED();
184 } 184 }
185 185
186 void TestingPrefStore::OnStoreDeletionFromDisk() {}
187
186 void TestingPrefStore::set_read_only(bool read_only) { 188 void TestingPrefStore::set_read_only(bool read_only) {
187 read_only_ = read_only; 189 read_only_ = read_only;
188 } 190 }
189 191
190 void TestingPrefStore::set_read_success(bool read_success) { 192 void TestingPrefStore::set_read_success(bool read_success) {
191 DCHECK(!init_complete_); 193 DCHECK(!init_complete_);
192 read_success_ = read_success; 194 read_success_ = read_success;
193 } 195 }
194 196
195 void TestingPrefStore::set_read_error( 197 void TestingPrefStore::set_read_error(
196 PersistentPrefStore::PrefReadError read_error) { 198 PersistentPrefStore::PrefReadError read_error) {
197 DCHECK(!init_complete_); 199 DCHECK(!init_complete_);
198 read_error_ = read_error; 200 read_error_ = read_error;
199 } 201 }
200 202
201 TestingPrefStore::~TestingPrefStore() { 203 TestingPrefStore::~TestingPrefStore() {
202 for (auto& pref : prefs_) { 204 for (auto& pref : prefs_) {
203 CheckPrefIsSerializable(pref.first, *pref.second); 205 CheckPrefIsSerializable(pref.first, *pref.second);
204 } 206 }
205 } 207 }
206 208
207 void TestingPrefStore::CheckPrefIsSerializable(const std::string& key, 209 void TestingPrefStore::CheckPrefIsSerializable(const std::string& key,
208 const base::Value& value) { 210 const base::Value& value) {
209 std::string json; 211 std::string json;
210 EXPECT_TRUE(base::JSONWriter::Write(value, &json)) 212 EXPECT_TRUE(base::JSONWriter::Write(value, &json))
211 << "Pref \"" << key << "\" is not serializable as JSON."; 213 << "Pref \"" << key << "\" is not serializable as JSON.";
212 } 214 }
OLDNEW
« no previous file with comments | « components/prefs/testing_pref_store.h ('k') | services/preferences/persistent_pref_store_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698