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

Issue 2615993002: Remove unnecessary spin in ToolTipController (Closed)

Created:
3 years, 11 months ago by chengx
Modified:
3 years, 11 months ago
Reviewers:
sky, brucedawson
CC:
chromium-reviews, tfarina
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove unnecessary spin in ToolTipController The motivation for the change is to reduce idle wakeups and therefore reduce idle power. ToolTipController has a repeating 500ms timer that tries to update itself periodically, while most of the time there is no change at all. This CL removes this spin but keeps the same functionality by 1) upgrading OnMouseEvent() in TooltipController; 2) overriding OnWindowPropertyChanged() in TooltipController; 3) overriding OnCursorVisibilityChanged() in TooltipController. After the change, tooltip is updated on demand via observer pattern, rather than unnecessary periodic checking. BUG=668198 Review-Url: https://codereview.chromium.org/2615993002 Cr-Commit-Position: refs/heads/master@{#443584} Committed: https://chromium.googlesource.com/chromium/src/+/6b8312a4903fc6965a64a3835524f1a8f384f26b

Patch Set 1 #

Patch Set 2 : Make according changes in /ash/tooltips/ #

Patch Set 3 : Fix unit tests #

Total comments: 5

Patch Set 4 : Update comments in unit tests. #

Patch Set 5 : Override OnWindowPropertyChanged() for auto update when mouse visibility state is changed. #

Patch Set 6 : Override OnCursorVisibilityChanged() for auto tooltip update. #

Total comments: 8

Patch Set 7 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+67 lines, -123 lines) Patch
M ash/tooltips/tooltip_controller_unittest.cc View 1 2 3 4 5 3 chunks +8 lines, -9 lines 0 comments Download
M ui/views/corewm/tooltip_controller.h View 1 2 3 4 5 4 chunks +12 lines, -6 lines 0 comments Download
M ui/views/corewm/tooltip_controller.cc View 1 2 3 4 5 6 9 chunks +21 lines, -39 lines 0 comments Download
M ui/views/corewm/tooltip_controller_test_helper.h View 1 chunk +1 line, -2 lines 0 comments Download
M ui/views/corewm/tooltip_controller_test_helper.cc View 1 chunk +2 lines, -6 lines 0 comments Download
M ui/views/corewm/tooltip_controller_unittest.cc View 1 2 3 4 5 6 25 chunks +13 lines, -54 lines 0 comments Download
M ui/wm/public/tooltip_client.h View 1 2 3 4 2 chunks +5 lines, -0 lines 0 comments Download
M ui/wm/public/tooltip_client.cc View 1 2 3 4 5 6 1 chunk +5 lines, -7 lines 0 comments Download

Messages

Total messages: 132 (114 generated)
chengx
PTAL~
3 years, 11 months ago (2017-01-06 02:45:32 UTC) #26
brucedawson
I'm not at all expert in this area, but I wonder if the repeating timer ...
3 years, 11 months ago (2017-01-06 20:37:28 UTC) #27
brucedawson
Maybe mention the motivation for the change which is to reduce idle wakeups and therefore ...
3 years, 11 months ago (2017-01-06 20:45:23 UTC) #28
chengx
sky@, PTAL~ For the repeating timer in the ToolTipController, I cannot think of a reason ...
3 years, 11 months ago (2017-01-06 20:58:19 UTC) #30
chengx
brucedawson@, comments updated. https://codereview.chromium.org/2615993002/diff/100001/ash/tooltips/tooltip_controller_unittest.cc File ash/tooltips/tooltip_controller_unittest.cc (right): https://codereview.chromium.org/2615993002/diff/100001/ash/tooltips/tooltip_controller_unittest.cc#newcode112 ash/tooltips/tooltip_controller_unittest.cc:112: // Fire tooltip timer so tooltip ...
3 years, 11 months ago (2017-01-06 23:08:31 UTC) #36
sky
On 2017/01/06 20:58:19, chengx wrote: > sky@, PTAL~ > > For the repeating timer in ...
3 years, 11 months ago (2017-01-06 23:36:29 UTC) #37
sky
On 2017/01/06 23:36:29, sky wrote: > On 2017/01/06 20:58:19, chengx wrote: > > sky@, PTAL~ ...
3 years, 11 months ago (2017-01-07 00:03:43 UTC) #38
chengx
> > It's necessary to pick up changes to the tooltip text, and it looks ...
3 years, 11 months ago (2017-01-07 01:41:54 UTC) #39
sky
I think you're asking me to debug how it works. You'll have to investigate that. ...
3 years, 11 months ago (2017-01-09 16:14:56 UTC) #40
chengx
sky@, PTAL~ I have investigated all the related code and updated this CL. I overrode ...
3 years, 11 months ago (2017-01-12 00:02:06 UTC) #108
sky
As you asked, can you outline how the renderer was working in the past? What ...
3 years, 11 months ago (2017-01-12 16:18:29 UTC) #113
chengx
On 2017/01/12 16:18:29, sky wrote: > As you asked, can you outline how the renderer ...
3 years, 11 months ago (2017-01-12 19:07:07 UTC) #114
sky
https://codereview.chromium.org/2615993002/diff/460001/ui/views/corewm/tooltip_controller.cc File ui/views/corewm/tooltip_controller.cc (right): https://codereview.chromium.org/2615993002/diff/460001/ui/views/corewm/tooltip_controller.cc#newcode199 ui/views/corewm/tooltip_controller.cc:199: (tooltip_window_ && How come you are adding this condition? ...
3 years, 11 months ago (2017-01-12 20:15:18 UTC) #115
chengx
Hi sky@, I have addressed your comments in the new patch. PTAL~ Thanks! https://codereview.chromium.org/2615993002/diff/460001/ui/views/corewm/tooltip_controller.cc File ...
3 years, 11 months ago (2017-01-13 01:17:51 UTC) #123
sky
LGTM - nice fix!
3 years, 11 months ago (2017-01-13 15:20:48 UTC) #126
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2615993002/520001
3 years, 11 months ago (2017-01-13 16:51:01 UTC) #128
commit-bot: I haz the power
Committed patchset #7 (id:520001) as https://chromium.googlesource.com/chromium/src/+/6b8312a4903fc6965a64a3835524f1a8f384f26b
3 years, 11 months ago (2017-01-13 16:57:23 UTC) #131
chengx
3 years, 11 months ago (2017-01-18 22:50:40 UTC) #132
Message was sent while issue was closed.
A revert of this CL (patchset #7 id:520001) has been created in
https://codereview.chromium.org/2643973002/ by chengx@chromium.org.

The reason for reverting is: Caused the regression 682141..

Powered by Google App Engine
This is Rietveld 408576698