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

Issue 2635093002: Switch Preferences to use Factory (Closed)

Created:
3 years, 11 months ago by jonross
Modified:
3 years, 11 months ago
CC:
chromium-reviews, sadrul, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, kalyank, darin (slow to review)
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Switch Preferences to use Factory Update the Preferences mojom to include a PreferencesFactory. This factory will be responsible for creating a PreferencesManager, and enforcing the binding of the PreferencesObserver at creation time. Vs the current method which does not guarantee this. Chrome will no longer expose PreferencesManager as a service directly. Ash has been updated to connect to the factory. PrefObserverStore has been updated to receive the factory and to bind to the manager this way. TEST=manual testing, preferences_unittests BUG=674140 Review-Url: https://codereview.chromium.org/2635093002 Cr-Commit-Position: refs/heads/master@{#444832} Committed: https://chromium.googlesource.com/chromium/src/+/016032b4d15cd6583a5249c10d59c4de854a2b03

Patch Set 1 #

Patch Set 2 : Remove AddObserver api #

Patch Set 3 : Remove old constructor #

Patch Set 4 : docs #

Total comments: 2

Patch Set 5 : dcheck for bound #

Total comments: 4

Patch Set 6 : Rebase #

Patch Set 7 : Missed test #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+92 lines, -59 lines) Patch
M ash/common/wm_shell.cc View 1 2 3 4 5 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/prefs/preferences_connection_manager.h View 3 chunks +13 lines, -5 lines 0 comments Download
M chrome/browser/prefs/preferences_connection_manager.cc View 1 2 3 4 5 6 4 chunks +17 lines, -9 lines 0 comments Download
M chrome/browser/prefs/preferences_manager.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/prefs/preferences_manager.cc View 1 2 3 4 3 chunks +5 lines, -13 lines 0 comments Download
M chrome/browser/prefs/preferences_manager_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/prefs/preferences_manifest.json View 1 chunk +1 line, -1 line 0 comments Download
M services/preferences/public/cpp/pref_observer_store.h View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M services/preferences/public/cpp/pref_observer_store.cc View 1 2 1 chunk +6 lines, -5 lines 0 comments Download
M services/preferences/public/cpp/tests/pref_observer_store_unittest.cc View 1 5 chunks +35 lines, -17 lines 0 comments Download
M services/preferences/public/interfaces/preferences.mojom View 1 2 3 2 chunks +7 lines, -1 line 2 comments Download

Messages

Total messages: 22 (7 generated)
jonross
Hey dcheng@: You had suggested the use of a Factory pattern for the preferences mojom ...
3 years, 11 months ago (2017-01-16 21:03:15 UTC) #2
dcheng
LGTM. I am curious about how you feel about the overall before/after of the code ...
3 years, 11 months ago (2017-01-17 22:36:33 UTC) #3
jonross
I'll add comments on the thread. https://codereview.chromium.org/2635093002/diff/60001/chrome/browser/prefs/preferences_manager.cc File chrome/browser/prefs/preferences_manager.cc (right): https://codereview.chromium.org/2635093002/diff/60001/chrome/browser/prefs/preferences_manager.cc#newcode21 chrome/browser/prefs/preferences_manager.cc:21: DCHECK(profile); On 2017/01/17 ...
3 years, 11 months ago (2017-01-17 23:05:43 UTC) #4
jonross
sky@chromium.org: Please review changes in chrome/browser This change switches the setup of PreferencesManager to use ...
3 years, 11 months ago (2017-01-17 23:09:03 UTC) #6
sky
LGTM https://codereview.chromium.org/2635093002/diff/80001/chrome/browser/prefs/preferences_connection_manager.cc File chrome/browser/prefs/preferences_connection_manager.cc (right): https://codereview.chromium.org/2635093002/diff/80001/chrome/browser/prefs/preferences_connection_manager.cc#newcode50 chrome/browser/prefs/preferences_connection_manager.cc:50: for (auto it = std::begin(manager_bindings_); Why do you ...
3 years, 11 months ago (2017-01-17 23:45:04 UTC) #7
jonross
https://codereview.chromium.org/2635093002/diff/80001/chrome/browser/prefs/preferences_connection_manager.cc File chrome/browser/prefs/preferences_connection_manager.cc (right): https://codereview.chromium.org/2635093002/diff/80001/chrome/browser/prefs/preferences_connection_manager.cc#newcode50 chrome/browser/prefs/preferences_connection_manager.cc:50: for (auto it = std::begin(manager_bindings_); On 2017/01/17 23:45:04, sky ...
3 years, 11 months ago (2017-01-18 23:13:02 UTC) #8
jonross
ben@chromium.org: Please review changes in services/preferences/ This change switches the preferences mojom to use a ...
3 years, 11 months ago (2017-01-18 23:13:43 UTC) #10
sky
https://codereview.chromium.org/2635093002/diff/80001/chrome/browser/prefs/preferences_connection_manager.cc File chrome/browser/prefs/preferences_connection_manager.cc (right): https://codereview.chromium.org/2635093002/diff/80001/chrome/browser/prefs/preferences_connection_manager.cc#newcode50 chrome/browser/prefs/preferences_connection_manager.cc:50: for (auto it = std::begin(manager_bindings_); On 2017/01/18 23:13:02, jonross ...
3 years, 11 months ago (2017-01-18 23:38:25 UTC) #11
jonross
https://codereview.chromium.org/2635093002/diff/80001/chrome/browser/prefs/preferences_connection_manager.cc File chrome/browser/prefs/preferences_connection_manager.cc (right): https://codereview.chromium.org/2635093002/diff/80001/chrome/browser/prefs/preferences_connection_manager.cc#newcode50 chrome/browser/prefs/preferences_connection_manager.cc:50: for (auto it = std::begin(manager_bindings_); On 2017/01/18 23:38:25, sky ...
3 years, 11 months ago (2017-01-19 15:24:13 UTC) #12
sky
LGTM
3 years, 11 months ago (2017-01-19 17:00:03 UTC) #13
jonross
On 2017/01/19 17:00:03, sky wrote: > LGTM Hey Ben, Could you provide an owners review ...
3 years, 11 months ago (2017-01-19 18:38:42 UTC) #14
Ben Goodger (Google)
lgtm https://codereview.chromium.org/2635093002/diff/120001/services/preferences/public/interfaces/preferences.mojom File services/preferences/public/interfaces/preferences.mojom (right): https://codereview.chromium.org/2635093002/diff/120001/services/preferences/public/interfaces/preferences.mojom#newcode15 services/preferences/public/interfaces/preferences.mojom:15: Create(PreferencesObserver observer, PreferencesManager& manager); fwiw, now that you've ...
3 years, 11 months ago (2017-01-19 18:56:54 UTC) #15
jonross
https://codereview.chromium.org/2635093002/diff/120001/services/preferences/public/interfaces/preferences.mojom File services/preferences/public/interfaces/preferences.mojom (right): https://codereview.chromium.org/2635093002/diff/120001/services/preferences/public/interfaces/preferences.mojom#newcode15 services/preferences/public/interfaces/preferences.mojom:15: Create(PreferencesObserver observer, PreferencesManager& manager); On 2017/01/19 18:56:54, Ben Goodger ...
3 years, 11 months ago (2017-01-19 19:07:05 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2635093002/120001
3 years, 11 months ago (2017-01-19 19:07:59 UTC) #19
commit-bot: I haz the power
3 years, 11 months ago (2017-01-19 20:20:54 UTC) #22
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/016032b4d15cd6583a5249c10d59...

Powered by Google App Engine
This is Rietveld 408576698