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

Unified Diff: base/prefs/default_pref_store.h

Issue 11358123: Rewrite DefaultPrefStore for performance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | base/prefs/default_pref_store.cc » ('j') | base/prefs/default_pref_store.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/prefs/default_pref_store.h
diff --git a/base/prefs/default_pref_store.h b/base/prefs/default_pref_store.h
index 3226cc2ae33c7306bb3fdd2c5d2ebd302ccde90d..76929ddc31e2f7e523a2bb0143de62f89438ea74 100644
--- a/base/prefs/default_pref_store.h
+++ b/base/prefs/default_pref_store.h
@@ -10,13 +10,21 @@
#include "base/prefs/base_prefs_export.h"
#include "base/prefs/value_map_pref_store.h"
#include "base/values.h"
+#include "base/hash_tables.h"
// This PrefStore keeps track of default preference values set when a
// preference is registered with the PrefService.
-class BASE_PREFS_EXPORT DefaultPrefStore : public ValueMapPrefStore {
+class BASE_PREFS_EXPORT DefaultPrefStore : public PrefStore {
public:
+ typedef std::hash_map<std::string, base::Value*>::iterator iterator;
+ typedef std::hash_map<std::string, base::Value*>::const_iterator
+ const_iterator;
+
DefaultPrefStore();
+ virtual ReadResult GetValue(const std::string& key,
+ const base::Value** result) const OVERRIDE;
+
// Stores a new |value| for |key|. Assumes ownership of |value|.
void SetDefaultValue(const std::string& key, Value* value);
@@ -27,10 +35,15 @@ class BASE_PREFS_EXPORT DefaultPrefStore : public ValueMapPrefStore {
// has not been registered.
base::Value::Type GetType(const std::string& key) const;
+ const_iterator begin() const;
+ const_iterator end() const;
+
protected:
virtual ~DefaultPrefStore();
private:
+ std::hash_map<std::string, base::Value*> prefs_;
Mattias Nissler (ping if slow) 2012/11/07 08:24:02 This should be a PrefValueMap.
Anthony Berent 2012/11/07 11:22:54 Done. Will be in next patch.
+
DISALLOW_COPY_AND_ASSIGN(DefaultPrefStore);
};
« no previous file with comments | « no previous file | base/prefs/default_pref_store.cc » ('j') | base/prefs/default_pref_store.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698