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

Issue 1576283003: Have HTMLMediaElement::play() return a Promise. (Closed)

Created:
4 years, 11 months ago by mlamouri (slow - plz ping)
Modified:
4 years, 10 months ago
Reviewers:
hiroshige, philipj_slow
CC:
blink-reviews, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink, eric.carlson_apple.com, feature-media-reviews_chromium.org, fs, gasubic, nessy, vcarbune.chromium
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Have HTMLMediaElement::play() return a Promise. This is implementing the following proposal that was recently added to the spec: https://github.com/whatwg/html/issues/505 Intent to implement and ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/bvs8ledF4tU/qC__g3yICAAJ This is also adding a new exception type called NotAllowedError. BUG=579541 Committed: https://crrev.com/dd99205e1045321b1812f64c5838e641cda7a2e9 Cr-Commit-Position: refs/heads/master@{#377608}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : WIP #

Patch Set 4 : oupsy tests #

Patch Set 5 : tests #

Patch Set 6 : #

Total comments: 45

Patch Set 7 : review comments #

Total comments: 7

Patch Set 8 : review comments #

Total comments: 2

Patch Set 9 : hiroshige comments #

Total comments: 69

Patch Set 10 : review comments #

Total comments: 14

Patch Set 11 : review comments and cancel tasks #

Total comments: 1

Patch Set 12 : update layout tests #

Total comments: 11

Patch Set 13 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+766 lines, -24 lines) Patch
M third_party/WebKit/LayoutTests/media/W3C/audio/events/event_pause_manual-expected.txt View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/media/W3C/audio/events/event_play_manual-expected.txt View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/media/W3C/audio/paused/paused_true_during_pause-expected.txt View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/media/W3C/video/events/event_pause_manual-expected.txt View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/media/W3C/video/events/event_play_manual-expected.txt View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/media/W3C/video/paused/paused_true_during_pause-expected.txt View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/media/media-play-promise.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +414 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/media/media-play-promise-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +171 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/media/track/track-cues-pause-on-exit-expected.txt View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/media/video-autoplay-experiment-modes-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/media/video-controls-overlay-play-button-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/media/video-display-none-crash-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/media/video-play-pause-events-expected.txt View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/media/video-play-require-user-gesture-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/media/video-played-collapse-expected.txt View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/media/video-played-ranges-1-expected.txt View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/media/video-preload-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/DOMException.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/ExceptionCode.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLMediaElement.h View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +20 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLMediaElement.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 15 chunks +125 lines, -20 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLMediaElement.idl View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 51 (16 generated)
mlamouri (slow - plz ping)
Philip, PTAL.
4 years, 10 months ago (2016-02-01 18:57:05 UTC) #5
philipj_slow
OK, took a first pass. It took a while, so I've only skimmed the new ...
4 years, 10 months ago (2016-02-02 09:56:34 UTC) #6
DaleCurtis
Haven't reviewed, but do we want to take this opportunity to only return the promise ...
4 years, 10 months ago (2016-02-02 19:53:02 UTC) #8
philipj_slow
On 2016/02/02 19:53:02, DaleCurtis wrote: > Haven't reviewed, but do we want to take this ...
4 years, 10 months ago (2016-02-03 04:16:33 UTC) #9
mlamouri (slow - plz ping)
Comments applied. PTAL. Note that I will be a bit slow to answer comments for ...
4 years, 10 months ago (2016-02-03 19:28:58 UTC) #10
DaleCurtis
On 2016/02/03 at 04:16:33, philipj wrote: > On 2016/02/02 19:53:02, DaleCurtis wrote: > > Haven't ...
4 years, 10 months ago (2016-02-03 23:58:06 UTC) #11
philipj_slow
On 2016/02/03 23:58:06, DaleCurtis wrote: > On 2016/02/03 at 04:16:33, philipj wrote: > > On ...
4 years, 10 months ago (2016-02-04 09:57:20 UTC) #12
philipj_slow
(Off-topic: More generally, I think that the WebMediaPlayerClient interface knows more about HTMLMediaElement concepts that ...
4 years, 10 months ago (2016-02-04 10:04:28 UTC) #13
philipj_slow
https://codereview.chromium.org/1576283003/diff/100001/third_party/WebKit/LayoutTests/media/media-play-promise.html File third_party/WebKit/LayoutTests/media/media-play-promise.html (right): https://codereview.chromium.org/1576283003/diff/100001/third_party/WebKit/LayoutTests/media/media-play-promise.html#newcode42 third_party/WebKit/LayoutTests/media/media-play-promise.html:42: function playWithUserGesture() On 2016/02/03 19:28:57, Mounir Lamouri (slow) wrote: ...
4 years, 10 months ago (2016-02-04 10:54:20 UTC) #14
DaleCurtis
On 2016/02/04 at 09:57:20, philipj wrote: > > What I mean by "track individual play/pause ...
4 years, 10 months ago (2016-02-04 19:36:32 UTC) #15
philipj_slow
On 2016/02/04 19:36:32, DaleCurtis wrote: > On 2016/02/04 at 09:57:20, philipj wrote: > > > ...
4 years, 10 months ago (2016-02-05 11:22:14 UTC) #16
mlamouri (slow - plz ping)
philipj@, PTAL. All comments should be resolved. hiroshige@, could you PTAL at the usage of ...
4 years, 10 months ago (2016-02-18 17:06:07 UTC) #18
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1576283003/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1576283003/140001
4 years, 10 months ago (2016-02-18 17:07:53 UTC) #20
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/183076)
4 years, 10 months ago (2016-02-18 18:25:06 UTC) #22
hiroshige
https://codereview.chromium.org/1576283003/diff/140001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/1576283003/diff/140001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp#newcode3616 third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:3616: BLINK_FROM_HERE, new Task(threadSafeBind(&HTMLMediaElement::resolvePlayPromises, AllowCrossThreadAccess(this)))); > at the usage of ...
4 years, 10 months ago (2016-02-18 18:32:42 UTC) #23
DaleCurtis
As discussed via chat, the delegate does indeed notify right away. I was more just ...
4 years, 10 months ago (2016-02-18 19:03:35 UTC) #24
mlamouri (slow - plz ping)
hiroshige@, PTAL. Regarding the real play callback, I think this should be in a follow-up. ...
4 years, 10 months ago (2016-02-18 19:24:42 UTC) #25
philipj_slow
https://codereview.chromium.org/1576283003/diff/120001/third_party/WebKit/Source/core/html/HTMLMediaElement.h File third_party/WebKit/Source/core/html/HTMLMediaElement.h (right): https://codereview.chromium.org/1576283003/diff/120001/third_party/WebKit/Source/core/html/HTMLMediaElement.h#newcode55 third_party/WebKit/Source/core/html/HTMLMediaElement.h:55: class MediaError; On 2016/02/18 17:06:06, Mounir Lamouri (slow) wrote: ...
4 years, 10 months ago (2016-02-19 07:32:48 UTC) #26
philipj_slow
Recent code changes look good, see comments. Looks like the potential crash also was resolved. ...
4 years, 10 months ago (2016-02-19 08:21:48 UTC) #27
philipj_slow
Spent some quality time on the tests. In addition to addressing issues, can you also ...
4 years, 10 months ago (2016-02-22 06:34:25 UTC) #29
hiroshige
https://codereview.chromium.org/1576283003/diff/160001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/1576283003/diff/160001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp#newcode75 third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:75: #include "platform/Task.h" We can remove this #include if we ...
4 years, 10 months ago (2016-02-22 17:43:10 UTC) #30
mlamouri (slow - plz ping)
Comments applied. PTAL. https://codereview.chromium.org/1576283003/diff/160001/third_party/WebKit/LayoutTests/media/media-play-promise.html File third_party/WebKit/LayoutTests/media/media-play-promise.html (right): https://codereview.chromium.org/1576283003/diff/160001/third_party/WebKit/LayoutTests/media/media-play-promise.html#newcode4 third_party/WebKit/LayoutTests/media/media-play-promise.html:4: <script src=video-test.js></script> On 2016/02/22 at 06:34:24, ...
4 years, 10 months ago (2016-02-23 16:49:01 UTC) #31
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1576283003/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1576283003/180001
4 years, 10 months ago (2016-02-23 16:50:16 UTC) #33
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/185406) win_chromium_rel_ng on ...
4 years, 10 months ago (2016-02-23 18:52:55 UTC) #35
philipj_slow
LGTM, but playRaceWithSrcChangeError() needs some investigation. Hopefully it's just me being wrong again :) https://codereview.chromium.org/1576283003/diff/160001/third_party/WebKit/LayoutTests/media/media-play-promise.html ...
4 years, 10 months ago (2016-02-24 09:38:28 UTC) #36
hiroshige
lgtm for bind() usage.
4 years, 10 months ago (2016-02-24 17:55:40 UTC) #37
mlamouri (slow - plz ping)
PTAL. https://codereview.chromium.org/1576283003/diff/160001/third_party/WebKit/LayoutTests/media/media-play-promise.html File third_party/WebKit/LayoutTests/media/media-play-promise.html (right): https://codereview.chromium.org/1576283003/diff/160001/third_party/WebKit/LayoutTests/media/media-play-promise.html#newcode273 third_party/WebKit/LayoutTests/media/media-play-promise.html:273: // that it actually happens later. It's unclear ...
4 years, 10 months ago (2016-02-25 11:07:36 UTC) #38
philipj_slow
LGTM to land assuming that the fix actually changed the test expectations, otherwise there's something ...
4 years, 10 months ago (2016-02-25 14:06:49 UTC) #39
mlamouri (slow - plz ping)
https://codereview.chromium.org/1576283003/diff/160001/third_party/WebKit/Source/core/dom/DOMException.cpp File third_party/WebKit/Source/core/dom/DOMException.cpp (right): https://codereview.chromium.org/1576283003/diff/160001/third_party/WebKit/Source/core/dom/DOMException.cpp#newcode88 third_party/WebKit/Source/core/dom/DOMException.cpp:88: // Please add new entries at the end of ...
4 years, 10 months ago (2016-02-25 14:40:06 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1576283003/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1576283003/240001
4 years, 10 months ago (2016-02-25 14:41:07 UTC) #43
philipj_slow
https://codereview.chromium.org/1576283003/diff/220001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/1576283003/diff/220001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp#newcode3627 third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:3627: // TODO(mlamouri): because cancellable tasks can't take parameters, the ...
4 years, 10 months ago (2016-02-25 15:28:30 UTC) #44
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/185716)
4 years, 10 months ago (2016-02-25 16:30:33 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1576283003/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1576283003/240001
4 years, 10 months ago (2016-02-25 16:50:55 UTC) #48
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years, 10 months ago (2016-02-25 17:49:19 UTC) #49
commit-bot: I haz the power
4 years, 10 months ago (2016-02-25 17:50:49 UTC) #51
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/dd99205e1045321b1812f64c5838e641cda7a2e9
Cr-Commit-Position: refs/heads/master@{#377608}

Powered by Google App Engine
This is Rietveld 408576698