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

Issue 2782373002: Remove MediaControls methods needed for the Cast button (Closed)

Created:
3 years, 8 months ago by whywhat
Modified:
3 years, 7 months ago
CC:
blink-reviews, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink, eric.carlson_apple.com, feature-media-reviews_chromium.org, fs, gasubic, mlamouri+watch-blink_chromium.org, nessy, Srirama
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove the explicit dependency between HTMLMediaElement and MediaControls wrt the cast buttons. OnRemotePlaybackAvailabilityChanged, OnRemotePlaybackConnecting, and OnRemotePlaybackDisconnected are replaced by MediaControlsMediaEventListener via an availability callback and listening for connect, connecting and disconnect events on the RemotePlayback object off the MediaElement. OnDisableRemotePlaybackAttributeChanged is replaced by a MutationObserver kept by MediaControlsImpl. RemotePlayback has methods that allow it to be used from C++ directly. BUG=517102 TEST=existing and new tests + manual Review-Url: https://codereview.chromium.org/2782373002 Cr-Commit-Position: refs/heads/master@{#468223} Committed: https://chromium.googlesource.com/chromium/src/+/77db41b769602da7ccc0106c285490f149fe343d

Patch Set 1 #

Patch Set 2 : Rebased #

Total comments: 6

Patch Set 3 : Unified watch availability code. #

Total comments: 2

Patch Set 4 : Moved the events to MediaControlsMediaEventListener #

Patch Set 5 : Handle double Attach() #

Patch Set 6 : Added a test for event listeners #

Patch Set 7 : Added checks for callbacks #

Total comments: 1

Patch Set 8 : Fixed Cast* MediaControlsImpl tests #

Patch Set 9 : Removed unused from the header #

Total comments: 1

Patch Set 10 : Fixed webkit_unit_tests #

Patch Set 11 : Fixed more tests #

Total comments: 8

Patch Set 12 : Fixed comments and the GC test #

Patch Set 13 : Rebase #

Patch Set 14 : Added missing files #

Patch Set 15 : No DCHECK in Detach #

Patch Set 16 : Minimized logic changes #

Patch Set 17 : Use MutationObserver for disableRemotePlayback #

Patch Set 18 : Fixed MediaControlsImplTest #

Unified diffs Side-by-side diffs Delta from patch set Stats (+391 lines, -142 lines) Patch
M third_party/WebKit/Source/core/html/HTMLMediaElement.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +1 line, -26 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLMediaElementEventListenersTest.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/media/MediaControls.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +0 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/modules/media_controls/DEPS View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +6 lines, -14 lines 0 comments Download
M third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 10 chunks +79 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/modules/media_controls/MediaControlsImplTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 7 chunks +69 lines, -26 lines 0 comments Download
M third_party/WebKit/Source/modules/media_controls/MediaControlsMediaEventListener.h View 1 2 3 4 5 6 7 2 chunks +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/media_controls/MediaControlsMediaEventListener.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +51 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +5 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 6 chunks +16 lines, -10 lines 0 comments Download
A third_party/WebKit/Source/modules/remoteplayback/AvailabilityCallbackWrapper.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +46 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/modules/remoteplayback/AvailabilityCallbackWrapper.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +39 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/remoteplayback/BUILD.gn 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/modules/remoteplayback/RemotePlayback.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +18 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +49 lines, -37 lines 0 comments Download

Messages

Total messages: 112 (64 generated)
whywhat
PTaL It's not ready to submit yet: - doesn't build due to the dependencies -- ...
3 years, 8 months ago (2017-03-30 01:54:18 UTC) #2
mlamouri (slow - plz ping)
On 2017/03/30 at 01:54:18, avayvod wrote: > PTaL > > It's not ready to submit ...
3 years, 8 months ago (2017-03-30 20:45:51 UTC) #3
whywhat
On 2017/03/30 at 20:45:51, mlamouri wrote: > On 2017/03/30 at 01:54:18, avayvod wrote: > > ...
3 years, 8 months ago (2017-03-31 15:46:28 UTC) #4
mlamouri (slow - plz ping)
On 2017/03/31 at 15:46:28, avayvod wrote: > On 2017/03/30 at 20:45:51, mlamouri wrote: > > ...
3 years, 8 months ago (2017-04-04 12:46:44 UTC) #5
whywhat
Rebased
3 years, 8 months ago (2017-04-17 22:40:04 UTC) #6
whywhat
Kentaro, any thoughts on reusing the IDL interface from C++? I don't think there's FromMainWorld() ...
3 years, 8 months ago (2017-04-17 22:48:45 UTC) #7
whywhat
3 years, 8 months ago (2017-04-17 22:49:03 UTC) #10
haraken
On 2017/04/17 22:48:45, whywhat wrote: > Kentaro, any thoughts on reusing the IDL interface from ...
3 years, 8 months ago (2017-04-18 07:55:14 UTC) #11
mlamouri (slow - plz ping)
Regarding the callback, maybe you could do something similar to IntersectionObserver? See: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/dom/IntersectionObserver.idl https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/dom/IntersectionObserverCallback.h https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/dom/IntersectionObserver.h ...
3 years, 8 months ago (2017-04-18 13:02:40 UTC) #12
whywhat
On 2017/04/18 at 07:55:14, haraken wrote: > On 2017/04/17 22:48:45, whywhat wrote: > > Kentaro, ...
3 years, 8 months ago (2017-04-18 17:05:38 UTC) #13
whywhat
Unified watch availability code.
3 years, 8 months ago (2017-04-19 02:25:02 UTC) #14
whywhat
PTAL Some stuff doesn't work yet as the button can't currently cause all the controls ...
3 years, 8 months ago (2017-04-19 02:27:57 UTC) #15
mlamouri (slow - plz ping)
https://codereview.chromium.org/2782373002/diff/20001/third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.cpp File third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.cpp (right): https://codereview.chromium.org/2782373002/diff/20001/third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.cpp#newcode223 third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.cpp:223: return remote_playback_->state() != "disconnected"; On 2017/04/19 at 02:27:57, whywhat ...
3 years, 8 months ago (2017-04-19 16:35:36 UTC) #16
mlamouri (slow - plz ping)
I meant to add a top comment but didn't: I wasn't able to finish this ...
3 years, 8 months ago (2017-04-19 16:36:12 UTC) #17
whywhat
https://codereview.chromium.org/2782373002/diff/40001/third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.cpp File third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.cpp (right): https://codereview.chromium.org/2782373002/diff/40001/third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.cpp#newcode121 third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.cpp:121: SetDisplayType(kMediaOverlayCastOffButton); On 2017/04/19 at 16:35:36, mlamouri wrote: > A ...
3 years, 8 months ago (2017-04-19 22:40:48 UTC) #18
whywhat
On 2017/04/19 at 16:36:12, mlamouri wrote: > I meant to add a top comment but ...
3 years, 8 months ago (2017-04-19 22:43:11 UTC) #19
mlamouri (slow - plz ping)
On 2017/04/19 at 22:43:11, avayvod wrote: > On 2017/04/19 at 16:36:12, mlamouri wrote: > > ...
3 years, 8 months ago (2017-04-20 13:26:58 UTC) #20
whywhat
Moved the events to MediaControlsMediaEventListener
3 years, 8 months ago (2017-04-23 22:09:27 UTC) #21
whywhat
Handle double Attach()
3 years, 8 months ago (2017-04-23 23:42:09 UTC) #26
mlamouri (slow - plz ping)
Is this ready to be reviewed?
3 years, 8 months ago (2017-04-24 10:52:00 UTC) #31
whywhat
I might need to fix the tests I've broken but basically, yes. https://codereview.chromium.org/2782373002/diff/20001/third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.cpp File third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.cpp ...
3 years, 8 months ago (2017-04-24 14:16:38 UTC) #32
whywhat
Added a test for event listeners
3 years, 8 months ago (2017-04-24 15:57:14 UTC) #33
whywhat
Added checks for callbacks
3 years, 8 months ago (2017-04-24 16:03:01 UTC) #34
mlamouri (slow - plz ping)
https://codereview.chromium.org/2782373002/diff/120001/third_party/WebKit/Source/modules/media_controls/MediaControlsMediaEventListener.cpp File third_party/WebKit/Source/modules/media_controls/MediaControlsMediaEventListener.cpp (right): https://codereview.chromium.org/2782373002/diff/120001/third_party/WebKit/Source/modules/media_controls/MediaControlsMediaEventListener.cpp#newcode109 third_party/WebKit/Source/modules/media_controls/MediaControlsMediaEventListener.cpp:109: return *HTMLMediaElementRemotePlayback::remote(GetMediaElement()); I think your crash on Windows is ...
3 years, 8 months ago (2017-04-24 18:40:00 UTC) #39
whywhat
Fixed Cast* MediaControlsImpl tests
3 years, 8 months ago (2017-04-24 21:39:51 UTC) #40
whywhat
Removed unused from the header
3 years, 8 months ago (2017-04-24 23:04:20 UTC) #45
whywhat
https://codereview.chromium.org/2782373002/diff/160001/third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackTest.cpp File third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackTest.cpp (right): https://codereview.chromium.org/2782373002/diff/160001/third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackTest.cpp#newcode310 third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackTest.cpp:310: EXPECT_EQ(nullptr, weak_persistent_video); Kentaro, this fails (and a similar test ...
3 years, 8 months ago (2017-04-24 23:59:29 UTC) #46
whywhat
On 2017/04/24 at 23:59:29, whywhat wrote: > https://codereview.chromium.org/2782373002/diff/160001/third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackTest.cpp > File third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackTest.cpp (right): > > https://codereview.chromium.org/2782373002/diff/160001/third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackTest.cpp#newcode310 ...
3 years, 8 months ago (2017-04-25 00:35:57 UTC) #47
whywhat
Fixed webkit_unit_tests
3 years, 8 months ago (2017-04-25 01:12:48 UTC) #48
whywhat
Fixed more tests
3 years, 8 months ago (2017-04-25 02:32:33 UTC) #53
whywhat
This should be ready for another round of review now.
3 years, 8 months ago (2017-04-25 02:42:28 UTC) #56
mlamouri (slow - plz ping)
lgtm with comments applied and tests passing ;) https://codereview.chromium.org/2782373002/diff/200001/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h File third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h (right): https://codereview.chromium.org/2782373002/diff/200001/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h#newcode78 third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h:78: friend ...
3 years, 8 months ago (2017-04-25 12:19:21 UTC) #59
whywhat
https://codereview.chromium.org/2782373002/diff/200001/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h File third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h (right): https://codereview.chromium.org/2782373002/diff/200001/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h#newcode78 third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h:78: friend class MediaControlsMediaEventListener; On 2017/04/25 at 12:19:21, mlamouri wrote: ...
3 years, 8 months ago (2017-04-25 15:45:37 UTC) #60
whywhat
+Michael to review how I'm using TraceWrappers (apparently incorrectly, hence the try bots failures).
3 years, 8 months ago (2017-04-25 21:26:19 UTC) #63
whywhat
Hm, I think I figured the problem with GC. https://codereview.chromium.org/2782373002/diff/200001/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h File third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h (right): https://codereview.chromium.org/2782373002/diff/200001/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h#newcode85 third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h:85: ...
3 years, 8 months ago (2017-04-25 22:31:23 UTC) #64
whywhat
Fixed comments and the GC test
3 years, 8 months ago (2017-04-25 23:11:18 UTC) #65
whywhat
3 years, 8 months ago (2017-04-25 23:19:17 UTC) #68
whywhat
Rebase
3 years, 8 months ago (2017-04-26 00:07:52 UTC) #70
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/2782373002/240001
3 years, 8 months ago (2017-04-26 00:08:39 UTC) #73
commit-bot: I haz the power
Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm64_dbg_recipe/builds/255259) android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, ...
3 years, 8 months ago (2017-04-26 00:13:45 UTC) #75
whywhat
Added missing files
3 years, 8 months ago (2017-04-26 00:17:53 UTC) #76
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/2782373002/260001
3 years, 8 months ago (2017-04-26 00:20:26 UTC) #79
whywhat
No DCHECK in Detach
3 years, 7 months ago (2017-04-26 15:49:24 UTC) #85
whywhat
Minimized logic changes
3 years, 7 months ago (2017-04-28 00:40:31 UTC) #90
whywhat
Use MutationObserver for disableRemotePlayback
3 years, 7 months ago (2017-04-28 17:23:17 UTC) #95
whywhat
Fixed MediaControlsImplTest
3 years, 7 months ago (2017-04-28 21:22:14 UTC) #101
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/2782373002/340001
3 years, 7 months ago (2017-04-29 04:04:37 UTC) #108
commit-bot: I haz the power
3 years, 7 months ago (2017-04-29 04:11:18 UTC) #112
Message was sent while issue was closed.
Committed patchset #18 (id:340001) as
https://chromium.googlesource.com/chromium/src/+/77db41b769602da7ccc0106c2854...

Powered by Google App Engine
This is Rietveld 408576698