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

Unified Diff: chrome/browser/pref_service.h

Issue 1549020: Add a scoped notifier for pref dictionaries / lists. (Closed)
Patch Set: Fix props. Created 10 years, 9 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 | « chrome/browser/cocoa/preferences_window_controller.mm ('k') | chrome/browser/scoped_pref_update.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/pref_service.h
diff --git a/chrome/browser/pref_service.h b/chrome/browser/pref_service.h
index 85dd42ca8f7858ef2e18d44814ea8e9bc49b56bb..f1819adf4e6973f1cfbaaae9089903dac1cae158 100644
--- a/chrome/browser/pref_service.h
+++ b/chrome/browser/pref_service.h
@@ -27,6 +27,7 @@
class NotificationObserver;
class Preference;
+class ScopedPrefUpdate;
class PrefService : public NonThreadSafe,
public ImportantFileWriter::DataSerializer {
@@ -158,7 +159,8 @@ class PrefService : public NonThreadSafe,
// This method returns NULL only if you're requesting an unregistered pref or
// a non-dict/non-list pref.
// WARNING: Changes to the dictionary or list will not automatically notify
- // pref observers. TODO(tc): come up with a way to still fire observers.
+ // pref observers.
+ // Use a ScopedPrefUpdate to update observers on changes.
DictionaryValue* GetMutableDictionary(const wchar_t* path);
ListValue* GetMutableList(const wchar_t* path);
@@ -216,6 +218,8 @@ class PrefService : public NonThreadSafe,
PrefObserverMap;
PrefObserverMap pref_observers_;
+ friend class ScopedPrefUpdate;
+
DISALLOW_COPY_AND_ASSIGN(PrefService);
};
« no previous file with comments | « chrome/browser/cocoa/preferences_window_controller.mm ('k') | chrome/browser/scoped_pref_update.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698