Title: [278482] trunk/Source
Revision
278482
Author
wenson_hs...@apple.com
Date
2021-06-04 12:23:53 -0700 (Fri, 04 Jun 2021)

Log Message

Remove the unused `sourceElementID` argument in `Document::updateIsPlayingMedia` and related code
https://bugs.webkit.org/show_bug.cgi?id=226650

Reviewed by Chris Dumez.

Source/WebCore:

This `uint64_t` argument is currently not used for anything. It was originally added in r188030 with the purpose
of mapping to HTMLMediaElements via `HTMLMediaElement::elementWithID()`, but that mechanism was entirely removed
in r267885.

It appears that this code has been superceded by (relatively recent) support for the Media Session API.

No change in behavior.

* dom/Document.cpp:
(WebCore::Document::willBeRemovedFromFrame):
(WebCore::Document::updateIsPlayingMedia):
* dom/Document.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::isPlayingMediaDidChange):
* page/Page.cpp:
(WebCore::Page::updateIsPlayingMedia):
* page/Page.h:

Source/WebKit:

Remove more unused code. See WebCore/ChangeLog for more details.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isPlayingMediaDidChange):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::isPlayingMediaDidChange):
* WebProcess/WebCoreSupport/WebChromeClient.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (278481 => 278482)


--- trunk/Source/WebCore/ChangeLog	2021-06-04 19:11:56 UTC (rev 278481)
+++ trunk/Source/WebCore/ChangeLog	2021-06-04 19:23:53 UTC (rev 278482)
@@ -1,3 +1,28 @@
+2021-06-04  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        Remove the unused `sourceElementID` argument in `Document::updateIsPlayingMedia` and related code
+        https://bugs.webkit.org/show_bug.cgi?id=226650
+
+        Reviewed by Chris Dumez.
+
+        This `uint64_t` argument is currently not used for anything. It was originally added in r188030 with the purpose
+        of mapping to HTMLMediaElements via `HTMLMediaElement::elementWithID()`, but that mechanism was entirely removed
+        in r267885.
+
+        It appears that this code has been superceded by (relatively recent) support for the Media Session API.
+
+        No change in behavior.
+
+        * dom/Document.cpp:
+        (WebCore::Document::willBeRemovedFromFrame):
+        (WebCore::Document::updateIsPlayingMedia):
+        * dom/Document.h:
+        * page/ChromeClient.h:
+        (WebCore::ChromeClient::isPlayingMediaDidChange):
+        * page/Page.cpp:
+        (WebCore::Page::updateIsPlayingMedia):
+        * page/Page.h:
+
 2021-06-04  Chris Dumez  <cdu...@apple.com>
 
         Port MediaKeySystemAccess & MediaCapabilities to the HTML event loop

Modified: trunk/Source/WebCore/dom/Document.cpp (278481 => 278482)


--- trunk/Source/WebCore/dom/Document.cpp	2021-06-04 19:11:56 UTC (rev 278481)
+++ trunk/Source/WebCore/dom/Document.cpp	2021-06-04 19:23:53 UTC (rev 278482)
@@ -2653,7 +2653,7 @@
 
     if (page() && !m_mediaState.isEmpty()) {
         m_mediaState = MediaProducer::IsNotPlaying;
-        page()->updateIsPlayingMedia(HTMLMediaElementInvalidID);
+        page()->updateIsPlayingMedia();
     }
 
     selection().willBeRemovedFromFrame();
@@ -4343,7 +4343,7 @@
     updateIsPlayingMedia();
 }
 
-void Document::updateIsPlayingMedia(uint64_t sourceElementID)
+void Document::updateIsPlayingMedia()
 {
     ASSERT(!m_audioProducers.hasNullReferences());
     MediaProducer::MediaStateFlags state;
@@ -4368,8 +4368,8 @@
     
     m_mediaState = state;
 
-    if (page())
-        page()->updateIsPlayingMedia(sourceElementID);
+    if (auto* page = this->page())
+        page->updateIsPlayingMedia();
 
 #if ENABLE(MEDIA_STREAM)
     if (captureStateChanged)

Modified: trunk/Source/WebCore/dom/Document.h (278481 => 278482)


--- trunk/Source/WebCore/dom/Document.h	2021-06-04 19:11:56 UTC (rev 278481)
+++ trunk/Source/WebCore/dom/Document.h	2021-06-04 19:23:53 UTC (rev 278482)
@@ -255,8 +255,6 @@
 class Scope;
 }
 
-constexpr uint64_t HTMLMediaElementInvalidID = 0;
-
 enum PageshowEventPersistence { PageshowEventNotPersisted, PageshowEventPersisted };
 
 enum NodeListInvalidationType {
@@ -1386,7 +1384,7 @@
     MediaProducer::MediaStateFlags mediaState() const { return m_mediaState; }
     void noteUserInteractionWithMediaElement();
     bool isCapturing() const { return MediaProducer::isCapturing(m_mediaState); }
-    WEBCORE_EXPORT void updateIsPlayingMedia(uint64_t = HTMLMediaElementInvalidID);
+    WEBCORE_EXPORT void updateIsPlayingMedia();
     void pageMutedStateDidChange();
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)

Modified: trunk/Source/WebCore/page/ChromeClient.h (278481 => 278482)


--- trunk/Source/WebCore/page/ChromeClient.h	2021-06-04 19:11:56 UTC (rev 278481)
+++ trunk/Source/WebCore/page/ChromeClient.h	2021-06-04 19:23:53 UTC (rev 278482)
@@ -491,7 +491,7 @@
 
     virtual bool shouldUseTiledBackingForFrameView(const FrameView&) const { return false; }
 
-    virtual void isPlayingMediaDidChange(MediaProducer::MediaStateFlags, uint64_t) { }
+    virtual void isPlayingMediaDidChange(MediaProducer::MediaStateFlags) { }
     virtual void handleAutoplayEvent(AutoplayEvent, OptionSet<AutoplayEventFlags>) { }
 
 #if ENABLE(WEB_CRYPTO)

Modified: trunk/Source/WebCore/page/Page.cpp (278481 => 278482)


--- trunk/Source/WebCore/page/Page.cpp	2021-06-04 19:11:56 UTC (rev 278481)
+++ trunk/Source/WebCore/page/Page.cpp	2021-06-04 19:23:53 UTC (rev 278482)
@@ -2134,7 +2134,7 @@
         view->storageBlockingStateChanged();
 }
 
-void Page::updateIsPlayingMedia(uint64_t sourceElementID)
+void Page::updateIsPlayingMedia()
 {
     MediaProducer::MediaStateFlags state;
     forEachDocument([&](auto& document) {
@@ -2146,7 +2146,7 @@
 
     m_mediaState = state;
 
-    chrome().client().isPlayingMediaDidChange(state, sourceElementID);
+    chrome().client().isPlayingMediaDidChange(state);
 }
 
 void Page::schedulePlaybackControlsManagerUpdate()

Modified: trunk/Source/WebCore/page/Page.h (278481 => 278482)


--- trunk/Source/WebCore/page/Page.h	2021-06-04 19:11:56 UTC (rev 278481)
+++ trunk/Source/WebCore/page/Page.h	2021-06-04 19:23:53 UTC (rev 278482)
@@ -711,7 +711,7 @@
     bool usesEphemeralSession() const { return m_sessionID.isEphemeral(); }
 
     MediaProducer::MediaStateFlags mediaState() const { return m_mediaState; }
-    void updateIsPlayingMedia(uint64_t);
+    void updateIsPlayingMedia();
     MediaProducer::MutedStateFlags mutedState() const { return m_mutedState; }
     bool isAudioMuted() const { return m_mutedState.contains(MediaProducer::MutedState::AudioIsMuted); }
     bool isMediaCaptureMuted() const { return m_mutedState.containsAny(MediaProducer::MediaStreamCaptureIsMuted); };

Modified: trunk/Source/WebKit/ChangeLog (278481 => 278482)


--- trunk/Source/WebKit/ChangeLog	2021-06-04 19:11:56 UTC (rev 278481)
+++ trunk/Source/WebKit/ChangeLog	2021-06-04 19:23:53 UTC (rev 278482)
@@ -1,3 +1,20 @@
+2021-06-04  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        Remove the unused `sourceElementID` argument in `Document::updateIsPlayingMedia` and related code
+        https://bugs.webkit.org/show_bug.cgi?id=226650
+
+        Reviewed by Chris Dumez.
+
+        Remove more unused code. See WebCore/ChangeLog for more details.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::isPlayingMediaDidChange):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::isPlayingMediaDidChange):
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+
 2021-06-04  Alex Christensen  <achristen...@webkit.org>
 
         Implement off-by-default experimental feature for PerformanceResourceTiming.transferSize, encodedBodySize, and decodedBodySize

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (278481 => 278482)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2021-06-04 19:11:56 UTC (rev 278481)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2021-06-04 19:23:53 UTC (rev 278482)
@@ -9295,7 +9295,7 @@
     m_navigationClient->didRemoveNavigationGestureSnapshot(*this);
 }
 
-void WebPageProxy::isPlayingMediaDidChange(MediaProducer::MediaStateFlags newState, uint64_t sourceElementID)
+void WebPageProxy::isPlayingMediaDidChange(MediaProducer::MediaStateFlags newState)
 {
 #if PLATFORM(IOS_FAMILY)
     if (!m_process->throttler().shouldBeRunnable())

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (278481 => 278482)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2021-06-04 19:11:56 UTC (rev 278481)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2021-06-04 19:23:53 UTC (rev 278482)
@@ -1487,7 +1487,7 @@
     bool isShowingNavigationGestureSnapshot() const { return m_isShowingNavigationGestureSnapshot; }
 
     bool isPlayingAudio() const { return !!(m_mediaState & WebCore::MediaProducer::MediaState::IsPlayingAudio); }
-    void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags, uint64_t);
+    void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags);
     void updateReportedMediaCaptureState();
 
     enum class CanDelayNotification { No, Yes };

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (278481 => 278482)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in	2021-06-04 19:11:56 UTC (rev 278481)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in	2021-06-04 19:23:53 UTC (rev 278482)
@@ -463,7 +463,7 @@
     ContentFilterDidBlockLoadForFrame(WebCore::ContentFilterUnblockHandler unblockHandler, WebCore::FrameIdentifier frameID)
 #endif
 
-    IsPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags state, uint64_t sourceElementID)
+    IsPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags state)
     HandleAutoplayEvent(enum:uint8_t WebCore::AutoplayEvent event, OptionSet<WebCore::AutoplayEventFlags> flags)
 
 #if PLATFORM(MAC)

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp (278481 => 278482)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp	2021-06-04 19:11:56 UTC (rev 278481)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp	2021-06-04 19:23:53 UTC (rev 278482)
@@ -1233,9 +1233,9 @@
     return m_page.drawingArea()->shouldUseTiledBackingForFrameView(frameView);
 }
 
-void WebChromeClient::isPlayingMediaDidChange(MediaProducer::MediaStateFlags state, uint64_t sourceElementID)
+void WebChromeClient::isPlayingMediaDidChange(MediaProducer::MediaStateFlags state)
 {
-    m_page.send(Messages::WebPageProxy::IsPlayingMediaDidChange(state, sourceElementID));
+    m_page.send(Messages::WebPageProxy::IsPlayingMediaDidChange(state));
 }
 
 void WebChromeClient::handleAutoplayEvent(AutoplayEvent event, OptionSet<AutoplayEventFlags> flags)

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h (278481 => 278482)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h	2021-06-04 19:11:56 UTC (rev 278481)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h	2021-06-04 19:23:53 UTC (rev 278482)
@@ -346,7 +346,7 @@
 
     bool shouldUseTiledBackingForFrameView(const WebCore::FrameView&) const final;
 
-    void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags, uint64_t) final;
+    void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags) final;
     void handleAutoplayEvent(WebCore::AutoplayEvent, OptionSet<WebCore::AutoplayEventFlags>) final;
 
 #if ENABLE(APP_HIGHLIGHTS)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to