RESOLVED FIXED 159580
Refactor WebPlaybackSessionModelMediaElement to be client based.
https://bugs.webkit.org/show_bug.cgi?id=159580
Summary Refactor WebPlaybackSessionModelMediaElement to be client based.
Jeremy Jones
Reported 2016-07-08 13:34:16 PDT
WebPlaybackSessionModelMediaElement currently only supports a single interface client. This should be refactored so that it supports multiple clients that can each register and unregister for state changes.
Attachments
Patch (185.13 KB, patch)
2016-07-08 16:46 PDT, Jer Noble
no flags
Patch (185.16 KB, patch)
2016-07-08 17:19 PDT, Jer Noble
no flags
Patch (184.91 KB, patch)
2016-08-29 11:24 PDT, Jer Noble
eric.carlson: review+
Patch for landing (184.92 KB, patch)
2016-09-02 12:11 PDT, Jer Noble
no flags
Jer Noble
Comment 1 2016-07-08 16:46:45 PDT
Jer Noble
Comment 2 2016-07-08 17:19:52 PDT
Jer Noble
Comment 3 2016-08-29 11:24:41 PDT
Eric Carlson
Comment 4 2016-08-30 14:00:43 PDT
Comment on attachment 287287 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=287287&action=review > Source/WebCore/ChangeLog:9 > + can have multiple clients, and that the object will both store current values and also notify those clients Nit: "and that the object" -> "and so the object" > Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm:96 > + for (auto* client : m_clients) Nit" auto& because m_clients can't have NULL values > Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm:111 > + for (auto* client : m_clients) Ditto. > Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm:122 > + for (auto* client : m_clients) { Ditto. > Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm:125 > + // FIXME: 130788 - find a better event to update seekable ranges from. Nit: "update seekable ranges from" what? > Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm:143 > + for (auto* client : m_clients) { Nit: auto& > Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm:281 > + for (auto& client : m_clients) { Nit: "auto" if you don't decide to change the ones above. > Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm:393 > + auto host = m_mediaElement->mediaControlsHost(); Nit: if you move this above the test you can avoid calling the method twice. > Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm:99 > + setHasVideo(!!m_videoElement); Nit: "!!" shouldn't be necessary as setHasVideo takes a bool, not a BOOL > Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm:749 > + m_playbackModel->setMediaElement(m_videoElement.get()); Nit: not ".get()" necessary if you use the "videoElement" parameter. > Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm:757 > + m_fullscreenModel->setVideoElement(m_videoElement.get()); > + > + bool allowsPictureInPicture = m_videoElement->mediaSession().allowsPictureInPicture(*m_videoElement.get()); > + > + IntRect videoElementClientRect = elementRectInWindow(m_videoElement.get()); Ditto.
Jer Noble
Comment 5 2016-09-02 12:11:28 PDT
Created attachment 287796 [details] Patch for landing
Jer Noble
Comment 6 2016-09-02 13:08:52 PDT
Jon Lee
Comment 7 2016-09-28 14:30:47 PDT
Note You need to log in before you can comment on or make changes to this bug.