Title: [234568] branches/safari-606-branch

Diff

Modified: branches/safari-606-branch/LayoutTests/ChangeLog (234567 => 234568)


--- branches/safari-606-branch/LayoutTests/ChangeLog	2018-08-04 01:06:16 UTC (rev 234567)
+++ branches/safari-606-branch/LayoutTests/ChangeLog	2018-08-04 01:06:22 UTC (rev 234568)
@@ -1,3 +1,7 @@
+2018-08-03  Babak Shafiei  <[email protected]>
+
+        Revert r234534. rdar://problem/42902608
+
 2018-08-03  Kocsen Chung  <[email protected]>
 
         Cherry-pick r234534. rdar://problem/42902608

Modified: branches/safari-606-branch/LayoutTests/platform/ios/TestExpectations (234567 => 234568)


--- branches/safari-606-branch/LayoutTests/platform/ios/TestExpectations	2018-08-04 01:06:16 UTC (rev 234567)
+++ branches/safari-606-branch/LayoutTests/platform/ios/TestExpectations	2018-08-04 01:06:22 UTC (rev 234568)
@@ -3340,6 +3340,3 @@
 
 # We are only accepting GLSL3 for macOS. 
 webkit.org/b/187982 webgl/2.0.0/conformance2/glsl3 [ Skip ]
-
-# Audio session does not have a "none" category on iOS [ Skip ]
-webkit.org/b/188285 platform/mac/media/audio-session-category-video-paused.html [ Skip ]

Deleted: branches/safari-606-branch/LayoutTests/platform/mac/media/audio-session-category-video-paused-expected.txt (234567 => 234568)


--- branches/safari-606-branch/LayoutTests/platform/mac/media/audio-session-category-video-paused-expected.txt	2018-08-04 01:06:16 UTC (rev 234567)
+++ branches/safari-606-branch/LayoutTests/platform/mac/media/audio-session-category-video-paused-expected.txt	2018-08-04 01:06:22 UTC (rev 234568)
@@ -1,19 +0,0 @@
-
-RUN(internals.settings.setShouldManageAudioSessionCategory(true))
-RUN(video.src = "" "../../../media/content/test"))
-RUN(video.play())
-EVENT(playing)
-EXPECTED (internals.audioSessionCategory() == 'MediaPlayback') OK
-RUN(video.pause())
-EVENT(pause)
-EXPECTED (internals.audioSessionCategory() == 'MediaPlayback') OK
-RUN(internals.beginMediaSessionInterruption("system"))
-EXPECTED (internals.audioSessionCategory() == 'None') OK
-RUN(video.play())
-EVENT(playing)
-EXPECTED (internals.audioSessionCategory() == 'MediaPlayback') OK
-RUN(video.src = ""
-RUN(video.load())
-EXPECTED (internals.audioSessionCategory() == 'None') OK
-END OF TEST
-

Deleted: branches/safari-606-branch/LayoutTests/platform/mac/media/audio-session-category-video-paused.html (234567 => 234568)


--- branches/safari-606-branch/LayoutTests/platform/mac/media/audio-session-category-video-paused.html	2018-08-04 01:06:16 UTC (rev 234567)
+++ branches/safari-606-branch/LayoutTests/platform/mac/media/audio-session-category-video-paused.html	2018-08-04 01:06:22 UTC (rev 234568)
@@ -1,38 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <title>audio-session-category-track-change</title>
-    <script src=""
-    <script src=""
-    <script>
-    window.addEventListener('load', async event => {
-        findMediaElement();
-        run('internals.settings.setShouldManageAudioSessionCategory(true)');
-        run('video.src = "" "../../../media/content/test")');
-        run('video.play()');
-        await waitFor(video, 'playing');
-        await testExpectedEventually('internals.audioSessionCategory()', 'MediaPlayback');
-
-        run('video.pause()');
-        await waitFor(video, 'pause');
-        await testExpectedEventually('internals.audioSessionCategory()', 'MediaPlayback');
-
-        run('internals.beginMediaSessionInterruption("system")');
-        await testExpectedEventually('internals.audioSessionCategory()', 'None');
-
-        run('video.play()');
-        await waitFor(video, 'playing');
-        await testExpectedEventually('internals.audioSessionCategory()', 'MediaPlayback');
-
-        run('video.src = ""
-        run('video.load()');
-        await testExpectedEventually('internals.audioSessionCategory()', 'None');
-
-        endTest();
-    });
-    </script>
-</head>
-<body>
-    <video controls></video>
-</body>
-</html>

Modified: branches/safari-606-branch/Source/WebCore/ChangeLog (234567 => 234568)


--- branches/safari-606-branch/Source/WebCore/ChangeLog	2018-08-04 01:06:16 UTC (rev 234567)
+++ branches/safari-606-branch/Source/WebCore/ChangeLog	2018-08-04 01:06:22 UTC (rev 234568)
@@ -1,3 +1,7 @@
+2018-08-03  Babak Shafiei  <[email protected]>
+
+        Revert r234534. rdar://problem/42902608
+
 2018-08-03  Kocsen Chung  <[email protected]>
 
         Cherry-pick r234534. rdar://problem/42902608

Modified: branches/safari-606-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj (234567 => 234568)


--- branches/safari-606-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-08-04 01:06:16 UTC (rev 234567)
+++ branches/safari-606-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-08-04 01:06:22 UTC (rev 234568)
@@ -3949,7 +3949,6 @@
 		CD1E7347167BC78E009A885D /* TextTrackRepresentation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD1E7346167BC78E009A885D /* TextTrackRepresentation.cpp */; };
 		CD225C0B1C46FBF400140761 /* WebCoreNSURLSession.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD225C091C46FBF400140761 /* WebCoreNSURLSession.mm */; };
 		CD225C0C1C46FBF400140761 /* WebCoreNSURLSession.h in Headers */ = {isa = PBXBuildFile; fileRef = CD225C0A1C46FBF400140761 /* WebCoreNSURLSession.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		CD227E3A2113C86200D285AF /* MediaSessionManagerCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = CD227E362113AEFA00D285AF /* MediaSessionManagerCocoa.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		CD2F4A2418D89F700063746D /* AudioHardwareListener.h in Headers */ = {isa = PBXBuildFile; fileRef = CD2F4A2218D89F700063746D /* AudioHardwareListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		CD2F4A2818D8A3490063746D /* AudioHardwareListenerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = CD2F4A2618D8A3490063746D /* AudioHardwareListenerMac.h */; };
 		CD318622199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD318620199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.mm */; };
@@ -13175,7 +13174,6 @@
 		CD1E7346167BC78E009A885D /* TextTrackRepresentation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextTrackRepresentation.cpp; sourceTree = "<group>"; };
 		CD225C091C46FBF400140761 /* WebCoreNSURLSession.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreNSURLSession.mm; sourceTree = "<group>"; };
 		CD225C0A1C46FBF400140761 /* WebCoreNSURLSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreNSURLSession.h; sourceTree = "<group>"; };
-		CD227E362113AEFA00D285AF /* MediaSessionManagerCocoa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MediaSessionManagerCocoa.h; path = cocoa/MediaSessionManagerCocoa.h; sourceTree = "<group>"; };
 		CD27F6E014575C1B0078207D /* MediaController.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = MediaController.idl; sourceTree = "<group>"; };
 		CD27F6E2145767580078207D /* JSMediaController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaController.cpp; sourceTree = "<group>"; };
 		CD27F6E3145767580078207D /* JSMediaController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaController.h; sourceTree = "<group>"; };
@@ -24627,7 +24625,6 @@
 			isa = PBXGroup;
 			children = (
 				CD669D661D232DFF004D1866 /* MediaSessionManagerCocoa.cpp */,
-				CD227E362113AEFA00D285AF /* MediaSessionManagerCocoa.h */,
 				CDE667A21E4BBF1500E8154A /* WebAudioBufferList.cpp */,
 				CDE667A31E4BBF1500E8154A /* WebAudioBufferList.h */,
 			);
@@ -27827,7 +27824,6 @@
 				8371AC3B1F509BE400FBF284 /* ErrorCallback.h in Headers */,
 				2ECF7AE210162B5800427DE7 /* ErrorEvent.h in Headers */,
 				85031B420A44EFC700F992E0 /* Event.h in Headers */,
-				CD227E3A2113C86200D285AF /* MediaSessionManagerCocoa.h in Headers */,
 				4138D3351244054800323D33 /* EventContext.h in Headers */,
 				418A06D0133C04D500CD379C /* EventDispatcher.h in Headers */,
 				93C09A530B064DB3005ABD4D /* EventHandler.h in Headers */,

Modified: branches/safari-606-branch/Source/WebCore/platform/audio/PlatformMediaSession.cpp (234567 => 234568)


--- branches/safari-606-branch/Source/WebCore/platform/audio/PlatformMediaSession.cpp	2018-08-04 01:06:16 UTC (rev 234567)
+++ branches/safari-606-branch/Source/WebCore/platform/audio/PlatformMediaSession.cpp	2018-08-04 01:06:22 UTC (rev 234568)
@@ -117,8 +117,6 @@
 
     INFO_LOG(LOGIDENTIFIER, state);
     m_state = state;
-    if (m_state == State::Playing)
-        m_hasPlayedSinceLastInterruption = true;
     PlatformMediaSessionManager::sharedManager().sessionStateChanged(*this);
 }
 

Modified: branches/safari-606-branch/Source/WebCore/platform/audio/PlatformMediaSession.h (234567 => 234568)


--- branches/safari-606-branch/Source/WebCore/platform/audio/PlatformMediaSession.h	2018-08-04 01:06:16 UTC (rev 234567)
+++ branches/safari-606-branch/Source/WebCore/platform/audio/PlatformMediaSession.h	2018-08-04 01:06:22 UTC (rev 234568)
@@ -176,9 +176,6 @@
 
     virtual bool allowsNowPlayingControlsVisibility() const { return false; }
 
-    bool hasPlayedSinceLastInterruption() const { return m_hasPlayedSinceLastInterruption; }
-    void clearHasPlayedSinceLastInterruption() { m_hasPlayedSinceLastInterruption = false; }
-
 protected:
     PlatformMediaSessionClient& client() const { return m_client; }
 
@@ -197,7 +194,6 @@
     int m_interruptionCount { 0 };
     bool m_notifyingClient;
     bool m_isPlayingToWirelessPlaybackTarget { false };
-    bool m_hasPlayedSinceLastInterruption { false };
 
 #if !RELEASE_LOG_DISABLED
     Ref<const Logger> m_logger;

Modified: branches/safari-606-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp (234567 => 234568)


--- branches/safari-606-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp	2018-08-04 01:06:16 UTC (rev 234567)
+++ branches/safari-606-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp	2018-08-04 01:06:22 UTC (rev 234568)
@@ -357,6 +357,12 @@
     updateSessionState();
 }
 
+#if !PLATFORM(COCOA)
+void PlatformMediaSessionManager::updateSessionState()
+{
+}
+#endif
+
 void PlatformMediaSessionManager::didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType command, const PlatformMediaSession::RemoteCommandArgument* argument)
 {
     PlatformMediaSession* activeSession = currentSession();

Modified: branches/safari-606-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.h (234567 => 234568)


--- branches/safari-606-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.h	2018-08-04 01:06:16 UTC (rev 234567)
+++ branches/safari-606-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.h	2018-08-04 01:06:22 UTC (rev 234568)
@@ -66,7 +66,7 @@
     bool willIgnoreSystemInterruptions() const { return m_willIgnoreSystemInterruptions; }
     void setWillIgnoreSystemInterruptions(bool ignore) { m_willIgnoreSystemInterruptions = ignore; }
 
-    WEBCORE_EXPORT virtual void beginInterruption(PlatformMediaSession::InterruptionType);
+    WEBCORE_EXPORT void beginInterruption(PlatformMediaSession::InterruptionType);
     WEBCORE_EXPORT void endInterruption(PlatformMediaSession::EndInterruptionFlags);
 
     WEBCORE_EXPORT void applicationWillBecomeInactive() const;
@@ -123,12 +123,10 @@
     PlatformMediaSession* findSession(const Function<bool(PlatformMediaSession&, size_t)>&) const;
     bool anyOfSessions(const Function<bool(PlatformMediaSession&, size_t)>& predicate) const { return findSession(predicate); }
 
-    AudioHardwareListener* audioHardwareListener() { return m_audioHardwareListener.get(); }
-
 private:
     friend class Internals;
 
-    virtual void updateSessionState() { }
+    void updateSessionState();
 
     // RemoteCommandListenerClient
     WEBCORE_EXPORT void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType, const PlatformMediaSession::RemoteCommandArgument*) override;

Modified: branches/safari-606-branch/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp (234567 => 234568)


--- branches/safari-606-branch/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp	2018-08-04 01:06:16 UTC (rev 234567)
+++ branches/safari-606-branch/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp	2018-08-04 01:06:22 UTC (rev 234568)
@@ -24,7 +24,7 @@
  */
 
 #include "config.h"
-#include "MediaSessionManagerCocoa.h"
+#include "PlatformMediaSessionManager.h"
 
 #if USE(AUDIO_SESSION)
 
@@ -38,7 +38,7 @@
 static const size_t kWebAudioBufferSize = 128;
 static const size_t kLowPowerVideoBufferSize = 4096;
 
-void MediaSessionManagerCocoa::updateSessionState()
+void PlatformMediaSessionManager::updateSessionState()
 {
     LOG(Media, "PlatformMediaSessionManager::scheduleUpdateSessionState() - types: Video(%d), Audio(%d), WebAudio(%d)", count(PlatformMediaSession::Video), count(PlatformMediaSession::Audio), count(PlatformMediaSession::WebAudio));
 
@@ -53,7 +53,7 @@
         // causes media LayoutTests to fail on 10.8.
 
         size_t bufferSize;
-        if (audioHardwareListener() && audioHardwareListener()->outputDeviceSupportsLowPowerMode())
+        if (m_audioHardwareListener && m_audioHardwareListener->outputDeviceSupportsLowPowerMode())
             bufferSize = kLowPowerVideoBufferSize;
         else
             bufferSize = kWebAudioBufferSize;
@@ -70,7 +70,7 @@
         auto type = session.mediaType();
         if (type == PlatformMediaSession::WebAudio)
             hasWebAudioType = true;
-        if ((type == PlatformMediaSession::VideoAudio || type == PlatformMediaSession::Audio) && session.canProduceAudio() && session.hasPlayedSinceLastInterruption())
+        if ((type == PlatformMediaSession::VideoAudio || type == PlatformMediaSession::Audio) && session.canProduceAudio() && session.state() == PlatformMediaSession::Playing)
             hasAudibleAudioOrVideoMediaType = true;
         if (session.isPlayingToWirelessPlaybackTarget())
             hasAudibleAudioOrVideoMediaType = true;
@@ -87,15 +87,4 @@
         AudioSession::sharedSession().setCategory(AudioSession::None);
 }
 
-void MediaSessionManagerCocoa::beginInterruption(PlatformMediaSession::InterruptionType type)
-{
-    if (type == PlatformMediaSession::InterruptionType::SystemInterruption) {
-        forEachSession([] (PlatformMediaSession& session, size_t) {
-            session.clearHasPlayedSinceLastInterruption();
-        });
-    }
-
-    PlatformMediaSessionManager::beginInterruption(type);
-}
-
 #endif // USE(AUDIO_SESSION)

Deleted: branches/safari-606-branch/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.h (234567 => 234568)


--- branches/safari-606-branch/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.h	2018-08-04 01:06:16 UTC (rev 234567)
+++ branches/safari-606-branch/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.h	2018-08-04 01:06:22 UTC (rev 234568)
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if PLATFORM(COCOA)
-
-#include "PlatformMediaSessionManager.h"
-
-namespace WebCore {
-
-class MediaSessionManagerCocoa : public PlatformMediaSessionManager {
-public:
-    void updateSessionState() override;
-    void beginInterruption(PlatformMediaSession::InterruptionType) override;
-};
-
-}
-
-#endif // PLATFORM(COCOA)

Modified: branches/safari-606-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h (234567 => 234568)


--- branches/safari-606-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h	2018-08-04 01:06:16 UTC (rev 234567)
+++ branches/safari-606-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h	2018-08-04 01:06:22 UTC (rev 234568)
@@ -27,7 +27,7 @@
 
 #if PLATFORM(IOS)
 
-#include "MediaSessionManagerCocoa.h"
+#include "PlatformMediaSessionManager.h"
 #include <wtf/RetainPtr.h>
 
 OBJC_CLASS WebMediaSessionHelper;
@@ -41,7 +41,7 @@
 
 namespace WebCore {
 
-class MediaSessionManageriOS : public MediaSessionManagerCocoa {
+class MediaSessionManageriOS : public PlatformMediaSessionManager {
 public:
     virtual ~MediaSessionManageriOS();
 

Modified: branches/safari-606-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm (234567 => 234568)


--- branches/safari-606-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm	2018-08-04 01:06:16 UTC (rev 234567)
+++ branches/safari-606-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm	2018-08-04 01:06:22 UTC (rev 234568)
@@ -144,7 +144,7 @@
 }
 
 MediaSessionManageriOS::MediaSessionManageriOS()
-    : MediaSessionManagerCocoa()
+    : PlatformMediaSessionManager()
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS
     m_objcObserver = adoptNS([[WebMediaSessionHelper alloc] initWithCallback:this]);

Modified: branches/safari-606-branch/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.h (234567 => 234568)


--- branches/safari-606-branch/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.h	2018-08-04 01:06:16 UTC (rev 234567)
+++ branches/safari-606-branch/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.h	2018-08-04 01:06:22 UTC (rev 234568)
@@ -28,11 +28,11 @@
 #if PLATFORM(MAC)
 
 #include "GenericTaskQueue.h"
-#include "MediaSessionManagerCocoa.h"
+#include "PlatformMediaSessionManager.h"
 
 namespace WebCore {
 
-class MediaSessionManagerMac : public MediaSessionManagerCocoa {
+class MediaSessionManagerMac : public PlatformMediaSessionManager {
 public:
     virtual ~MediaSessionManagerMac();
 

Modified: branches/safari-606-branch/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm (234567 => 234568)


--- branches/safari-606-branch/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm	2018-08-04 01:06:16 UTC (rev 234567)
+++ branches/safari-606-branch/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm	2018-08-04 01:06:22 UTC (rev 234568)
@@ -55,7 +55,7 @@
 }
 
 MediaSessionManagerMac::MediaSessionManagerMac()
-    : MediaSessionManagerCocoa()
+    : PlatformMediaSessionManager()
 {
     resetRestrictions();
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to