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

Issue 5441002: Clean up pref change notification handling. (Closed)

Created:
10 years ago by Mattias Nissler (ping if slow)
Modified:
9 years, 7 months ago
CC:
chromium-reviews, Aaron Boodman, Erik does not do reviews, ben+cc_chromium.org, pam+watch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Clean up pref change notification handling. This is a complete overhaul of PrefValueStore, PrefStore, PrefNotifier, and PrefService. Specifically: - Add an observer interface to PrefStore that can be used to notify the upper layers of the pref system about value changes. Currently, it's unused mostly, but that'll change when we refactor ExtensionPrefStore and ConfigurationPolicyPrefStore. - Make PrefNotifier be a dependency of PrefValueStore. That helps in keeping the pref change detection handling local to PrefValueStore. - Clean up related unit tests, removing redundant mocks and gmockify others. BUG=64893 TEST=Compiles and passes tests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=68574

Patch Set 1 #

Total comments: 60

Patch Set 2 : Address comments. #

Patch Set 3 : Fix memory leaks in tests. #

Total comments: 24

Patch Set 4 : Address Danno's feedback. #

Total comments: 1

Patch Set 5 : Rebase to ToT after ExtensionPrefs changes. #

Patch Set 6 : Fix build. #

Patch Set 7 : Fix extension prefs breakage #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1576 lines, -1472 lines) Patch
M chrome/browser/extensions/extension_management_browsertest.cc View 1 2 3 4 3 chunks +11 lines, -10 lines 0 comments Download
M chrome/browser/extensions/extension_prefs.cc View 1 2 3 4 5 6 2 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/extensions/extensions_service_unittest.cc View 1 2 3 4 3 chunks +14 lines, -14 lines 0 comments Download
M chrome/browser/policy/managed_prefs_banner_base_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
D chrome/browser/prefs/dummy_pref_store.h View 1 1 chunk +0 lines, -49 lines 0 comments Download
D chrome/browser/prefs/dummy_pref_store.cc View 1 1 chunk +0 lines, -22 lines 0 comments Download
M chrome/browser/prefs/pref_change_registrar_unittest.cc View 3 chunks +3 lines, -10 lines 0 comments Download
M chrome/browser/prefs/pref_member_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/prefs/pref_notifier.h View 1 2 3 1 chunk +11 lines, -102 lines 0 comments Download
D chrome/browser/prefs/pref_notifier.cc View 1 1 chunk +0 lines, -137 lines 0 comments Download
A chrome/browser/prefs/pref_notifier_impl.h View 1 2 3 1 chunk +58 lines, -0 lines 0 comments Download
A chrome/browser/prefs/pref_notifier_impl.cc View 1 2 3 1 chunk +105 lines, -0 lines 0 comments Download
A chrome/browser/prefs/pref_notifier_impl_unittest.cc View 1 2 3 4 1 chunk +199 lines, -0 lines 0 comments Download
D chrome/browser/prefs/pref_notifier_unittest.cc View 1 2 3 4 1 chunk +0 lines, -294 lines 0 comments Download
A chrome/browser/prefs/pref_observer_mock.h View 1 1 chunk +60 lines, -0 lines 0 comments Download
M chrome/browser/prefs/pref_service.h View 1 2 3 4 5 chunks +33 lines, -15 lines 0 comments Download
M chrome/browser/prefs/pref_service.cc View 1 2 3 4 5 6 11 chunks +71 lines, -32 lines 0 comments Download
M chrome/browser/prefs/pref_service_unittest.cc View 1 2 3 4 9 chunks +53 lines, -122 lines 0 comments Download
M chrome/browser/prefs/pref_value_store.h View 1 2 3 4 9 chunks +203 lines, -120 lines 0 comments Download
M chrome/browser/prefs/pref_value_store.cc View 1 2 3 4 8 chunks +260 lines, -238 lines 0 comments Download
M chrome/browser/prefs/pref_value_store_unittest.cc View 1 11 chunks +216 lines, -208 lines 0 comments Download
M chrome/browser/prefs/scoped_pref_update.cc View 1 1 chunk +4 lines, -1 line 0 comments Download
A chrome/browser/prefs/testing_pref_store.h View 1 2 3 1 chunk +63 lines, -0 lines 0 comments Download
A chrome/browser/prefs/testing_pref_store.cc View 1 1 chunk +36 lines, -0 lines 0 comments Download
M chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc View 2 chunks +22 lines, -30 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M chrome/chrome_common.gypi View 1 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 4 chunks +6 lines, -7 lines 0 comments Download
M chrome/common/json_pref_store.h View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/notification_type.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/pref_store.h View 1 3 chunks +33 lines, -5 lines 0 comments Download
A chrome/common/pref_store_base.h View 1 2 3 4 5 1 chunk +33 lines, -0 lines 0 comments Download
A chrome/common/pref_store_base.cc View 1 chunk +21 lines, -0 lines 0 comments Download
A chrome/common/pref_store_observer_mock.h View 1 chunk +26 lines, -0 lines 0 comments Download
M chrome/test/testing_pref_service.h View 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/test/testing_pref_service.cc View 1 2 3 4 2 chunks +17 lines, -17 lines 0 comments Download
D chrome/test/testing_pref_value_store.h View 1 2 3 1 chunk +0 lines, -26 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Mattias Nissler (ping if slow)
This is the current status of my refactoring effort. It's a lot of code because ...
10 years ago (2010-12-01 18:14:04 UTC) #1
danno
here's some stuff to chew on. http://codereview.chromium.org/5441002/diff/1/chrome/browser/prefs/pref_notifier.h File chrome/browser/prefs/pref_notifier.h (right): http://codereview.chromium.org/5441002/diff/1/chrome/browser/prefs/pref_notifier.h#newcode22 chrome/browser/prefs/pref_notifier.h:22: class PrefNotifier : ...
10 years ago (2010-12-02 10:31:52 UTC) #2
battre (please use the other)
first set of comments http://codereview.chromium.org/5441002/diff/1/chrome/browser/extensions/extension_pref_store.h File chrome/browser/extensions/extension_pref_store.h (right): http://codereview.chromium.org/5441002/diff/1/chrome/browser/extensions/extension_pref_store.h#newcode33 chrome/browser/extensions/extension_pref_store.h:33: public NotificationObserver { ExtensionPrefStore will ...
10 years ago (2010-12-02 10:41:19 UTC) #3
battre (please use the other)
Some additional comments http://codereview.chromium.org/5441002/diff/1/chrome/browser/prefs/pref_value_store.h File chrome/browser/prefs/pref_value_store.h (right): http://codereview.chromium.org/5441002/diff/1/chrome/browser/prefs/pref_value_store.h#newcode117 chrome/browser/prefs/pref_value_store.h:117: bool ReadOnly(); Can we make this ...
10 years ago (2010-12-02 11:51:34 UTC) #4
Mattias Nissler (ping if slow)
Comments address for you reviewing pleasure. Please take another look. http://codereview.chromium.org/5441002/diff/1/chrome/browser/extensions/extension_pref_store.h File chrome/browser/extensions/extension_pref_store.h (right): http://codereview.chromium.org/5441002/diff/1/chrome/browser/extensions/extension_pref_store.h#newcode33 ...
10 years ago (2010-12-02 16:38:23 UTC) #5
danno
here you go... http://codereview.chromium.org/5441002/diff/20001/chrome/browser/prefs/pref_notifier.h File chrome/browser/prefs/pref_notifier.h (right): http://codereview.chromium.org/5441002/diff/20001/chrome/browser/prefs/pref_notifier.h#newcode11 chrome/browser/prefs/pref_notifier.h:11: // This is the delegate interface ...
10 years ago (2010-12-06 09:20:13 UTC) #6
Mattias Nissler (ping if slow)
Feedback addressed, new version is up. http://codereview.chromium.org/5441002/diff/20001/chrome/browser/prefs/pref_notifier.h File chrome/browser/prefs/pref_notifier.h (right): http://codereview.chromium.org/5441002/diff/20001/chrome/browser/prefs/pref_notifier.h#newcode11 chrome/browser/prefs/pref_notifier.h:11: // This is ...
10 years ago (2010-12-06 10:58:12 UTC) #7
danno
LGTM if you address the comment. http://codereview.chromium.org/5441002/diff/29001/chrome/common/pref_store_base.h File chrome/common/pref_store_base.h (right): http://codereview.chromium.org/5441002/diff/29001/chrome/common/pref_store_base.h#newcode24 chrome/common/pref_store_base.h:24: void NotifyPrefValueChanged(const std::string& ...
10 years ago (2010-12-06 14:17:53 UTC) #8
Mattias Nissler (ping if slow)
Rebased after Dominics ExtensionPref stuff went in, please take another look.
10 years ago (2010-12-07 08:43:18 UTC) #9
danno
10 years ago (2010-12-07 15:54:56 UTC) #10
LGTM.

Powered by Google App Engine
This is Rietveld 408576698