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

Issue 1911273002: Don't restart the ImageQualityController timer unless it is already half over. (Closed)

Created:
4 years, 8 months ago by chrishtr
Modified:
4 years, 8 months ago
Reviewers:
esprehn, Xianzhu
CC:
darktears, blink-reviews, blink-reviews-animation_chromium.org, blink-reviews-api_chromium.org, blink-reviews-layout_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, Eric Willigers, jchaffraix+rendering, kinuko+watch, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, rjwright, shans, szager+layoutwatch_chromium.org, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Don't restart the ImageQualityController timer unless it is already half over. Restarting the timer every time an image continues to animate is very expensive, because there is no way to actuually cancel the existing timer. Instead, the timer is neutered, so that when it fires it will do nothing. This results in a flood of no-op timer callbacks in the referenced bug scenario. Instead, only restart the timer if the current frame time is more than half of the timer time later than the frame time at the start of the timer. To accomplish that, record the current frame time in WebViewImpl, so that it can be compared with a future frame time. We do this plumbing to avoid making lots of calls to query the system time, which is expensive. The compositor has a similar optimization; see https://code.google.com/p/chromium/codesearch#chromium/src/cc/layers/picture_layer_impl.cc&sq=package:chromium&l=452 for example. BUG=605701 Committed: https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40 Cr-Commit-Position: refs/heads/master@{#389394}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Total comments: 5

Patch Set 8 : #

Patch Set 9 : #

Patch Set 10 : #

Patch Set 11 : #

Patch Set 12 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+110 lines, -11 lines) Patch
M third_party/WebKit/Source/core/layout/ImageQualityController.h View 1 2 3 4 5 6 7 8 9 2 chunks +7 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ImageQualityController.cpp View 1 2 3 4 5 6 7 6 chunks +16 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +69 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/page/ChromeClient.h View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/ChromeClientImpl.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/ChromeClientImpl.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.h View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/public/web/WebWidget.h View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 37 (21 generated)
chrishtr
4 years, 8 months ago (2016-04-22 18:01:01 UTC) #11
Xianzhu
https://codereview.chromium.org/1911273002/diff/120001/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp File third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp (right): https://codereview.chromium.org/1911273002/diff/120001/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp#newcode125 third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp:125: void startOneShot(double interval, const WebTraceLocation& caller) override Can you ...
4 years, 8 months ago (2016-04-22 18:15:00 UTC) #12
chrishtr
https://codereview.chromium.org/1911273002/diff/120001/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp File third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp (right): https://codereview.chromium.org/1911273002/diff/120001/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp#newcode125 third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp:125: void startOneShot(double interval, const WebTraceLocation& caller) override On 2016/04/22 ...
4 years, 8 months ago (2016-04-22 18:30:35 UTC) #13
Xianzhu
https://codereview.chromium.org/1911273002/diff/120001/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp File third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp (right): https://codereview.chromium.org/1911273002/diff/120001/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp#newcode115 third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp:115: , started(false) Nit: Indent 4 more spaces. https://codereview.chromium.org/1911273002/diff/120001/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp#newcode125 third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp:125: ...
4 years, 8 months ago (2016-04-22 19:39:17 UTC) #14
Xianzhu
https://codereview.chromium.org/1911273002/diff/120001/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp File third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp (right): https://codereview.chromium.org/1911273002/diff/120001/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp#newcode125 third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp:125: void startOneShot(double interval, const WebTraceLocation& caller) override On 2016/04/22 ...
4 years, 8 months ago (2016-04-22 19:49:51 UTC) #15
chrishtr
On 2016/04/22 at 19:49:51, wangxianzhu wrote: > https://codereview.chromium.org/1911273002/diff/120001/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp > File third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp (right): > > https://codereview.chromium.org/1911273002/diff/120001/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp#newcode125 ...
4 years, 8 months ago (2016-04-22 20:28:51 UTC) #16
Xianzhu
lgtm
4 years, 8 months ago (2016-04-22 20:38:29 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1911273002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1911273002/160001
4 years, 8 months ago (2016-04-22 20:45:28 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/150750)
4 years, 8 months ago (2016-04-22 22:13:04 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1911273002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1911273002/180001
4 years, 8 months ago (2016-04-22 22:37:50 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/150897)
4 years, 8 months ago (2016-04-23 00:14:24 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1911273002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1911273002/200001
4 years, 8 months ago (2016-04-23 04:13:27 UTC) #29
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/150998)
4 years, 8 months ago (2016-04-23 05:50:33 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1911273002/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1911273002/220001
4 years, 8 months ago (2016-04-23 22:51:49 UTC) #34
commit-bot: I haz the power
Committed patchset #12 (id:220001)
4 years, 8 months ago (2016-04-24 00:02:44 UTC) #35
commit-bot: I haz the power
4 years, 8 months ago (2016-04-24 00:04:28 UTC) #37
Message was sent while issue was closed.
Patchset 12 (id:??) landed as
https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40
Cr-Commit-Position: refs/heads/master@{#389394}

Powered by Google App Engine
This is Rietveld 408576698