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

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

Issue 81183005: Remove JsonPrefStore pruning of empty values on write. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove else Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « base/prefs/testing_pref_store.h ('k') | base/test/data/prefs/read.need_empty_value.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 void TestingPrefStore::SetValueSilently(const std::string& key, 46 void TestingPrefStore::SetValueSilently(const std::string& key,
47 base::Value* value) { 47 base::Value* value) {
48 prefs_.SetValue(key, value); 48 prefs_.SetValue(key, value);
49 } 49 }
50 50
51 void TestingPrefStore::RemoveValue(const std::string& key) { 51 void TestingPrefStore::RemoveValue(const std::string& key) {
52 if (prefs_.RemoveValue(key)) 52 if (prefs_.RemoveValue(key))
53 NotifyPrefValueChanged(key); 53 NotifyPrefValueChanged(key);
54 } 54 }
55 55
56 void TestingPrefStore::MarkNeedsEmptyValue(const std::string& key) {
57 }
58
59 bool TestingPrefStore::ReadOnly() const { 56 bool TestingPrefStore::ReadOnly() const {
60 return read_only_; 57 return read_only_;
61 } 58 }
62 59
63 PersistentPrefStore::PrefReadError TestingPrefStore::GetReadError() const { 60 PersistentPrefStore::PrefReadError TestingPrefStore::GetReadError() const {
64 return PersistentPrefStore::PREF_READ_ERROR_NONE; 61 return PersistentPrefStore::PREF_READ_ERROR_NONE;
65 } 62 }
66 63
67 PersistentPrefStore::PrefReadError TestingPrefStore::ReadPrefs() { 64 PersistentPrefStore::PrefReadError TestingPrefStore::ReadPrefs() {
68 NotifyInitializationCompleted(); 65 NotifyInitializationCompleted();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 return false; 124 return false;
128 125
129 return stored_value->GetAsBoolean(value); 126 return stored_value->GetAsBoolean(value);
130 } 127 }
131 128
132 void TestingPrefStore::set_read_only(bool read_only) { 129 void TestingPrefStore::set_read_only(bool read_only) {
133 read_only_ = read_only; 130 read_only_ = read_only;
134 } 131 }
135 132
136 TestingPrefStore::~TestingPrefStore() {} 133 TestingPrefStore::~TestingPrefStore() {}
OLDNEW
« no previous file with comments | « base/prefs/testing_pref_store.h ('k') | base/test/data/prefs/read.need_empty_value.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698