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

Issue 2463113002: Let AutoplayUmaHelper listen to visibilitychange instead of unload (Closed)

Created:
4 years, 1 month ago by Zhiqiang Zhang (Slow)
Modified:
4 years ago
CC:
blink-reviews, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Let AutoplayUmaHelper listen to visibilitychange instead of unload Using window unload listeners is both unreliable and slowing natigating away. This CL switches the AutoplayUmaHelper to use the page visibility API instead of listening to window unload event. BUG=653473 Committed: https://crrev.com/a93cc968201804405f261ece6fee30b660255ec2 Cr-Commit-Position: refs/heads/master@{#434272}

Patch Set 1 #

Total comments: 2

Patch Set 2 : nit #

Patch Set 3 : added test #

Patch Set 4 : ContextLifecycleObserver #

Total comments: 2

Patch Set 5 : nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+115 lines, -31 lines) Patch
M third_party/WebKit/Source/core/BUILD.gn View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/AutoplayUmaHelper.h View 1 2 3 5 chunks +13 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp View 1 2 3 4 9 chunks +18 lines, -24 lines 0 comments Download
A third_party/WebKit/Source/core/html/AutoplayUmaHelperTest.cpp View 1 2 3 1 chunk +81 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLMediaElement.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/OWNERS View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 22 (8 generated)
Zhiqiang Zhang (Slow)
4 years, 1 month ago (2016-10-31 16:26:28 UTC) #3
mlamouri (slow - plz ping)
Do we have a test for this? I guess we might not have a LayoutTest ...
4 years, 1 month ago (2016-10-31 16:33:31 UTC) #5
Zhiqiang Zhang (Slow)
> Do we have a test for this? I guess we might not have a ...
4 years, 1 month ago (2016-10-31 16:48:54 UTC) #6
mlamouri (slow - plz ping)
LayoutTests would be hard but can't you add unit tests?
4 years, 1 month ago (2016-10-31 16:50:00 UTC) #7
Zhiqiang Zhang (Slow)
PTAL On 2016/10/31 16:50:00, mlamouri wrote: > LayoutTests would be hard but can't you add ...
4 years, 1 month ago (2016-11-01 16:02:32 UTC) #8
mlamouri (slow - plz ping)
As discussed offline, maybe we should switch to use the ContextLifecycleObserver.
4 years, 1 month ago (2016-11-03 15:52:40 UTC) #9
Zhiqiang Zhang (Slow)
PTAL (not urgent) Using ContextLifecycleObserver now :)
4 years, 1 month ago (2016-11-04 17:29:09 UTC) #10
mlamouri (slow - plz ping)
lgtm https://codereview.chromium.org/2463113002/diff/60001/third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp File third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp (right): https://codereview.chromium.org/2463113002/diff/60001/third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp#newcode167 third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp:167: setContext(nullptr); I don't think you need this.
4 years, 1 month ago (2016-11-04 18:16:49 UTC) #11
Zhiqiang Zhang (Slow)
+ojan for general review and approval https://codereview.chromium.org/2463113002/diff/60001/third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp File third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp (right): https://codereview.chromium.org/2463113002/diff/60001/third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp#newcode167 third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp:167: setContext(nullptr); On 2016/11/04 ...
4 years, 1 month ago (2016-11-04 20:29:33 UTC) #13
mlamouri (slow - plz ping)
ojan@ PTAL? :)
4 years, 1 month ago (2016-11-18 14:21:53 UTC) #14
ojan
lgtm Thanks for fixing this. Sorry for the review delay. Please nag me earlier in ...
4 years ago (2016-11-23 19:00:37 UTC) #16
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/2463113002/80001
4 years ago (2016-11-23 19:01:12 UTC) #18
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years ago (2016-11-23 22:53:25 UTC) #20
commit-bot: I haz the power
4 years ago (2016-11-23 22:57:01 UTC) #22
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/a93cc968201804405f261ece6fee30b660255ec2
Cr-Commit-Position: refs/heads/master@{#434272}

Powered by Google App Engine
This is Rietveld 408576698