Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register prefs in right places #3031

Merged
merged 1 commit into from
Aug 2, 2019
Merged

Register prefs in right places #3031

merged 1 commit into from
Aug 2, 2019

Conversation

darkdh
Copy link
Member

@darkdh darkdh commented Jul 26, 2019

  1. Prefs used by keyed service must be registered or set default in
    RegisterProfilePrefs of pref_service_builder_utils
  2. RegisterProfilePrefs or RegisterLocalStatePrefs depends on scope

fix brave/brave-browser#5414

Submitter Checklist:

Test Plan:

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@darkdh darkdh requested a review from bridiver as a code owner July 26, 2019 19:48
@darkdh darkdh requested a review from bbondy July 26, 2019 19:48
@darkdh darkdh self-assigned this Jul 26, 2019
@darkdh darkdh force-pushed the reg-pref-rework branch from 179b070 to b8aab8c Compare July 26, 2019 23:21
@@ -908,6 +909,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
#endif

RegisterProfilePrefsForMigration(registry);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need a patch here? Can't we just do a chromium_src override for RegisterProfilePrefs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that will also override the calling from RegisterUserProfilePrefs and RegisterSigninProfilePrefs to be RegisterProfilePrefs_ChromiumImpl and no one calls our overridden RegisterProfilePrefs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it overrides extensions::ActivityLog::RegisterProfilePrefs => extensions::ActivityLog::RegisterProfilePrefs_ChromiumImpl and bunch of same cases

LoadPrefsForNormalStartup(async_prefs);
#endif

+// Done here instead of browser_prefs.cc so it can override default prefs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@darkdh did you verify that this still works correctly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, if we override default at wrong place, we will get a DCHECK failure saying using unregistered prefs

bridiver
bridiver previously approved these changes Aug 1, 2019
@darkdh darkdh force-pushed the reg-pref-rework branch 2 times, most recently from 1bb111a to c6660c6 Compare August 2, 2019 04:08
1. Prefs used by keyed service must be registered or set default in
RegisterProfilePrefs of pref_service_builder_utils
2. RegisterProfilePrefs or RegisterLocalStatePrefs depends on scope
@darkdh
Copy link
Member Author

darkdh commented Aug 2, 2019

this only error https://staging.ci.brave.com/job/brave-browser-build-pr/job/reg-pref-rework/9/execution/node/359/log/ doesn't seem like related to code changes
cc @mihaiplesa

@darkdh darkdh merged commit 3a56a40 into master Aug 2, 2019
@darkdh darkdh deleted the reg-pref-rework branch August 2, 2019 20:51
@darkdh darkdh added this to the 0.70.x - Nightly milestone Aug 7, 2019
simonhong added a commit that referenced this pull request Aug 11, 2019
Regression of #3031.
Each unit test doesn't need to register specific prefs after above PR.
darkdh added a commit that referenced this pull request Aug 23, 2019
Register prefs in right places
@darkdh darkdh modified the milestones: 0.70.x - Dev, 0.69.x - Beta Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prefs registered and set default in wrong place
2 participants