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

Issue 14895016: Make ThemeService use the ExtensionSystem's AsyncEvent (Closed)

Created:
7 years, 7 months ago by Jeffrey Yasskin
Modified:
7 years, 2 months ago
Reviewers:
pkotwicz
CC:
chromium-reviews, not at google - send to devlin
Visibility:
Public.

Description

Make ThemeService use the ExtensionSystem's AsyncEvent instead of the READY notification. BUG=240968

Patch Set 1 #

Patch Set 2 : s/RunAfter/ThenRun/ #

Total comments: 2

Patch Set 3 : s/ThenRun/Post/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -37 lines) Patch
M chrome/browser/themes/theme_service.h View 5 chunks +4 lines, -9 lines 0 comments Download
M chrome/browser/themes/theme_service.cc View 1 2 5 chunks +15 lines, -28 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Jeffrey Yasskin
This depends on https://codereview.chromium.org/14757022/, but I think that's stable enough that it's worth you reviewing ...
7 years, 7 months ago (2013-05-15 23:30:14 UTC) #1
pkotwicz
https://codereview.chromium.org/14895016/diff/2001/chrome/browser/themes/theme_service.cc File chrome/browser/themes/theme_service.cc (right): https://codereview.chromium.org/14895016/diff/2001/chrome/browser/themes/theme_service.cc#newcode348 chrome/browser/themes/theme_service.cc:348: NotifyThemeChanged(); Delaying when we call NotifyThemeChanged() gives a lot ...
7 years, 7 months ago (2013-05-16 18:18:35 UTC) #2
Jeffrey Yasskin
Thanks for taking a look. https://codereview.chromium.org/14895016/diff/2001/chrome/browser/themes/theme_service.cc File chrome/browser/themes/theme_service.cc (right): https://codereview.chromium.org/14895016/diff/2001/chrome/browser/themes/theme_service.cc#newcode348 chrome/browser/themes/theme_service.cc:348: NotifyThemeChanged(); On 2013/05/16 18:18:35, ...
7 years, 7 months ago (2013-05-16 23:28:18 UTC) #3
pkotwicz
7 years, 7 months ago (2013-05-21 19:13:03 UTC) #4
The path that you are modifying runs on average once per stable release. (It is
controlled by the value of kThemePackVersion changing.)

ExtensionService is never ready when ThemeService is constructed. The theme
service is created right when the profile is created.
From doing some digging, delaying NotifyThemeChanged() results in
NotifyThemeChanged() taking ~100ms more on Windows. This seems to be mostly due
to a really expensive call to SetWindowRgn().

A couple options:
- Do some more digging and decide that the runtime change in
NotifyThemeChanged() is not important. (And double check that my measurements
are correct) It may not be important. I am not well acquainted with windows
native calls.
- Move the handling which currently occurs as a result of
NOTIFICATION_EXTENSIONS_READY to occur as a result of
NOTIFICATION_EXTENSION_LOADED instead.

Note: Somewhat related to this, ExtensionService currently depends on
ThemeService which it should not. For instance,
ExtensionService::GarbageCollectExtensions calls into the ThemeService. Fixing
this should be simple.

Powered by Google App Engine
This is Rietveld 408576698