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

Unified Diff: chrome/browser/prefs/pref_value_store.h

Issue 5212005: Make comments about profile pointer in pref_value_store more informative. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates. Created 10 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 | « chrome/browser/policy/device_token_fetcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/pref_value_store.h
diff --git a/chrome/browser/prefs/pref_value_store.h b/chrome/browser/prefs/pref_value_store.h
index 0e741c7701c6de28bf0e4bc71e12b4d5697135c9..37c116780a83677f2c0506b79f1aeb6f27c38e47 100644
--- a/chrome/browser/prefs/pref_value_store.h
+++ b/chrome/browser/prefs/pref_value_store.h
@@ -187,12 +187,14 @@ class PrefValueStore : public base::RefCountedThreadSafe<PrefValueStore> {
// be non-null if any preferences are to be registered.
//
// The |profile| parameter is used to construct a replacement device
- // management pref store in case of policy refresh, may be NULL for the local
- // state preferences.
+ // management pref store. This is done after policy refresh when we swap out
+ // the policy pref stores for new ones, so the |profile| pointer needs to be
+ // kept around for then. It is safe to pass a NULL pointer for local state
+ // preferences.
//
// TODO(mnissler, danno): Refactor the pref store interface and refresh logic
- // so refreshes can be handled by the pref store itself and the profile
- // parameter be removed here.
+ // so refreshes can be handled by the pref store itself without swapping
+ // stores. This way we can get rid of the profile pointer here.
//
// This constructor should only be used internally, or by subclasses in
// testing. The usual way to create a PrefValueStore is by creating a
@@ -247,7 +249,9 @@ class PrefValueStore : public base::RefCountedThreadSafe<PrefValueStore> {
// A mapping of preference names to their registered types.
PrefTypeMap pref_types_;
- // The associated profile, if applicable.
+ // The associated profile, in case this value store is associated with a
+ // profile pref service. Used for recreating the device management pref store
+ // upon policy refresh.
Profile* profile_;
DISALLOW_COPY_AND_ASSIGN(PrefValueStore);
« no previous file with comments | « chrome/browser/policy/device_token_fetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698