Chromium Code Reviews
Help | Chromium Project | Sign in
(230)

Issue 3051001: Adjust preference sync code to only sync user modifiable preferences. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 years, 10 months ago by Mattias Nissler
Modified:
4 years ago
CC:
chromium-reviews, ncarter, idana, Raghu Simha, ben+cc_chromium.org, Paweł Hajdan Jr., brettw-cc_chromium.org, timsteele, Erik does not do reviews, Aaron Boodman, pam+watch_chromium.org
Base URL:
http://src.chromium.org/git/chromium.git
Visibility:
Public.

Description

Adjust preference sync code to only sync user modifiable preferences. Switch to the new preference value source checkers in Preference. While at it, add a unit test and better test infrastructure for controlling preference values in tests. Convert existing unit tests where appropriate. BUG=48952 TEST=ProfileSyncServicePreferenceTest.ManagedPreferences Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=53179

Patch Set 1 #

Total comments: 18

Patch Set 2 : address pam's comments. #

Patch Set 3 : convert existing test cases where appropriate #

Total comments: 8

Patch Set 4 : switch TestExtensionPrefs back to a full pref store, fix memory leak. #

Patch Set 5 : separate out the download_manager_unittest.cc fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+269 lines, -157 lines) Patch
M chrome/browser/dom_ui/new_tab_ui_uitest.cc View 4 chunks +3 lines, -6 lines 0 comments Download
M chrome/browser/dom_ui/shown_sections_handler_unittest.cc View 4 chunks +4 lines, -9 lines 0 comments Download
M chrome/browser/managed_prefs_banner_base_unittest.cc View 2 chunks +8 lines, -20 lines 0 comments Download
M chrome/browser/pref_member_unittest.cc View 4 chunks +5 lines, -8 lines 0 comments Download
M chrome/browser/pref_service.h View 1 2 3 chunks +8 lines, -3 lines 0 comments Download
M chrome/browser/pref_service.cc View 1 2 3 chunks +23 lines, -19 lines 0 comments Download
M chrome/browser/pref_service_unittest.cc View 8 chunks +9 lines, -17 lines 0 comments Download
M chrome/browser/pref_value_store.h View 1 2 3 2 chunks +11 lines, -1 line 0 comments Download
M chrome/browser/pref_value_store.cc View 1 2 3 2 chunks +12 lines, -8 lines 0 comments Download
M chrome/browser/sync/glue/preference_change_processor.cc View 1 3 chunks +9 lines, -8 lines 0 comments Download
M chrome/browser/sync/glue/preference_model_associator.cc View 1 2 chunks +5 lines, -7 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_preference_unittest.cc View 2 chunks +33 lines, -1 line 0 comments Download
M chrome/browser/tab_contents/web_contents_unittest.cc View 1 2 3 chunks +23 lines, -25 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
D chrome/test/data/profiles/chrome_prefs/History View 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/test/data/profiles/chrome_prefs/Preferences View 1 chunk +0 lines, -20 lines 0 comments Download
A chrome/test/testing_pref_service.h View 1 2 1 chunk +51 lines, -0 lines 0 comments Download
A chrome/test/testing_pref_service.cc View 1 2 1 chunk +60 lines, -0 lines 0 comments Download
M chrome/test/testing_profile.h View 3 chunks +4 lines, -6 lines 0 comments Download
Commit: CQ not working?

Messages

Total messages: 7 (0 generated)
Mattias Nissler
Please review. Note that I'm not positive whether the changes to TestingProfile::GetPrefs() prove viable, I'm ...
4 years, 10 months ago (2010-07-19 11:57:18 UTC) #1
Pam (also PM for reviews)
You can point this at bug 48952 for the sake of having something there. Having ...
4 years, 10 months ago (2010-07-19 13:19:05 UTC) #2
Mattias Nissler
I've uploaded a new version with nits fixed, I'll take care of converting tests tomorrow. ...
4 years, 10 months ago (2010-07-19 16:45:11 UTC) #3
skrul
Sync parts LGTM, thanks for the unit test!
4 years, 10 months ago (2010-07-19 19:21:18 UTC) #4
Mattias Nissler
Pam, would you take another look? Thanks.
4 years, 10 months ago (2010-07-20 09:48:15 UTC) #5
Pam (also PM for reviews)
LGTM once the below comments are addressed and trybots pass. No need for re-review unless ...
4 years, 10 months ago (2010-07-20 10:46:29 UTC) #6
Mattias Nissler
4 years, 10 months ago (2010-07-20 13:05:40 UTC) #7
Once the trybots give their OK (in particular the memory leak is gone), I'm
going to commit this. Speak up if you have objections :)

http://codereview.chromium.org/3051001/diff/11001/12001
File chrome/browser/dom_ui/new_tab_ui_uitest.cc (right):

http://codereview.chromium.org/3051001/diff/11001/12001#newcode164
chrome/browser/dom_ui/new_tab_ui_uitest.cc:164: }
On 2010/07/20 10:46:29, Pam wrote:
> Please restore the trailing CR. Some compilers complain without them.

Note there still _is_ a trailing CR, but no trailing blank line (which amounts
to two CRs). pkasting actually advised me to do what I did. Technically, it's
not even me, but google.vim :)

http://codereview.chromium.org/3051001/diff/11001/12002
File chrome/browser/dom_ui/shown_sections_handler_unittest.cc (left):

http://codereview.chromium.org/3051001/diff/11001/12002#oldcode42
chrome/browser/dom_ui/shown_sections_handler_unittest.cc:42:
scoped_ptr<PrefService> pref(PrefService::CreateUserPrefService(user_prefs));
On 2010/07/20 10:46:29, Pam wrote:
> Does anything use CreateUserPrefService anymore, or could it be removed?

There are still tests that rely on file-backed PrefServices (e.g. for checking
results from a different process), so I kept it.

http://codereview.chromium.org/3051001/diff/11001/12011
File chrome/browser/pref_value_store.h (right):

http://codereview.chromium.org/3051001/diff/11001/12011#newcode124
chrome/browser/pref_value_store.h:124: PrefStoreType
EffectivePrefStoreForPref(const wchar_t* name);
On 2010/07/20 10:46:29, Pam wrote:
> Did you miss my suggestion of renaming this "ControllingPrefStore", to be
> clearer as well as matching what the PrefService uses? It's not required; I
just
> want to be sure you noticed.

Yes, I missed that comment, sorry. I agree that it's clearer and changed it.

http://codereview.chromium.org/3051001/diff/11001/12020
File chrome/test/testing_pref_service.h (right):

http://codereview.chromium.org/3051001/diff/11001/12020#newcode38
chrome/test/testing_pref_service.h:38: const Value* GetPref(PrefStore*
pref_store, const wchar_t* path);
On 2010/07/20 10:46:29, Pam wrote:
> Were they not fine as static? No objection either way.

They now also fire observers, so they can't be static.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld ec887be