Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Issue 10828345: Extract PrefServiceBase into chrome/browser/api. Use in api and autofill. (Closed)

Created:
8 years, 4 months ago by Jói
Modified:
8 years, 2 months ago
CC:
chromium-reviews, dbeam+watch-ntp_chromium.org, David Black, cbentzel+watch_chromium.org, mihaip-chromium-reviews_chromium.org, dyu1, estade+watch_chromium.org, dhollowa+watch_chromium.org, browser-components-watch_chromium.org, sreeram, jam, gideonwald, dominich, Aaron Boodman, darin-cc_chromium.org, Shishir, rdsmith+dwatch_chromium.org, brettw-cc_chromium.org, stuartmorgan+watch_chromium.org, Ilya Sherman, Jered
Visibility:
Public.

Description

Extract PrefServiceBase into chrome/browser/api. Use in api and autofill. TBR=owners other than for prefs and api, since other changes are trivial and mechanical BUG=140037 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=152569

Patch Set 1 #

Total comments: 9

Patch Set 2 : Add Preference and FindPreference to the API #

Patch Set 3 : Merge to head #

Unified diffs Side-by-side diffs Delta from patch set Stats (+508 lines, -294 lines) Patch
M chrome/browser/api/prefs/DEPS View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/api/prefs/pref_change_registrar.h View 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/api/prefs/pref_change_registrar.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/api/prefs/pref_member.h View 5 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/api/prefs/pref_member.cc View 1 3 chunks +3 lines, -3 lines 0 comments Download
A chrome/browser/api/prefs/pref_service_base.h View 1 2 1 chunk +271 lines, -0 lines 0 comments Download
M chrome/browser/autofill/DEPS View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/autofill/autocomplete_history_manager.cc View 3 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/autofill/autofill_common_test.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/autofill/autofill_download.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/autofill/autofill_manager.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/autofill/autofill_manager.cc View 1 2 5 chunks +13 lines, -12 lines 0 comments Download
M chrome/browser/autofill/autofill_manager_unittest.cc View 6 chunks +21 lines, -22 lines 0 comments Download
M chrome/browser/autofill/personal_data_manager.cc View 4 chunks +9 lines, -5 lines 0 comments Download
M chrome/browser/captive_portal/captive_portal_service.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/input_method/browser_state_monitor.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/download/download_prefs.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/download/download_prefs.cc View 1 chunk +6 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/font_settings/font_settings_api.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/net/chrome_network_delegate.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/net/net_pref_observer.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/plugin_prefs.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/policy/cloud_policy_refresh_scheduler.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/prefs/pref_service.h View 1 2 9 chunks +123 lines, -216 lines 0 comments Download
M chrome/browser/prefs/pref_service.cc View 1 3 chunks +9 lines, -0 lines 0 comments Download
M chrome/browser/printing/print_view_manager.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/profiles/gaia_info_update_service.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/profiles/gaia_info_update_service.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/profiles/off_the_record_profile_io_data.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/profiles/profile_impl_io_data.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/renderer_host/plugin_info_message_filter.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/spellchecker/spellcheck_host.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/alternate_error_tab_observer.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/browser_instant_controller.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/gtk/browser_window_gtk.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/gtk/location_bar_view_gtk.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/location_bar/location_bar_view.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/webui/ntp/app_launcher_handler.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/ntp/app_launcher_handler.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/options/startup_pages_handler.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/zoom/zoom_controller.cc View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
Jói
mnissler: prefs OWNER, please review with a focus on the API that I extracted. Can ...
8 years, 4 months ago (2012-08-16 14:26:02 UTC) #1
erikwright (departed)
http://codereview.chromium.org/10828345/diff/1/chrome/browser/api/prefs/pref_service_base.h File chrome/browser/api/prefs/pref_service_base.h (right): http://codereview.chromium.org/10828345/diff/1/chrome/browser/api/prefs/pref_service_base.h#newcode35 chrome/browser/api/prefs/pref_service_base.h:35: // Retrieves a PrefServiceBase for the given profile. I'm ...
8 years, 4 months ago (2012-08-16 15:12:40 UTC) #2
Mattias Nissler (ping if slow)
http://codereview.chromium.org/10828345/diff/1/chrome/browser/api/prefs/pref_member.cc File chrome/browser/api/prefs/pref_member.cc (right): http://codereview.chromium.org/10828345/diff/1/chrome/browser/api/prefs/pref_member.cc#newcode38 chrome/browser/api/prefs/pref_member.cc:38: DCHECK(prefs_->GetUserPrefValue(pref_name_.c_str())) Wait, what's this? This is incorrect. http://codereview.chromium.org/10828345/diff/1/chrome/browser/api/prefs/pref_member.cc#newcode75 chrome/browser/api/prefs/pref_member.cc:75: ...
8 years, 4 months ago (2012-08-16 15:16:42 UTC) #3
Jói
http://codereview.chromium.org/10828345/diff/1/chrome/browser/api/prefs/pref_member.cc File chrome/browser/api/prefs/pref_member.cc (right): http://codereview.chromium.org/10828345/diff/1/chrome/browser/api/prefs/pref_member.cc#newcode38 chrome/browser/api/prefs/pref_member.cc:38: DCHECK(prefs_->GetUserPrefValue(pref_name_.c_str())) On 2012/08/16 15:16:42, Mattias Nissler wrote: > Wait, ...
8 years, 4 months ago (2012-08-16 15:34:17 UTC) #4
Jói
Will wait to upload a new patch until I hear back from Mattias and implement ...
8 years, 4 months ago (2012-08-16 15:35:56 UTC) #5
Jói
As a side note, I'm happy to report that the trybots also caught the issue ...
8 years, 4 months ago (2012-08-16 15:38:09 UTC) #6
erikwright (departed)
Having a 'ForProfile' that is meant to be satisfied by the implementation at link-time is ...
8 years, 4 months ago (2012-08-16 15:55:47 UTC) #7
Jói
Having a way to access an X for a Y that the implementation can fill ...
8 years, 4 months ago (2012-08-16 16:40:48 UTC) #8
Jói
I meant to highlight that there is a similar thing in http://codereview.chromium.org/10830353/, which I am ...
8 years, 4 months ago (2012-08-16 16:43:10 UTC) #9
Mattias Nissler (ping if slow)
http://codereview.chromium.org/10828345/diff/1/chrome/browser/api/prefs/pref_member.cc File chrome/browser/api/prefs/pref_member.cc (right): http://codereview.chromium.org/10828345/diff/1/chrome/browser/api/prefs/pref_member.cc#newcode75 chrome/browser/api/prefs/pref_member.cc:75: prefs_->GetUserPrefValue(pref_name_.c_str())->DeepCopy(), On 2012/08/16 15:34:18, Jói wrote: > On 2012/08/16 ...
8 years, 4 months ago (2012-08-16 16:48:33 UTC) #10
Jói
> You could indeed make a GetValue() function on PrefService (it's OK to expose > ...
8 years, 4 months ago (2012-08-16 16:59:17 UTC) #11
Mattias Nissler (ping if slow)
On Thu, Aug 16, 2012 at 6:59 PM, <[email protected]> wrote: > You could indeed make ...
8 years, 4 months ago (2012-08-16 18:08:10 UTC) #12
Bernhard Bauer
I also that feel PrefService::Preference is a part of the API, and the methods in ...
8 years, 4 months ago (2012-08-16 18:47:59 UTC) #13
Jói
Thanks for the feedback, Bernhard and Mattias. From the quick look I took earlier today, ...
8 years, 4 months ago (2012-08-16 22:23:58 UTC) #14
Mattias Nissler (ping if slow)
On Fri, Aug 17, 2012 at 12:23 AM, Jói Sigurðsson <[email protected]> wrote: > Thanks for ...
8 years, 4 months ago (2012-08-17 08:14:24 UTC) #15
Jói
Cool, thanks Mattias. I can take a stab at a new version of the API ...
8 years, 4 months ago (2012-08-17 13:33:08 UTC) #16
Jói
Erik and I had a discussion on using dependency injection vs. using the X::ForY() approach ...
8 years, 4 months ago (2012-08-17 15:24:06 UTC) #17
Jói
Mattias: Patchset 2 adds the Preference class and the FindPreference method to the API, in ...
8 years, 4 months ago (2012-08-17 17:03:10 UTC) #18
Mattias Nissler (ping if slow)
The API looks sane to me, so you have my LGTM for chrome/browser/{prefs,policy}. Regarding the ...
8 years, 4 months ago (2012-08-17 17:21:52 UTC) #19
Jói
Right, that would be another way. You could fully decouple the registration interfaces from the ...
8 years, 4 months ago (2012-08-17 17:26:07 UTC) #20
erikwright (departed)
LGTM.
8 years, 4 months ago (2012-08-20 05:32:15 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/10828345/11004
8 years, 4 months ago (2012-08-21 12:06:11 UTC) #22
commit-bot: I haz the power
Change committed as 152569
8 years, 4 months ago (2012-08-21 16:28:23 UTC) #23
battre
On 2012/08/21 16:28:23, I haz the power (commit-bot) wrote: > Change committed as 152569 I ...
8 years, 2 months ago (2012-10-15 12:44:37 UTC) #24
tfarina
On Mon, Oct 15, 2012 at 9:44 AM, <[email protected]> wrote: > On 2012/08/21 16:28:23, I ...
8 years, 2 months ago (2012-10-15 12:46:59 UTC) #25
Jói
8 years, 2 months ago (2012-10-15 13:01:12 UTC) #26
We are moving Prefs out of Chrome and PrefServiceBase will likely go
away after the move is complete.  I am looping you into the thread
that's been going on with mnissler@ and bauerb@ about that.

As part of those changes, the plan is to look at splitting off the
sync part of PrefService.

The reasons a rename wasn't done at the time were:
a) It wasn't clear whether we would change all code to use the API,
especially in the short term;
b) If not all code would switch to the API, I wasn't sure whether it
was good to make most Chrome developers learn a new name
(PrefServiceImpl);
c) Part of the reason was simply wanting to defer large-scale renames
until upstreaming (Clank & Bling) was further along.

The idea was that the rename could be done at any time and would be
done once it was clear that the top class would better be named
PrefService, rather than e.g. PrefServiceBase or PrefServiceAPI.
Anyway, at this point it is moot.

Cheers,
Jói



On Mon, Oct 15, 2012 at 12:46 PM, Thiago Farina <[email protected]> wrote:
> On Mon, Oct 15, 2012 at 9:44 AM,  <[email protected]> wrote:
>> On 2012/08/21 16:28:23, I haz the power (commit-bot) wrote:
>>>
>>> Change committed as 152569
>>
>>
>> I have seen this CL from a long, long time ago. Shouldn't we rename
>> PrefServiceBase to PrefService and the current PrefService to
>> PrefServiceImpl?
>>
> Yeah, I suggested that when the patch came in.
>
> I don't recall what was Joi's justification to go with PrefServiceBase
though.
>
> --
> Thiago

Powered by Google App Engine
This is Rietveld 408576698