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

Unified Diff: base/prefs/pref_service.h

Issue 439913002: Add a cache for FillFontFamilyMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chrome_content_browser_client.cc » ('j') | chrome/browser/font_family_cache.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/prefs/pref_service.h
diff --git a/base/prefs/pref_service.h b/base/prefs/pref_service.h
index 186433c1b62907c16eb3360ca8d567ca2b1a07a6..0ba605e60de97955e86487b5cc4478c2bc194b18 100644
--- a/base/prefs/pref_service.h
+++ b/base/prefs/pref_service.h
@@ -17,6 +17,7 @@
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/containers/hash_tables.h"
+#include "base/containers/scoped_ptr_hash_map.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
@@ -41,6 +42,10 @@ class PrefMemberBase;
class ScopedUserPrefUpdateBase;
}
+// Base class for caches associated with the PrefService.
+class BASE_PREFS_EXPORT PrefServiceCache {
+};
+
// Base class for PrefServices. You can use the base class to read and
// interact with preferences, but not to register new preferences; for
// that see e.g. PrefRegistrySimple.
@@ -270,6 +275,10 @@ class BASE_PREFS_EXPORT PrefService : public base::NonThreadSafe {
// implemented in chrome/browser/prefs/browser_prefs.cc.
PrefRegistry* DeprecatedGetPrefRegistry();
+ base::ScopedPtrHashMap<const char*, PrefServiceCache>* GetPrefsCaches() {
+ return &prefs_caches_;
+ }
+
protected:
// The PrefNotifier handles registering and notifying preference observers.
// It is created and owned by this PrefService. Subclasses may access it for
@@ -353,6 +362,9 @@ class BASE_PREFS_EXPORT PrefService : public base::NonThreadSafe {
// of registered preferences are.
mutable PreferenceMap prefs_map_;
+ // General purpose caches.
+ base::ScopedPtrHashMap<const char*, PrefServiceCache> prefs_caches_;
+
DISALLOW_COPY_AND_ASSIGN(PrefService);
};
« no previous file with comments | « no previous file | chrome/browser/chrome_content_browser_client.cc » ('j') | chrome/browser/font_family_cache.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698