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

Unified Diff: base/prefs/default_pref_store.cc

Issue 11358123: Rewrite DefaultPrefStore for performance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review changes Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: base/prefs/default_pref_store.cc
diff --git a/base/prefs/default_pref_store.cc b/base/prefs/default_pref_store.cc
index c031221496e54eeb89601c87ba09259ccf387ebc..eb14a5043ebc9588093801f4945822b9987c3907 100644
--- a/base/prefs/default_pref_store.cc
+++ b/base/prefs/default_pref_store.cc
@@ -3,19 +3,26 @@
// found in the LICENSE file.
#include "base/prefs/default_pref_store.h"
+#include "base/logging.h"
battre 2012/11/07 11:50:49 not necessary
using base::Value;
DefaultPrefStore::DefaultPrefStore() {}
+PrefStore::ReadResult DefaultPrefStore::GetValue(
+ const std::string& key,
+ const base::Value** result) const {
+ return prefs_.GetValue(key, result) ? READ_OK : READ_NO_VALUE;
+}
+
void DefaultPrefStore::SetDefaultValue(const std::string& key, Value* value) {
CHECK(GetValue(key, NULL) == READ_NO_VALUE);
- SetValue(key, value);
+ prefs_.SetValue(key, value);
}
void DefaultPrefStore::RemoveDefaultValue(const std::string& key) {
CHECK(GetValue(key, NULL) == READ_OK);
- RemoveValue(key);
+ prefs_.RemoveValue(key);
}
base::Value::Type DefaultPrefStore::GetType(const std::string& key) const {
@@ -23,4 +30,12 @@ base::Value::Type DefaultPrefStore::GetType(const std::string& key) const {
return GetValue(key, &value) == READ_OK ? value->GetType() : Value::TYPE_NULL;
}
+DefaultPrefStore::const_iterator DefaultPrefStore::begin() const {
+ return prefs_.begin();
+}
+
+DefaultPrefStore::const_iterator DefaultPrefStore::end() const {
+ return prefs_.end();
+}
+
DefaultPrefStore::~DefaultPrefStore() {}

Powered by Google App Engine
This is Rietveld 408576698