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

Issue 878363002: Watch the preferences for changes per profile instead of per tab. (Closed)

Created:
5 years, 10 months ago by jam
Modified:
5 years, 10 months ago
Reviewers:
Bernhard Bauer, brettw
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Watch the preferences for changes per profile instead of per tab. PrefsTabHelper was watching > 1K prefs so that it could update the renderer side data structures when they change. When session restore was used and it had 50 tabs, this would take almost a second on a Z620. Switch this to watching these prefs once per profile instead. BUG=452693 Committed: https://crrev.com/d9bb3b780aad1d1672b6574069ae8fab35319bc7 Cr-Commit-Position: refs/heads/master@{#313573}

Patch Set 1 #

Total comments: 8

Patch Set 2 : review nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+124 lines, -32 lines) Patch
M chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/ui/prefs/prefs_tab_helper.h View 4 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/ui/prefs/prefs_tab_helper.cc View 1 10 chunks +119 lines, -28 lines 0 comments Download

Messages

Total messages: 12 (4 generated)
jam
5 years, 10 months ago (2015-01-28 05:32:43 UTC) #2
jam
5 years, 10 months ago (2015-01-28 17:32:21 UTC) #4
brettw
lgtm https://codereview.chromium.org/878363002/diff/1/chrome/browser/ui/prefs/prefs_tab_helper.cc File chrome/browser/ui/prefs/prefs_tab_helper.cc (right): https://codereview.chromium.org/878363002/diff/1/chrome/browser/ui/prefs/prefs_tab_helper.cc#newcode403 chrome/browser/ui/prefs/prefs_tab_helper.cc:403: for (auto it = helpers_.begin(); it != helpers_.end(); ...
5 years, 10 months ago (2015-01-28 19:13:29 UTC) #5
jam
https://codereview.chromium.org/878363002/diff/1/chrome/browser/ui/prefs/prefs_tab_helper.cc File chrome/browser/ui/prefs/prefs_tab_helper.cc (right): https://codereview.chromium.org/878363002/diff/1/chrome/browser/ui/prefs/prefs_tab_helper.cc#newcode403 chrome/browser/ui/prefs/prefs_tab_helper.cc:403: for (auto it = helpers_.begin(); it != helpers_.end(); ++it) ...
5 years, 10 months ago (2015-01-28 19:29:11 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/878363002/20001
5 years, 10 months ago (2015-01-28 19:30:04 UTC) #8
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 10 months ago (2015-01-28 20:32:48 UTC) #9
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/d9bb3b780aad1d1672b6574069ae8fab35319bc7 Cr-Commit-Position: refs/heads/master@{#313573}
5 years, 10 months ago (2015-01-28 20:34:27 UTC) #10
Bernhard Bauer
5 years, 10 months ago (2015-01-28 23:35:53 UTC) #12
Message was sent while issue was closed.
FTR, I was OOO today, so I couldn't do the whole review, but in general I'm
available over chat if I'm not responding to reviews.

https://codereview.chromium.org/878363002/diff/1/chrome/browser/profiles/chro...
File chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
(right):

https://codereview.chromium.org/878363002/diff/1/chrome/browser/profiles/chro...
chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc:237:
PrefsTabHelper::GetServiceInstance();
This isn't quite idiomatic; usually we expose the factory and call GetInstance()
directly. I'm personally not opposed to not exposing the factory, but seeing
this as it is right now still makes me do a double-take. Could we name the
method something like EnsureKeyedServiceInstanceCreated()? That way we
explicitly mention a KeyedService (as opposed to a generic "service", which
could be a lot of things), and if this method doesn't actually return anything,
naming it Get... is a bit weird.

https://codereview.chromium.org/878363002/diff/1/chrome/browser/ui/prefs/pref...
File chrome/browser/ui/prefs/prefs_tab_helper.cc (right):

https://codereview.chromium.org/878363002/diff/1/chrome/browser/ui/prefs/pref...
chrome/browser/ui/prefs/prefs_tab_helper.cc:340: // http://crbug.com/452693
Nit: I don't think we even need to mention the bug here. The comment already
does a good job of explaining the rationale behind this class, and in the long
term, historic context is not going to be very relevant.

https://codereview.chromium.org/878363002/diff/1/chrome/browser/ui/prefs/pref...
chrome/browser/ui/prefs/prefs_tab_helper.cc:431: PrefWatcherFactory() :
BrowserContextKeyedServiceFactory(
This looks somewhat weirdly formatted. Does breaking before the colon work?

https://codereview.chromium.org/878363002/diff/1/chrome/browser/ui/prefs/pref...
File chrome/browser/ui/prefs/prefs_tab_helper.h (right):

https://codereview.chromium.org/878363002/diff/1/chrome/browser/ui/prefs/pref...
chrome/browser/ui/prefs/prefs_tab_helper.h:45: friend class PrefWatcher;
Can we move PrefWatcher into this class? Then we wouldn't need to friend it, and
we would avoid potential naming collisions due to PrefWatcher being in the
global namespace.

Powered by Google App Engine
This is Rietveld 408576698