Title: [183276] trunk/Source/WebKit2
Revision
183276
Author
[email protected]
Date
2015-04-24 12:15:57 -0700 (Fri, 24 Apr 2015)

Log Message

[WK2] Only issue a isPlayingAudioDidChange() notification if the audio playing state actually changed.
https://bugs.webkit.org/show_bug.cgi?id=144153

Reviewed by Alexey Proskuryakov.

Check the old state vs. the new state and only issue the change notification if the IsPlayingAudio state changed.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isPlayingMediaDidChange):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (183275 => 183276)


--- trunk/Source/WebKit2/ChangeLog	2015-04-24 19:08:01 UTC (rev 183275)
+++ trunk/Source/WebKit2/ChangeLog	2015-04-24 19:15:57 UTC (rev 183276)
@@ -1,3 +1,15 @@
+2015-04-24  Jer Noble  <[email protected]>
+
+        [WK2] Only issue a isPlayingAudioDidChange() notification if the audio playing state actually changed.
+        https://bugs.webkit.org/show_bug.cgi?id=144153
+
+        Reviewed by Alexey Proskuryakov.
+
+        Check the old state vs. the new state and only issue the change notification if the IsPlayingAudio state changed.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::isPlayingMediaDidChange):
+
 2015-04-24  Antti Koivisto  <[email protected]>
 
         CrashTracer: [USER] com.apple.WebKit.Networking at com.apple.WebKit: WebKit::NetworkResourceLoader::~NetworkResourceLoader + 14

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (183275 => 183276)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2015-04-24 19:08:01 UTC (rev 183275)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2015-04-24 19:15:57 UTC (rev 183276)
@@ -5663,12 +5663,17 @@
     m_isShowingNavigationGestureSnapshot = false;
 }
 
-void WebPageProxy::isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags state)
+void WebPageProxy::isPlayingMediaDidChange(MediaProducer::MediaStateFlags state)
 {
     if (state == m_mediaState)
         return;
 
+    MediaProducer::MediaStateFlags oldState = m_mediaState;
     m_mediaState = state;
+
+    if ((oldState & MediaProducer::IsPlayingAudio) == (m_mediaState & MediaProducer::IsPlayingAudio))
+        return;
+
     m_uiClient->isPlayingAudioDidChange(*this);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to