Title: [195378] branches/safari-601-branch
Revision
195378
Author
matthew_han...@apple.com
Date
2016-01-20 14:18:49 -0800 (Wed, 20 Jan 2016)

Log Message

Roll out r192200 via r195067. rdar://problem/24154288

Modified Paths

Removed Paths

Diff

Modified: branches/safari-601-branch/LayoutTests/ChangeLog (195377 => 195378)


--- branches/safari-601-branch/LayoutTests/ChangeLog	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/LayoutTests/ChangeLog	2016-01-20 22:18:49 UTC (rev 195378)
@@ -1,5 +1,9 @@
 2016-01-20  Matthew Hanson  <matthew_han...@apple.com>
 
+        Rollout r192200 via r195067. rdar://problem/24154288
+
+2016-01-20  Matthew Hanson  <matthew_han...@apple.com>
+
         Rollout r195068. rdar://problem/24154288
 
 2016-01-15  Babak Shafiei  <bshaf...@apple.com>
@@ -30,29 +34,6 @@
             * platform/gtk/TestExpectations: Ditto.
             * platform/win/TestExpectations: Ditto.
 
-2016-01-14  Matthew Hanson  <matthew_han...@apple.com>
-
-        Merge r192200. rdar://problem/24154288
-
-    2015-11-09  Eric Carlson  <eric.carl...@apple.com>
-
-            [Mac] Add a mock AppleTV device for testing
-            https://bugs.webkit.org/show_bug.cgi?id=148912
-            <rdar://problem/22596272>
-
-            Reviewed by Tim Horton.
-
-            * media/controls/airplay-picker-expected.txt: Updated.
-            * media/controls/airplay-picker.html: Test button state when there is a device available.
-
-            * media/controls/controls-test-helpers.js:
-            (ControlsTest.prototype.stateForControlsElement): Add an optional parameter to force the flushed
-              state to be flushed.
-            (ControlsTest.prototype.contains): New.
-            (ControlsTest.prototype.doesNotContain): Ditto.
-
-            * platform/mac/TestExpectations: Skipped new tests on older versions of OS X.
-
 2016-01-13  Matthew Hanson  <matthew_han...@apple.com>
 
         Merge r194927. rdar://problem/24101254

Modified: branches/safari-601-branch/LayoutTests/platform/mac/TestExpectations (195377 => 195378)


--- branches/safari-601-branch/LayoutTests/platform/mac/TestExpectations	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/LayoutTests/platform/mac/TestExpectations	2016-01-20 22:18:49 UTC (rev 195378)
@@ -1373,11 +1373,6 @@
 webkit.org/b/149774 css3/font-variant-font-face-all.html [ Pass Failure ImageOnlyFailure ] 
 webkit.org/b/149774 css3/font-variant-font-face-override.html [ Pass Failure ImageOnlyFailure ] 
 
-# AppleTV not supported on Mavericks or Yosemite
-[ Mavericks Yosemite ] media/controls/airplay-picker.html
-
-webkit.org/b/150956 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/event_loadeddata.html [ Pass Timeout ]
-
 # Yosemite and El Capitan do not support font feature coverage queries.
 [ Yosemite ElCapitan ] css3/font-variant-small-caps-synthesis-coverage.html [ ImageOnlyFailure ]
 [ Yosemite ElCapitan ] css3/font-variant-petite-caps-synthesis-coverage.html [ ImageOnlyFailure ]

Modified: branches/safari-601-branch/Source/WebCore/ChangeLog (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/ChangeLog	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/ChangeLog	2016-01-20 22:18:49 UTC (rev 195378)
@@ -1,5 +1,9 @@
 2016-01-20  Matthew Hanson  <matthew_han...@apple.com>
 
+        Rollout r192200 via r195067. rdar://problem/24154288
+
+2016-01-20  Matthew Hanson  <matthew_han...@apple.com>
+
         Rollout r195068. rdar://problem/24154288
 
 2016-01-14  Matthew Hanson  <matthew_han...@apple.com>
@@ -43,135 +47,6 @@
 
 2016-01-14  Matthew Hanson  <matthew_han...@apple.com>
 
-        Merge r192200. rdar://problem/24154288
-
-    2015-11-09  Eric Carlson  <eric.carl...@apple.com>
-
-            [Mac] Add a mock AppleTV device for testing
-            https://bugs.webkit.org/show_bug.cgi?id=148912
-            <rdar://problem/22596272>
-
-            Reviewed by Tim Horton.
-
-            No new tests, updated media/controls/airplay-picker.html.
-
-            * Modules/mediasession/WebMediaSessionManager.cpp:
-            (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerEnabled): New, enable or disable
-              the mock picker.
-            (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerState): New, set mock picker state.
-            (WebCore::WebMediaSessionManager::mockPicker): New.
-            (WebCore::WebMediaSessionManager::targetPicker): Return the platform or mock picker, as per settings.
-            (WebCore::webMediaSessionManagerOverride): Deleted.
-            (WebCore::WebMediaSessionManager::shared): Deleted.
-            (WebCore::WebMediaSessionManager::setWebMediaSessionManagerOverride): Deleted.
-            * Modules/mediasession/WebMediaSessionManager.h:
-
-            * WebCore.xcodeproj/project.pbxproj: Add MediaPlaybackTargetPickerMock.* and MediaPlaybackTargetMock.*.
-
-            * page/ChromeClient.h: add setMockMediaPlaybackTargetPickerEnabled and setMockMediaPlaybackTargetPickerState.
-
-            * page/Page.cpp:
-            (WebCore::Page::playbackTargetPickerClientStateDidChange):
-            (WebCore::Page::setMockMediaPlaybackTargetPickerEnabled): New.
-            (WebCore::Page::setMockMediaPlaybackTargetPickerState): New.
-            (WebCore::Page::setPlaybackTarget):
-            * page/Page.h:
-
-            * platform/graphics/MediaPlaybackTarget.h:
-            (WebCore::noMediaPlaybackTargetContext):
-            (WebCore::MediaPlaybackTarget::~MediaPlaybackTarget):
-            (WebCore::MediaPlaybackTarget::deviceName):
-            (WebCore::MediaPlaybackTarget::MediaPlaybackTarget):
-
-            * platform/graphics/MediaPlaybackTargetContext.h: Make a class instead of a struct.
-            (WebCore::MediaPlaybackTargetContext::MediaPlaybackTargetContext):
-            (WebCore::MediaPlaybackTargetContext::type):
-            (WebCore::MediaPlaybackTargetContext::mockDeviceName):
-            (WebCore::MediaPlaybackTargetContext::mockState):
-            (WebCore::MediaPlaybackTargetContext::avOutputContext):
-            (WebCore::MediaPlaybackTargetContext::encodingRequiresPlatformData):
-
-            * platform/graphics/MediaPlaybackTargetPicker.cpp: Move much of the code from MediaPlaybackTargetMac.mm
-              here so it can be the base class.
-            (WebCore::MediaPlaybackTargetPicker::MediaPlaybackTargetPicker):
-            (WebCore::MediaPlaybackTargetPicker::~MediaPlaybackTargetPicker):
-            (WebCore::MediaPlaybackTargetPicker::pendingActionTimerFired):
-            (WebCore::MediaPlaybackTargetPicker::addPendingAction):
-            (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker):
-            * platform/graphics/MediaPlaybackTargetPicker.h:
-            (WebCore::MediaPlaybackTargetPicker::availableDevicesDidChange):
-            (WebCore::MediaPlaybackTargetPicker::currentDeviceDidChange):
-            (WebCore::MediaPlaybackTargetPicker::client):
-            (WebCore::MediaPlaybackTargetPicker::setClient):
-
-            * platform/graphics/avfoundation/MediaPlaybackTargetMac.h:
-            (WebCore::MediaPlaybackTargetMac::outputContext):
-            (WebCore::MediaPlaybackTargetMac::targetType): Deleted.
-            * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
-            (WebCore::MediaPlaybackTargetMac::targetContext):
-            (WebCore::MediaPlaybackTargetMac::hasActiveRoute):
-            (WebCore::MediaPlaybackTargetMac::deviceName):
-
-            * platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp:
-            (WebCore::WebMediaSessionManager::shared): Renamed from platformManager.
-            (WebCore::WebMediaSessionManagerMac::platformPicker): Renamed from targetPicker.
-            (WebCore::WebMediaSessionManager::platformManager): Deleted.
-            (WebCore::WebMediaSessionManagerMac::targetPicker): Deleted.
-            * platform/graphics/avfoundation/WebMediaSessionManagerMac.h:
-
-            * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
-            * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
-            (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac):
-            (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac):
-            (WebCore::MediaPlaybackTargetPickerMac::externalOutputDeviceAvailable):
-            (WebCore::MediaPlaybackTargetPickerMac::playbackTarget):
-            (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
-            (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
-            (WebCore::MediaPlaybackTargetPickerMac::startingMonitoringPlaybackTargets):
-            (WebCore::MediaPlaybackTargetPickerMac::pendingActionTimerFired): Deleted.
-            (WebCore::MediaPlaybackTargetPickerMac::availableDevicesDidChange): Deleted.
-            (WebCore::MediaPlaybackTargetPickerMac::addPendingAction): Deleted.
-            (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange): Deleted.
-
-            * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
-            * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
-            (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless): Add support for
-              mock target.
-            (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName): Ditto.
-            (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Ditto.
-            (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): Ditto.
-
-            * platform/mock/MediaPlaybackTargetMock.cpp: Added.
-            (WebCore::MediaPlaybackTargetMock::create):
-            (WebCore::MediaPlaybackTargetMock::MediaPlaybackTargetMock):
-            (WebCore::MediaPlaybackTargetMock::~MediaPlaybackTargetMock):
-            (WebCore::MediaPlaybackTargetMock::targetContext):
-            (WebCore::toMediaPlaybackTargetMock):
-            * platform/mock/MediaPlaybackTargetMock.h: Added.
-
-            * platform/mock/MediaPlaybackTargetPickerMock.cpp: Added.
-            (WebCore::MediaPlaybackTargetPickerMock::create):
-            (WebCore::MediaPlaybackTargetPickerMock::MediaPlaybackTargetPickerMock):
-            (WebCore::MediaPlaybackTargetPickerMock::~MediaPlaybackTargetPickerMock):
-            (WebCore::MediaPlaybackTargetPickerMock::externalOutputDeviceAvailable):
-            (WebCore::MediaPlaybackTargetPickerMock::playbackTarget):
-            (WebCore::MediaPlaybackTargetPickerMock::timerFired):
-            (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
-            (WebCore::MediaPlaybackTargetPickerMock::startingMonitoringPlaybackTargets):
-            (WebCore::MediaPlaybackTargetPickerMock::stopMonitoringPlaybackTargets):
-            (WebCore::MediaPlaybackTargetPickerMock::invalidatePlaybackTargets):
-            (WebCore::MediaPlaybackTargetPickerMock::setState):
-            * platform/mock/MediaPlaybackTargetPickerMock.h: Added.
-
-            * testing/Internals.cpp:
-            (WebCore::Internals::Internals):
-            (WebCore::Internals::setMockMediaPlaybackTargetPickerEnabled):
-            (WebCore::Internals::setMockMediaPlaybackTargetPickerState):
-            * testing/Internals.h:
-            * testing/Internals.idl:
-
-2016-01-14  Matthew Hanson  <matthew_han...@apple.com>
-
         Merge r189135. rdar://problem/24154288
 
     2015-08-28  Eric Carlson  <eric.carl...@apple.com>

Modified: branches/safari-601-branch/Source/WebCore/Modules/mediasession/WebMediaSessionManager.cpp (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/Modules/mediasession/WebMediaSessionManager.cpp	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/Modules/mediasession/WebMediaSessionManager.cpp	2016-01-20 22:18:49 UTC (rev 195378)
@@ -30,7 +30,7 @@
 
 #include "FloatRect.h"
 #include "Logging.h"
-#include "MediaPlaybackTargetPickerMock.h"
+#include "MediaPlaybackTargetPickerMac.h"
 #include "WebMediaSessionManagerClient.h"
 #include <wtf/text/StringBuilder.h>
 
@@ -89,39 +89,25 @@
 }
 #endif
 
-void WebMediaSessionManager::setMockMediaPlaybackTargetPickerEnabled(bool enabled)
+static WebMediaSessionManager*& webMediaSessionManagerOverride()
 {
-    LOG(Media, "WebMediaSessionManager::setMockMediaPlaybackTargetPickerEnabled - enabled = %i", (int)enabled);
-
-    if (m_mockPickerEnabled == enabled)
-        return;
-
-    m_mockPickerEnabled = enabled;
+    static WebMediaSessionManager* override;
+    return override;
 }
 
-void WebMediaSessionManager::setMockMediaPlaybackTargetPickerState(const String& name, MediaPlaybackTargetContext::State state)
+WebMediaSessionManager& WebMediaSessionManager::shared()
 {
-    LOG(Media, "WebMediaSessionManager::setMockMediaPlaybackTargetPickerState - name = %s, state = %i", name.utf8().data(), (int)state);
+    if (WebMediaSessionManager* override = webMediaSessionManagerOverride())
+        return *override;
 
-    mockPicker().setState(name, state);
+    return WebMediaSessionManager::platformManager();
 }
 
-MediaPlaybackTargetPickerMock& WebMediaSessionManager::mockPicker()
+void WebMediaSessionManager::setWebMediaSessionManagerOverride(WebMediaSessionManager* manager)
 {
-    if (!m_pickerOverride)
-        m_pickerOverride = MediaPlaybackTargetPickerMock::create(*this);
-
-    return *m_pickerOverride.get();
+    webMediaSessionManagerOverride() = manager;
 }
 
-WebCore::MediaPlaybackTargetPicker& WebMediaSessionManager::targetPicker()
-{
-    if (m_mockPickerEnabled)
-        return mockPicker();
-
-    return platformPicker();
-}
-
 WebMediaSessionManager::WebMediaSessionManager()
     : m_taskTimer(RunLoop::current(), this, &WebMediaSessionManager::taskTimerFired)
     , m_watchdogTimer(RunLoop::current(), this, &WebMediaSessionManager::watchdogTimerFired)

Modified: branches/safari-601-branch/Source/WebCore/Modules/mediasession/WebMediaSessionManager.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/Modules/mediasession/WebMediaSessionManager.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/Modules/mediasession/WebMediaSessionManager.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -28,9 +28,7 @@
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
 
-#include "MediaPlaybackTargetContext.h"
 #include "MediaPlaybackTargetPicker.h"
-#include "MediaPlaybackTargetPickerMock.h"
 #include "MediaProducer.h"
 #include "Timer.h"
 #include <wtf/Ref.h>
@@ -48,10 +46,8 @@
 public:
 
     WEBCORE_EXPORT static WebMediaSessionManager& shared();
+    WEBCORE_EXPORT static void setWebMediaSessionManagerOverride(WebMediaSessionManager*);
 
-    WEBCORE_EXPORT void setMockMediaPlaybackTargetPickerEnabled(bool);
-    WEBCORE_EXPORT void setMockMediaPlaybackTargetPickerState(const String&, MediaPlaybackTargetContext::State);
-
     WEBCORE_EXPORT uint64_t addPlaybackTargetPickerClient(WebMediaSessionManagerClient&, uint64_t);
     WEBCORE_EXPORT void removePlaybackTargetPickerClient(WebMediaSessionManagerClient&, uint64_t);
     WEBCORE_EXPORT void removeAllPlaybackTargetPickerClients(WebMediaSessionManagerClient&);
@@ -62,14 +58,11 @@
     WebMediaSessionManager();
     virtual ~WebMediaSessionManager();
 
-    virtual WebCore::MediaPlaybackTargetPicker& platformPicker() = 0;
+    virtual WebCore::MediaPlaybackTargetPicker& targetPicker() = 0;
     static WebMediaSessionManager& platformManager();
 
 private:
 
-    WebCore::MediaPlaybackTargetPicker& targetPicker();
-    WebCore::MediaPlaybackTargetPickerMock& mockPicker();
-
     // MediaPlaybackTargetPicker::Client
     virtual void setPlaybackTarget(Ref<WebCore::MediaPlaybackTarget>&&) override;
     virtual void externalOutputDeviceAvailableDidChange(bool) override;
@@ -101,12 +94,10 @@
 
     Vector<std::unique_ptr<ClientState>> m_clientState;
     RefPtr<MediaPlaybackTarget> m_playbackTarget;
-    std::unique_ptr<WebCore::MediaPlaybackTargetPickerMock> m_pickerOverride;
     ConfigurationTasks m_taskFlags { NoTask };
     double m_currentWatchdogInterval { 0 };
     bool m_externalOutputDeviceAvailable { false };
     bool m_targetChanged { false };
-    bool m_mockPickerEnabled { false };
 };
 
 } // namespace WebCore

Modified: branches/safari-601-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-01-20 22:18:49 UTC (rev 195378)
@@ -204,10 +204,6 @@
 		077AF14018F4AE400001ED61 /* SerializedPlatformRepresentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 077AF13E18F4AE400001ED61 /* SerializedPlatformRepresentation.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		077AF14318F4B1BB0001ED61 /* SerializedPlatformRepresentationMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 077AF14118F4B1BB0001ED61 /* SerializedPlatformRepresentationMac.h */; };
 		077AF14418F4B1BB0001ED61 /* SerializedPlatformRepresentationMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 077AF14218F4B1BB0001ED61 /* SerializedPlatformRepresentationMac.mm */; };
-		077B64121B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 077B64101B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.cpp */; };
-		077B64131B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 077B64111B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		077B64161B95F703003E9AD5 /* MediaPlaybackTargetMock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 077B64141B95F703003E9AD5 /* MediaPlaybackTargetMock.cpp */; };
-		077B64171B95F703003E9AD5 /* MediaPlaybackTargetMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 077B64151B95F703003E9AD5 /* MediaPlaybackTargetMock.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		0783228418013ED800999E0C /* MediaStreamAudioSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0783228218013ED700999E0C /* MediaStreamAudioSource.cpp */; };
 		0783228518013ED800999E0C /* MediaStreamAudioSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 0783228318013ED800999E0C /* MediaStreamAudioSource.h */; };
 		07846342145B151A00A58DF1 /* JSTrackEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07846340145B151A00A58DF1 /* JSTrackEvent.cpp */; };
@@ -7381,10 +7377,6 @@
 		077AF13E18F4AE400001ED61 /* SerializedPlatformRepresentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SerializedPlatformRepresentation.h; sourceTree = "<group>"; };
 		077AF14118F4B1BB0001ED61 /* SerializedPlatformRepresentationMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SerializedPlatformRepresentationMac.h; sourceTree = "<group>"; };
 		077AF14218F4B1BB0001ED61 /* SerializedPlatformRepresentationMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SerializedPlatformRepresentationMac.mm; sourceTree = "<group>"; };
-		077B64101B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaPlaybackTargetPickerMock.cpp; sourceTree = "<group>"; };
-		077B64111B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlaybackTargetPickerMock.h; sourceTree = "<group>"; };
-		077B64141B95F703003E9AD5 /* MediaPlaybackTargetMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaPlaybackTargetMock.cpp; sourceTree = "<group>"; };
-		077B64151B95F703003E9AD5 /* MediaPlaybackTargetMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlaybackTargetMock.h; sourceTree = "<group>"; };
 		0783228218013ED700999E0C /* MediaStreamAudioSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamAudioSource.cpp; sourceTree = "<group>"; };
 		0783228318013ED800999E0C /* MediaStreamAudioSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamAudioSource.h; sourceTree = "<group>"; };
 		07846340145B151A00A58DF1 /* JSTrackEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTrackEvent.cpp; sourceTree = "<group>"; };
@@ -16629,10 +16621,6 @@
 				59309A1211F4AE6A00250603 /* DeviceOrientationClientMock.h */,
 				073794DF19EE2D1B00E5A045 /* MediaConstraintsMock.cpp */,
 				073794E019EE2D1B00E5A045 /* MediaConstraintsMock.h */,
-				077B64141B95F703003E9AD5 /* MediaPlaybackTargetMock.cpp */,
-				077B64151B95F703003E9AD5 /* MediaPlaybackTargetMock.h */,
-				077B64101B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.cpp */,
-				077B64111B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.h */,
 				4A0FFA9B1AAF5E6C0062803B /* MockRealtimeMediaSourceCenter.cpp */,
 				4A0FFA9C1AAF5E6C0062803B /* MockRealtimeMediaSourceCenter.h */,
 				AAE27B7416CBFC0D00623043 /* PlatformSpeechSynthesizerMock.cpp */,
@@ -25112,7 +25100,6 @@
 				A81369D0097374F600D74463 /* HTMLFormElement.h in Headers */,
 				A871DE2B0A152AC800B12A68 /* HTMLFrameElement.h in Headers */,
 				14FFE31D0AE1963300136BF5 /* HTMLFrameElementBase.h in Headers */,
-				077B64171B95F703003E9AD5 /* MediaPlaybackTargetMock.h in Headers */,
 				93E241FF0B2B4E4000C732A1 /* HTMLFrameOwnerElement.h in Headers */,
 				A871DE280A152AC800B12A68 /* HTMLFrameSetElement.h in Headers */,
 				A871DE2D0A152AC800B12A68 /* HTMLHeadElement.h in Headers */,
@@ -25879,7 +25866,6 @@
 				49C7B9941042D2D30009D447 /* JSWebGLBuffer.h in Headers */,
 				7EA30F6A16DFFE7500257D0B /* JSWebGLCompressedTextureATC.h in Headers */,
 				7EA30F6A17EFFE7500257D0B /* JSWebGLCompressedTexturePVRTC.h in Headers */,
-				077B64131B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.h in Headers */,
 				6E3FAD3914733F4000E42306 /* JSWebGLCompressedTextureS3TC.h in Headers */,
 				6EE8A77310F803F3005A4A24 /* JSWebGLContextAttributes.h in Headers */,
 				BC2CBF4E140F1ABD003879BE /* JSWebGLContextEvent.h in Headers */,
@@ -28829,7 +28815,6 @@
 				F3D4C47812E07663003DA150 /* InspectorDOMDebuggerAgent.cpp in Sources */,
 				7A74ECBA101839A600BF939E /* InspectorDOMStorageAgent.cpp in Sources */,
 				F344C75811294FF600F26EEE /* InspectorFrontendClientLocal.cpp in Sources */,
-				077B64161B95F703003E9AD5 /* MediaPlaybackTargetMock.cpp in Sources */,
 				7A0E770E10C00A8800A0276E /* InspectorFrontendHost.cpp in Sources */,
 				7A54857F14E02D51006AE05A /* InspectorHistory.cpp in Sources */,
 				7ACD88D314C08BD60084EDD2 /* InspectorIndexedDBAgent.cpp in Sources */,
@@ -30559,7 +30544,6 @@
 				070334D9145A006F008D8D45 /* TrackBase.cpp in Sources */,
 				070334D31459FFAD008D8D45 /* TrackEvent.cpp in Sources */,
 				BE88E0C11715CE2600658D98 /* TrackListBase.cpp in Sources */,
-				077B64121B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.cpp in Sources */,
 				FFAC30FF184FB145008C4F1E /* TrailingObjects.cpp in Sources */,
 				49E911C30EF86D47009D0CAF /* TransformationMatrix.cpp in Sources */,
 				494BC40D12AEDD9E00743BD2 /* TransformationMatrixCA.cpp in Sources */,

Modified: branches/safari-601-branch/Source/WebCore/page/ChromeClient.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/page/ChromeClient.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/page/ChromeClient.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -51,10 +51,6 @@
 }
 #endif
 
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-#include "MediaPlaybackTargetContext.h"
-#endif
-
 #if PLATFORM(IOS)
 #include "PlatformLayer.h"
 #define NSResponder WAKResponder
@@ -451,8 +447,6 @@
     virtual void removePlaybackTargetPickerClient(uint64_t /*contextId*/) { }
     virtual void showPlaybackTargetPicker(uint64_t /*contextId*/, const WebCore::IntPoint&, bool /* isVideo */) { }
     virtual void playbackTargetPickerClientStateDidChange(uint64_t /*contextId*/, MediaProducer::MediaStateFlags) { }
-    virtual void setMockMediaPlaybackTargetPickerEnabled(bool)  { }
-    virtual void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State) { }
 #endif
 
 #if ENABLE(VIDEO)

Modified: branches/safari-601-branch/Source/WebCore/page/Page.cpp (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/page/Page.cpp	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/page/Page.cpp	2016-01-20 22:18:49 UTC (rev 195378)
@@ -1710,16 +1710,6 @@
     chrome().client().playbackTargetPickerClientStateDidChange(contextId, state);
 }
 
-void Page::setMockMediaPlaybackTargetPickerEnabled(bool enabled)
-{
-    chrome().client().setMockMediaPlaybackTargetPickerEnabled(enabled);
-}
-
-void Page::setMockMediaPlaybackTargetPickerState(const String& name, MediaPlaybackTargetContext::State state)
-{
-    chrome().client().setMockMediaPlaybackTargetPickerState(name, state);
-}
-
 void Page::setPlaybackTarget(uint64_t contextId, Ref<MediaPlaybackTarget>&& target)
 {
     for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext())

Modified: branches/safari-601-branch/Source/WebCore/page/Page.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/page/Page.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/page/Page.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -58,10 +58,6 @@
 #include "MediaEventTypes.h"
 #endif
 
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-#include "MediaPlaybackTargetContext.h"
-#endif
-
 namespace JSC {
 class Debugger;
 }
@@ -452,10 +448,8 @@
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
     void addPlaybackTargetPickerClient(uint64_t);
     void removePlaybackTargetPickerClient(uint64_t);
-    void showPlaybackTargetPicker(uint64_t, const IntPoint&, bool);
+    void showPlaybackTargetPicker(uint64_t, const WebCore::IntPoint&, bool);
     void playbackTargetPickerClientStateDidChange(uint64_t, MediaProducer::MediaStateFlags);
-    WEBCORE_EXPORT void setMockMediaPlaybackTargetPickerEnabled(bool);
-    WEBCORE_EXPORT void setMockMediaPlaybackTargetPickerState(const String&, MediaPlaybackTargetContext::State);
 
     WEBCORE_EXPORT void setPlaybackTarget(uint64_t, Ref<MediaPlaybackTarget>&&);
     WEBCORE_EXPORT void playbackTargetAvailabilityDidChange(uint64_t, bool);

Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/MediaPlaybackTarget.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/platform/graphics/MediaPlaybackTarget.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/MediaPlaybackTarget.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -29,17 +29,10 @@
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
 
 #include "MediaPlaybackTargetContext.h"
-#include <wtf/NeverDestroyed.h>
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
 
-static const MediaPlaybackTargetContext& noMediaPlaybackTargetContext()
-{
-    static NeverDestroyed<MediaPlaybackTargetContext> context;
-    return context;
-}
-
 class MediaPlaybackTarget : public RefCounted<MediaPlaybackTarget> {
 public:
     virtual ~MediaPlaybackTarget() { }
@@ -47,13 +40,11 @@
     enum TargetType {
         None,
         AVFoundation,
-        Mock,
     };
     virtual TargetType targetType() const { return None; }
 
-    virtual const MediaPlaybackTargetContext& targetContext() const { return noMediaPlaybackTargetContext(); }
+    virtual const MediaPlaybackTargetContext& targetContext() const { return NoMediaPlaybackTargetContext; }
     virtual bool hasActiveRoute() const { return false; }
-    virtual String deviceName() const { return emptyString(); }
 
 protected:
     MediaPlaybackTarget() { }

Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/MediaPlaybackTargetContext.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/platform/graphics/MediaPlaybackTargetContext.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/MediaPlaybackTargetContext.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -28,8 +28,6 @@
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
 
-#include <wtf/text/WTFString.h>
-
 OBJC_CLASS AVOutputContext;
 
 #if PLATFORM(COCOA)
@@ -39,67 +37,22 @@
 
 namespace WebCore {
 
-class MediaPlaybackTargetContext {
-public:
-    enum Type : int32_t {
+struct MediaPlaybackTargetContext {
+
+    enum ContextType : int32_t {
         None,
         AVOutputContextType,
-        MockType,
-    };
+    } type;
 
-    enum ContextState {
-        Unavailable = 0,
-        OutputDeviceAvailable = 1 << 0,
-    };
-    typedef unsigned State;
+    union {
+        AVOutputContext* avOutputContext;
+    } context;
 
-    MediaPlaybackTargetContext()
-        : m_type(None)
-    {
-    }
-
-    MediaPlaybackTargetContext(AVOutputContext *outputContext)
-        : m_type(AVOutputContextType)
-        , m_outputContext(outputContext)
-    {
-    }
-
-    MediaPlaybackTargetContext(const String& name, State state)
-        : m_type(MockType)
-        , m_name(name)
-        , m_state(state)
-    {
-    }
-
-    Type type() const { return m_type; }
-
-    const String& mockDeviceName() const
-    {
-        ASSERT(m_type == MockType);
-        return m_name;
-    }
-
-    State mockState() const
-    {
-        ASSERT(m_type == MockType);
-        return m_state;
-    }
-
-    AVOutputContext *avOutputContext() const
-    {
-        ASSERT(m_type == AVOutputContextType);
-        return m_outputContext;
-    }
-
-    bool encodingRequiresPlatformData() const { return m_type == AVOutputContextType; }
-    
-private:
-    Type m_type { None };
-    AVOutputContext *m_outputContext { nullptr };
-    String m_name;
-    State m_state { Unavailable };
+    bool encodingRequiresPlatformData() const { return type == AVOutputContextType; }
 };
 
+const MediaPlaybackTargetContext NoMediaPlaybackTargetContext = { MediaPlaybackTargetContext::None, {nullptr} };
+
 }
 
 #endif // ENABLE(WIRELESS_PLAYBACK_TARGET)

Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.cpp (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.cpp	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.cpp	2016-01-20 22:18:49 UTC (rev 195378)
@@ -28,48 +28,18 @@
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
 
-#include "Logging.h"
-#include "MediaPlaybackTarget.h"
-
 namespace WebCore {
 
-static const double pendingActionInterval = 1.0 / 10.0;
-
 MediaPlaybackTargetPicker::MediaPlaybackTargetPicker(Client& client)
     : m_client(&client)
-    , m_pendingActionTimer(RunLoop::main(), this, &MediaPlaybackTargetPicker::pendingActionTimerFired)
 {
 }
 
 MediaPlaybackTargetPicker::~MediaPlaybackTargetPicker()
 {
-    m_pendingActionTimer.stop();
     m_client = nullptr;
 }
 
-void MediaPlaybackTargetPicker::pendingActionTimerFired()
-{
-    LOG(Media, "MediaPlaybackTargetPicker::pendingActionTimerFired - flags = 0x%x", m_pendingActionFlags);
-
-    PendingActionFlags pendingActions = m_pendingActionFlags;
-    m_pendingActionFlags = 0;
-
-    if (pendingActions & CurrentDeviceDidChange)
-        m_client->setPlaybackTarget(playbackTarget());
-
-    if (pendingActions & OutputDeviceAvailabilityChanged)
-        m_client->externalOutputDeviceAvailableDidChange(externalOutputDeviceAvailable());
-}
-
-void MediaPlaybackTargetPicker::addPendingAction(PendingActionFlags action)
-{
-    if (!m_client)
-        return;
-
-    m_pendingActionFlags |= action;
-    m_pendingActionTimer.startOneShot(pendingActionInterval);
-}
-
 void MediaPlaybackTargetPicker::showPlaybackTargetPicker(const FloatRect&, bool)
 {
     ASSERT_NOT_REACHED();

Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -29,7 +29,6 @@
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
 
 #include <wtf/Ref.h>
-#include <wtf/RunLoop.h>
 
 namespace WebCore {
 
@@ -56,30 +55,10 @@
     virtual void stopMonitoringPlaybackTargets();
     virtual void invalidatePlaybackTargets();
 
-    void availableDevicesDidChange() { addPendingAction(OutputDeviceAvailabilityChanged); }
-    void currentDeviceDidChange() { addPendingAction(CurrentDeviceDidChange); }
-
 protected:
     explicit MediaPlaybackTargetPicker(Client&);
 
-    enum ActionType {
-        OutputDeviceAvailabilityChanged = 1 << 0,
-        CurrentDeviceDidChange = 1 << 1,
-    };
-    typedef unsigned PendingActionFlags;
-
-    void addPendingAction(PendingActionFlags);
-    void pendingActionTimerFired();
-    Client* client() const { return m_client; }
-    void setClient(Client* client) { m_client = client; }
-
-private:
-    virtual bool externalOutputDeviceAvailable() = 0;
-    virtual Ref<MediaPlaybackTarget> playbackTarget() = 0;
-
-    PendingActionFlags m_pendingActionFlags { 0 };
     Client* m_client;
-    RunLoop::Timer<MediaPlaybackTargetPicker> m_pendingActionTimer;
 };
 
 } // namespace WebCore

Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlaybackTargetMac.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlaybackTargetMac.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlaybackTargetMac.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -39,13 +39,11 @@
 
     virtual ~MediaPlaybackTargetMac();
 
-    TargetType targetType() const override { return AVFoundation; }
+    virtual TargetType targetType() const { return AVFoundation; }
 
-    const MediaPlaybackTargetContext& targetContext() const override;
-    bool hasActiveRoute() const override;
+    virtual const MediaPlaybackTargetContext& targetContext() const;
+    virtual bool hasActiveRoute() const;
 
-    String deviceName() const override;
-
     AVOutputContext *outputContext() const { return m_outputContext.get(); }
 
 protected:
@@ -53,7 +51,6 @@
 
     RetainPtr<AVOutputContext> m_outputContext;
     mutable MediaPlaybackTargetContext m_context;
-    String m_deviceName;
 };
 
 MediaPlaybackTargetMac* toMediaPlaybackTargetMac(MediaPlaybackTarget*);

Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlaybackTargetMac.mm (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlaybackTargetMac.mm	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlaybackTargetMac.mm	2016-01-20 22:18:49 UTC (rev 195378)
@@ -54,7 +54,9 @@
 
 const MediaPlaybackTargetContext& MediaPlaybackTargetMac::targetContext() const
 {
-    m_context = MediaPlaybackTargetContext(m_outputContext.get());
+    m_context.type = MediaPlaybackTargetContext::AVOutputContextType;
+    m_context.context.avOutputContext = m_outputContext.get();
+
     return m_context;
 }
 
@@ -63,14 +65,7 @@
     return m_outputContext && m_outputContext.get().deviceName;
 }
 
-String MediaPlaybackTargetMac::deviceName() const
-{
-    if (m_outputContext)
-        return m_outputContext.get().deviceName;
 
-    return emptyString();
-}
-
 MediaPlaybackTargetMac* toMediaPlaybackTargetMac(MediaPlaybackTarget* rep)
 {
     return const_cast<MediaPlaybackTargetMac*>(toMediaPlaybackTargetMac(const_cast<const MediaPlaybackTarget*>(rep)));

Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp	2016-01-20 22:18:49 UTC (rev 195378)
@@ -33,7 +33,7 @@
 
 namespace WebCore {
 
-WebMediaSessionManager& WebMediaSessionManager::shared()
+WebMediaSessionManager& WebMediaSessionManager::platformManager()
 {
     static NeverDestroyed<WebMediaSessionManagerMac> sharedManager;
     return sharedManager;
@@ -48,7 +48,7 @@
 {
 }
 
-WebCore::MediaPlaybackTargetPicker& WebMediaSessionManagerMac::platformPicker()
+WebCore::MediaPlaybackTargetPicker& WebMediaSessionManagerMac::targetPicker()
 {
     if (!m_targetPicker)
         m_targetPicker = MediaPlaybackTargetPickerMac::create(*this);

Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/WebMediaSessionManagerMac.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/WebMediaSessionManagerMac.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/WebMediaSessionManagerMac.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -40,7 +40,7 @@
     WebMediaSessionManagerMac();
     virtual ~WebMediaSessionManagerMac();
 
-    virtual WebCore::MediaPlaybackTargetPicker& platformPicker();
+    virtual WebCore::MediaPlaybackTargetPicker& targetPicker();
 
     std::unique_ptr<WebCore::MediaPlaybackTargetPicker> m_targetPicker;
 };

Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -30,6 +30,7 @@
 
 #include "MediaPlaybackTargetPicker.h"
 #include <wtf/RetainPtr.h>
+#include <wtf/RunLoop.h>
 
 OBJC_CLASS AVOutputDeviceMenuController;
 OBJC_CLASS WebAVOutputDeviceMenuControllerHelper;
@@ -48,16 +49,27 @@
     void stopMonitoringPlaybackTargets() override;
     void invalidatePlaybackTargets() override;
 
+    void availableDevicesDidChange();
+    void currentDeviceDidChange();
+
 private:
     explicit MediaPlaybackTargetPickerMac(MediaPlaybackTargetPicker::Client&);
 
-    bool externalOutputDeviceAvailable() override;
-    Ref<MediaPlaybackTarget> playbackTarget() override;
-
     AVOutputDeviceMenuController *devicePicker();
 
+    enum ActionType {
+        OutputDeviceAvailabilityChanged = 1 << 0,
+        CurrentDeviceDidChange = 1 << 1,
+    };
+    typedef unsigned PendingActionFlags;
+
+    void addPendingAction(PendingActionFlags);
+    void pendingActionTimerFired();
+
+    PendingActionFlags m_pendingActionFlags { 0 };
     RetainPtr<AVOutputDeviceMenuController> m_outputDeviceMenuController;
     RetainPtr<WebAVOutputDeviceMenuControllerHelper> m_outputDeviceMenuControllerDelegate;
+    RunLoop::Timer<MediaPlaybackTargetPickerMac> m_pendingActionTimer;
     bool m_showingMenu { false };
 };
 

Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm	2016-01-20 22:18:49 UTC (rev 195378)
@@ -67,6 +67,8 @@
 
 namespace WebCore {
 
+static const double pendingActionInterval = 1.0 / 10.0;
+
 std::unique_ptr<MediaPlaybackTargetPickerMac> MediaPlaybackTargetPickerMac::create(MediaPlaybackTargetPicker::Client& client)
 {
     return std::unique_ptr<MediaPlaybackTargetPickerMac>(new MediaPlaybackTargetPickerMac(client));
@@ -75,25 +77,47 @@
 MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac(MediaPlaybackTargetPicker::Client& client)
     : MediaPlaybackTargetPicker(client)
     , m_outputDeviceMenuControllerDelegate(adoptNS([[WebAVOutputDeviceMenuControllerHelper alloc] initWithCallback:this]))
+    , m_pendingActionTimer(RunLoop::main(), this, &MediaPlaybackTargetPickerMac::pendingActionTimerFired)
 {
 }
 
 MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac()
 {
-    setClient(nullptr);
+    m_client = nullptr;
+    m_pendingActionTimer.stop();
     [m_outputDeviceMenuControllerDelegate clearCallback];
+
+    stopMonitoringPlaybackTargets();
 }
 
-bool MediaPlaybackTargetPickerMac::externalOutputDeviceAvailable()
+void MediaPlaybackTargetPickerMac::pendingActionTimerFired()
 {
-    return devicePicker().externalOutputDeviceAvailable;
+    LOG(Media, "MediaPlaybackTargetPickerMac::pendingActionTimerFired - flags = 0x%x", m_pendingActionFlags);
+
+    if (!m_client)
+        return;
+
+    PendingActionFlags pendingActions = m_pendingActionFlags;
+    m_pendingActionFlags = 0;
+
+    if (pendingActions & CurrentDeviceDidChange) {
+        AVOutputContext* context = m_outputDeviceMenuController ? [m_outputDeviceMenuController.get() outputContext] : nullptr;
+        m_client->setPlaybackTarget(WebCore::MediaPlaybackTargetMac::create(context));
+    }
+
+    if (pendingActions & OutputDeviceAvailabilityChanged)
+        m_client->externalOutputDeviceAvailableDidChange(devicePicker().externalOutputDeviceAvailable);
+
 }
 
-Ref<MediaPlaybackTarget> MediaPlaybackTargetPickerMac::playbackTarget()
+void MediaPlaybackTargetPickerMac::availableDevicesDidChange()
 {
-    AVOutputContext* context = m_outputDeviceMenuController ? [m_outputDeviceMenuController.get() outputContext] : nullptr;
+    LOG(Media, "MediaPlaybackTargetPickerMac::availableDevicesDidChange - available = %i", (int)devicePicker().externalOutputDeviceAvailable);
 
-    return WebCore::MediaPlaybackTargetMac::create(context);
+    if (!m_client)
+        return;
+
+    addPendingAction(OutputDeviceAvailabilityChanged);
 }
 
 AVOutputDeviceMenuControllerType *MediaPlaybackTargetPickerMac::devicePicker()
@@ -121,7 +145,7 @@
 
 void MediaPlaybackTargetPickerMac::showPlaybackTargetPicker(const FloatRect& location, bool checkActiveRoute)
 {
-    if (!client() || m_showingMenu)
+    if (!m_client || m_showingMenu)
         return;
 
     LOG(Media, "MediaPlaybackTargetPickerMac::showPlaybackTargetPicker - checkActiveRoute = %i", (int)checkActiveRoute);
@@ -138,6 +162,22 @@
     m_showingMenu = false;
 }
 
+void MediaPlaybackTargetPickerMac::addPendingAction(PendingActionFlags action)
+{
+    m_pendingActionFlags |= action;
+    m_pendingActionTimer.startOneShot(pendingActionInterval);
+}
+
+void MediaPlaybackTargetPickerMac::currentDeviceDidChange()
+{
+    LOG(Media, "MediaPlaybackTargetPickerMac::currentDeviceDidChange");
+
+    if (!m_client)
+        return;
+
+    addPendingAction(CurrentDeviceDidChange);
+}
+
 void MediaPlaybackTargetPickerMac::startingMonitoringPlaybackTargets()
 {
     LOG(Media, "MediaPlaybackTargetPickerMac::startingMonitoringPlaybackTargets");

Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -28,7 +28,6 @@
 
 #if ENABLE(VIDEO) && USE(AVFOUNDATION)
 
-#include "MediaPlaybackTarget.h"
 #include "MediaPlayerPrivateAVFoundation.h"
 #include <wtf/HashMap.h>
 
@@ -65,6 +64,7 @@
 class AudioTrackPrivateAVFObjC;
 class InbandMetadataTextTrackPrivateAVF;
 class InbandTextTrackPrivateAVFObjC;
+class MediaPlaybackTarget;
 class MediaSelectionGroupAVFObjC;
 class VideoTrackPrivateAVFObjC;
 class WebCoreAVFResourceLoader;
@@ -362,7 +362,6 @@
 
 #if PLATFORM(MAC) && ENABLE(WIRELESS_PLAYBACK_TARGET)
     RetainPtr<AVOutputContext> m_outputContext;
-    RefPtr<MediaPlaybackTarget> m_playbackTarget { nullptr };
 #endif
 
     mutable RetainPtr<NSArray> m_cachedSeekableRanges;

Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2016-01-20 22:18:49 UTC (rev 195378)
@@ -48,7 +48,6 @@
 #import "URL.h"
 #import "Logging.h"
 #import "MediaPlaybackTargetMac.h"
-#import "MediaPlaybackTargetMock.h"
 #import "MediaSelectionGroupAVFObjC.h"
 #import "MediaTimeAVFoundation.h"
 #import "PlatformTimeRanges.h"
@@ -2740,19 +2739,10 @@
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
 bool MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless() const
 {
-    bool wirelessTarget = false;
+    if (!m_avPlayer)
+        return false;
 
-#if !PLATFORM(IOS)
-    if (m_playbackTarget) {
-        if (m_playbackTarget->targetType() == MediaPlaybackTarget::AVFoundation)
-            wirelessTarget = m_avPlayer && m_avPlayer.get().externalPlaybackActive;
-        else
-            wirelessTarget = m_shouldPlayToPlaybackTarget && m_playbackTarget->hasActiveRoute();
-    }
-#else
-    wirelessTarget = m_avPlayer && m_avPlayer.get().externalPlaybackActive;
-#endif
-
+    bool wirelessTarget = m_avPlayer.get().externalPlaybackActive;
     LOG(Media, "MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless(%p) - returning %s", this, boolString(wirelessTarget));
 
     return wirelessTarget;
@@ -2788,8 +2778,8 @@
 
     String wirelessTargetName;
 #if !PLATFORM(IOS)
-    if (m_playbackTarget)
-        wirelessTargetName = m_playbackTarget->deviceName();
+    if (m_outputContext)
+        wirelessTargetName = m_outputContext.get().deviceName;
 #else
     wirelessTargetName = wkExernalDeviceDisplayNameForPlayer(m_avPlayer.get());
 #endif
@@ -2824,56 +2814,31 @@
 #if !PLATFORM(IOS)
 void MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget(Ref<MediaPlaybackTarget>&& target)
 {
-    m_playbackTarget = WTF::move(target);
+    MediaPlaybackTargetMac* macTarget = toMediaPlaybackTargetMac(&target.get());
 
-    m_outputContext = m_playbackTarget->targetType() == MediaPlaybackTarget::AVFoundation ? toMediaPlaybackTargetMac(m_playbackTarget.get())->outputContext() : nullptr;
+    m_outputContext = macTarget->outputContext();
+    LOG(Media, "MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget(%p) - target = %p, device name = %s", this, m_outputContext.get(), [m_outputContext.get().deviceName UTF8String]);
 
-    LOG(Media, "MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget(%p) - target = %p, device name = %s", this, m_outputContext.get(), m_playbackTarget->deviceName().utf8().data());
-
-    if (!m_playbackTarget->hasActiveRoute())
+    if (!m_outputContext || !m_outputContext.get().deviceName)
         setShouldPlayToPlaybackTarget(false);
 }
 
 void MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget(bool shouldPlay)
 {
-    if (m_shouldPlayToPlaybackTarget == shouldPlay)
-        return;
-
     m_shouldPlayToPlaybackTarget = shouldPlay;
 
-    if (!m_playbackTarget)
+    AVOutputContext *newContext = shouldPlay ? m_outputContext.get() : nil;
+    LOG(Media, "MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget(%p) - target = %p, shouldPlay = %s", this, newContext, boolString(shouldPlay));
+
+    if (!m_avPlayer)
         return;
 
-    if (m_playbackTarget->targetType() == MediaPlaybackTarget::AVFoundation) {
-        AVOutputContext *newContext = shouldPlay ? m_outputContext.get() : nil;
-
-        LOG(Media, "MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget(%p) - target = %p, shouldPlay = %s", this, newContext, boolString(shouldPlay));
-
-        if (!m_avPlayer)
-            return;
-
-        RetainPtr<AVOutputContext> currentContext = m_avPlayer.get().outputContext;
-        if ((!newContext && !currentContext.get()) || [currentContext.get() isEqual:newContext])
-            return;
-
-        setDelayCallbacks(true);
-        m_avPlayer.get().outputContext = newContext;
-        setDelayCallbacks(false);
-
+    RetainPtr<AVOutputContext> currentContext = m_avPlayer.get().outputContext;
+    if ((!newContext && !currentContext.get()) || [currentContext.get() isEqual:newContext])
         return;
-    }
 
-    ASSERT(m_playbackTarget->targetType() == MediaPlaybackTarget::Mock);
-
-    LOG(Media, "MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget(%p) - target = {Mock}, shouldPlay = %s", this, boolString(shouldPlay));
-
     setDelayCallbacks(true);
-    auto weakThis = createWeakPtr();
-    scheduleMainThreadNotification(MediaPlayerPrivateAVFoundation::Notification([weakThis] {
-        if (!weakThis)
-            return;
-        weakThis->playbackTargetIsWirelessDidChange();
-    }));
+    m_avPlayer.get().outputContext = newContext;
     setDelayCallbacks(false);
 }
 #endif // !PLATFORM(IOS)

Deleted: branches/safari-601-branch/Source/WebCore/platform/mock/MediaPlaybackTargetMock.cpp (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/platform/mock/MediaPlaybackTargetMock.cpp	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/platform/mock/MediaPlaybackTargetMock.cpp	2016-01-20 22:18:49 UTC (rev 195378)
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2015 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. ``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
- * 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. 
- */
-
-#include "config.h"
-#include "MediaPlaybackTargetMock.h"
-
-#if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
-
-namespace WebCore {
-
-Ref<MediaPlaybackTarget> MediaPlaybackTargetMock::create(const String& name, MediaPlaybackTargetContext::State state)
-{
-    return adoptRef(*new MediaPlaybackTargetMock(name, state));
-}
-
-MediaPlaybackTargetMock::MediaPlaybackTargetMock(const String& name, MediaPlaybackTargetContext::State state)
-    : MediaPlaybackTarget()
-    , m_name(name)
-    , m_state(state)
-{
-}
-
-MediaPlaybackTargetMock::~MediaPlaybackTargetMock()
-{
-}
-
-const MediaPlaybackTargetContext& MediaPlaybackTargetMock::targetContext() const
-{
-    m_context = MediaPlaybackTargetContext(m_name, m_state);
-    return m_context;
-}
-
-MediaPlaybackTargetMock* toMediaPlaybackTargetMock(MediaPlaybackTarget* rep)
-{
-    return const_cast<MediaPlaybackTargetMock*>(toMediaPlaybackTargetMock(const_cast<const MediaPlaybackTarget*>(rep)));
-}
-
-const MediaPlaybackTargetMock* toMediaPlaybackTargetMock(const MediaPlaybackTarget* rep)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(rep->targetType() == MediaPlaybackTarget::Mock);
-    return static_cast<const MediaPlaybackTargetMock*>(rep);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)

Deleted: branches/safari-601-branch/Source/WebCore/platform/mock/MediaPlaybackTargetMock.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/platform/mock/MediaPlaybackTargetMock.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/platform/mock/MediaPlaybackTargetMock.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2015 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. ``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
- * 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. 
- */
-
-#ifndef MediaPlaybackTargetMock_h
-#define MediaPlaybackTargetMock_h
-
-#if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
-
-#include "MediaPlaybackTarget.h"
-#include "MediaPlaybackTargetContext.h"
-#include <wtf/RetainPtr.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class MediaPlaybackTargetMock : public MediaPlaybackTarget {
-public:
-    WEBCORE_EXPORT static Ref<MediaPlaybackTarget> create(const String&, MediaPlaybackTargetContext::State);
-
-    virtual ~MediaPlaybackTargetMock();
-
-    TargetType targetType() const override { return Mock; }
-
-    const MediaPlaybackTargetContext& targetContext() const override;
-
-    bool hasActiveRoute() const override { return !m_name.isEmpty(); }
-
-    String deviceName() const override { return m_name; }
-
-    MediaPlaybackTargetContext::State state() const;
-
-protected:
-    MediaPlaybackTargetMock(const String&, MediaPlaybackTargetContext::State);
-
-    String m_name;
-    MediaPlaybackTargetContext::State m_state { MediaPlaybackTargetContext::Unavailable };
-    mutable MediaPlaybackTargetContext m_context;
-};
-
-MediaPlaybackTargetMock* toMediaPlaybackTargetMock(MediaPlaybackTarget*);
-const MediaPlaybackTargetMock* toMediaPlaybackTargetMock(const MediaPlaybackTarget*);
-
-}
-
-#endif // ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
-
-#endif

Deleted: branches/safari-601-branch/Source/WebCore/platform/mock/MediaPlaybackTargetPickerMock.cpp (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/platform/mock/MediaPlaybackTargetPickerMock.cpp	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/platform/mock/MediaPlaybackTargetPickerMock.cpp	2016-01-20 22:18:49 UTC (rev 195378)
@@ -1,132 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#include "config.h"
-#include "MediaPlaybackTargetPickerMock.h"
-
-#if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
-
-#include "Logging.h"
-#include <WebCore/FloatRect.h>
-#include <WebCore/MediaPlaybackTargetMock.h>
-#include <WebCore/WebMediaSessionManager.h>
-
-using namespace WebCore;
-
-namespace WebCore {
-
-static const double timerInterval = 1.0 / 10.0;
-
-std::unique_ptr<MediaPlaybackTargetPickerMock> MediaPlaybackTargetPickerMock::create(MediaPlaybackTargetPicker::Client& client)
-{
-    return std::unique_ptr<MediaPlaybackTargetPickerMock>(new MediaPlaybackTargetPickerMock(client));
-}
-
-MediaPlaybackTargetPickerMock::MediaPlaybackTargetPickerMock(MediaPlaybackTargetPicker::Client& client)
-    : MediaPlaybackTargetPicker(client)
-    , m_timer(RunLoop::main(), this, &MediaPlaybackTargetPickerMock::timerFired)
-{
-    LOG(Media, "MediaPlaybackTargetPickerMock::MediaPlaybackTargetPickerMock");
-}
-
-MediaPlaybackTargetPickerMock::~MediaPlaybackTargetPickerMock()
-{
-    LOG(Media, "MediaPlaybackTargetPickerMock::~MediaPlaybackTargetPickerMock");
-    setClient(nullptr);
-}
-
-bool MediaPlaybackTargetPickerMock::externalOutputDeviceAvailable()
-{
-    LOG(Media, "MediaPlaybackTargetPickerMock::externalOutputDeviceAvailable");
-    return m_state & MediaPlaybackTargetContext::OutputDeviceAvailable;
-}
-
-Ref<MediaPlaybackTarget> MediaPlaybackTargetPickerMock::playbackTarget()
-{
-    LOG(Media, "MediaPlaybackTargetPickerMock::playbackTarget");
-    return WebCore::MediaPlaybackTargetMock::create(m_deviceName, m_state);
-}
-
-void MediaPlaybackTargetPickerMock::timerFired()
-{
-    m_showingMenu = false;
-    currentDeviceDidChange();
-}
-
-void MediaPlaybackTargetPickerMock::showPlaybackTargetPicker(const FloatRect&, bool checkActiveRoute)
-{
-#if LOG_DISABLED
-    UNUSED_PARAM(checkActiveRoute);
-#endif
-
-    if (!client() || m_showingMenu)
-        return;
-
-    LOG(Media, "MediaPlaybackTargetPickerMock::showPlaybackTargetPicker - checkActiveRoute = %i", (int)checkActiveRoute);
-
-    m_showingMenu = true;
-    m_timer.startOneShot(timerInterval);
-}
-
-void MediaPlaybackTargetPickerMock::startingMonitoringPlaybackTargets()
-{
-    LOG(Media, "MediaPlaybackTargetPickerMock::startingMonitoringPlaybackTargets");
-
-    if (m_state & MediaPlaybackTargetContext::OutputDeviceAvailable)
-        availableDevicesDidChange();
-
-    if (!m_deviceName.isEmpty())
-        currentDeviceDidChange();
-}
-
-void MediaPlaybackTargetPickerMock::stopMonitoringPlaybackTargets()
-{
-    LOG(Media, "MediaPlaybackTargetPickerMock::stopMonitoringPlaybackTargets");
-}
-
-void MediaPlaybackTargetPickerMock::invalidatePlaybackTargets()
-{
-    LOG(Media, "MediaPlaybackTargetPickerMock::invalidatePlaybackTargets");
-    setState(WTF::emptyString(), MediaPlaybackTargetContext::Unavailable);
-}
-
-void MediaPlaybackTargetPickerMock::setState(const String& deviceName, MediaPlaybackTargetContext::State state)
-{
-    LOG(Media, "MediaPlaybackTargetPickerMock::setState - name = %s, state = 0x%x", deviceName.utf8().data(), (unsigned)state);
-
-    if (deviceName != m_deviceName) {
-        m_deviceName = deviceName;
-        currentDeviceDidChange();
-    }
-
-    if (m_state != state) {
-        m_state = state;
-        availableDevicesDidChange();
-    }
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)

Deleted: branches/safari-601-branch/Source/WebCore/platform/mock/MediaPlaybackTargetPickerMock.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/platform/mock/MediaPlaybackTargetPickerMock.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/platform/mock/MediaPlaybackTargetPickerMock.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#ifndef MediaPlaybackTargetPickerMock_h
-#define MediaPlaybackTargetPickerMock_h
-
-#if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
-
-#include "MediaPlaybackTargetContext.h"
-#include "MediaPlaybackTargetPicker.h"
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class MediaPlaybackTargetPickerMock final : public MediaPlaybackTargetPicker {
-    WTF_MAKE_NONCOPYABLE(MediaPlaybackTargetPickerMock);
-public:
-    virtual ~MediaPlaybackTargetPickerMock();
-
-    WEBCORE_EXPORT static std::unique_ptr<MediaPlaybackTargetPickerMock> create(MediaPlaybackTargetPicker::Client&);
-
-    void showPlaybackTargetPicker(const FloatRect&, bool checkActiveRoute) override;
-    void startingMonitoringPlaybackTargets() override;
-    void stopMonitoringPlaybackTargets() override;
-    void invalidatePlaybackTargets() override;
-
-    void setState(const String&, MediaPlaybackTargetContext::State);
-
-private:
-    explicit MediaPlaybackTargetPickerMock(MediaPlaybackTargetPicker::Client&);
-
-    bool externalOutputDeviceAvailable() override;
-    Ref<MediaPlaybackTarget> playbackTarget() override;
-
-    void timerFired();
-
-    String m_deviceName;
-    RunLoop::Timer<MediaPlaybackTargetPickerMock> m_timer;
-    MediaPlaybackTargetContext::State m_state { MediaPlaybackTargetContext::Unavailable };
-    bool m_showingMenu { false };
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
-
-#endif // WebContextMenuProxyMac_h

Modified: branches/safari-601-branch/Source/WebCore/testing/Internals.cpp (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/testing/Internals.cpp	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/testing/Internals.cpp	2016-01-20 22:18:49 UTC (rev 195378)
@@ -190,10 +190,6 @@
 #include "AudioContext.h"
 #endif
 
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-#include "MediaPlaybackTargetContext.h"
-#endif
-
 using JSC::CodeBlock;
 using JSC::FunctionExecutable;
 using JSC::JSFunction;
@@ -355,11 +351,6 @@
     enableMockRTCPeerConnectionHandler();
     WebCore::provideUserMediaTo(document->page(), new UserMediaClientMock());
 #endif
-
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-    if (document && document->page())
-        document->page()->setMockMediaPlaybackTargetPickerEnabled(true);
-#endif
 }
 
 Document* Internals::contextDocument() const
@@ -2804,34 +2795,7 @@
 #endif
 }
 
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-void Internals::setMockMediaPlaybackTargetPickerEnabled(bool enabled)
-{
-    Page* page = contextDocument()->frame()->page();
-    ASSERT(page);
 
-    page->setMockMediaPlaybackTargetPickerEnabled(enabled);
-}
-
-void Internals::setMockMediaPlaybackTargetPickerState(const String& deviceName, const String& deviceState, ExceptionCode& ec)
-{
-    Page* page = contextDocument()->frame()->page();
-    ASSERT(page);
-
-    MediaPlaybackTargetContext::State state = MediaPlaybackTargetContext::Unavailable;
-
-    if (equalIgnoringCase(deviceState, "DeviceAvailable"))
-        state = MediaPlaybackTargetContext::OutputDeviceAvailable;
-    else {
-        ec = INVALID_ACCESS_ERR;
-        return;
-    }
-
-    page->setMockMediaPlaybackTargetPickerState(deviceName, state);
-}
-#endif
-
-
 void Internals::installMockPageOverlay(const String& overlayType, ExceptionCode& ec)
 {
     Document* document = contextDocument();

Modified: branches/safari-601-branch/Source/WebCore/testing/Internals.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/testing/Internals.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/testing/Internals.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -391,11 +391,6 @@
     bool elementIsBlockingDisplaySleep(Element*) const;
 #endif
 
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-    void setMockMediaPlaybackTargetPickerEnabled(bool);
-    void setMockMediaPlaybackTargetPickerState(const String& deviceName, const String& deviceState, ExceptionCode&);
-#endif
-
 #if ENABLE(WEB_AUDIO)
     void setAudioContextRestrictions(AudioContext*, const String& restrictions, ExceptionCode&);
 #endif

Modified: branches/safari-601-branch/Source/WebCore/testing/Internals.idl (195377 => 195378)


--- branches/safari-601-branch/Source/WebCore/testing/Internals.idl	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebCore/testing/Internals.idl	2016-01-20 22:18:49 UTC (rev 195378)
@@ -357,9 +357,7 @@
     [Conditional=VIDEO, RaisesException] void setMediaElementRestrictions(HTMLMediaElement element, DOMString restrictions);
     [Conditional=WEB_AUDIO, RaisesException] void setAudioContextRestrictions(AudioContext context, DOMString restrictions);
     [Conditional=VIDEO, RaisesException] void postRemoteControlCommand(DOMString command);
-    [Conditional=WIRELESS_PLAYBACK_TARGET] void setMockMediaPlaybackTargetPickerEnabled(boolean enabled);
-    [Conditional=WIRELESS_PLAYBACK_TARGET, RaisesException] void setMockMediaPlaybackTargetPickerState(DOMString deviceName, DOMString deviceState);
-
+    
     [Conditional=VIDEO] void simulateSystemSleep();
     [Conditional=VIDEO] void simulateSystemWake();
     [Conditional=VIDEO] boolean elementIsBlockingDisplaySleep(Element element);

Modified: branches/safari-601-branch/Source/WebKit/ChangeLog (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit/ChangeLog	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit/ChangeLog	2016-01-20 22:18:49 UTC (rev 195378)
@@ -1,3 +1,7 @@
+2016-01-20  Matthew Hanson  <matthew_han...@apple.com>
+
+        Rollout r192200 via r195067. rdar://problem/24154288
+
 2015-07-20  Matthew Hanson  <matthew_han...@apple.com>
 
         Merge r187027. rdar://problem/21882777

Modified: branches/safari-601-branch/Source/WebKit/mac/ChangeLog (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit/mac/ChangeLog	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit/mac/ChangeLog	2016-01-20 22:18:49 UTC (rev 195378)
@@ -1,50 +1,31 @@
-2016-01-14  Matthew Hanson  <matthew_han...@apple.com>
+2016-01-20  Matthew Hanson  <matthew_han...@apple.com>
 
-        Merge r192200. rdar://problem/24154288
+        Roll out r192200 via r195067. rdar://problem/24154288
 
-    2015-11-09  Eric Carlson  <eric.carl...@apple.com>
+2016-01-20  Matthew Hanson  <matthew_han...@apple.com>
 
-            [Mac] Add a mock AppleTV device for testing
-            https://bugs.webkit.org/show_bug.cgi?id=148912
-            <rdar://problem/22596272>
+        Merge r195067. rdar://problem/24154288
 
-            Reviewed by Tim Horton.
+    2016-01-14  Matthew Hanson  <matthew_han...@apple.com>
 
-            * WebCoreSupport/WebChromeClient.h:
-            * WebCoreSupport/WebChromeClient.mm:
-            (WebChromeClient::setMockMediaPlaybackTargetPickerEnabled): New.
-            (WebChromeClient::setMockMediaPlaybackTargetPickerState): Ditto.
+            Merge r189135. rdar://problem/24154288
 
-            * WebView/WebMediaPlaybackTargetPicker.h:
-            * WebView/WebMediaPlaybackTargetPicker.mm:
-            (WebMediaPlaybackTargetPicker::setMockMediaPlaybackTargetPickerEnabled): New.
-            (WebMediaPlaybackTargetPicker::setMockMediaPlaybackTargetPickerState): Ditto.
+        2015-08-28  Eric Carlson  <eric.carl...@apple.com>
 
-            * WebView/WebView.mm:
-            (-[WebView _setMockMediaPlaybackTargetPickerEnabled:]): New.
-            (-[WebView _setMockMediaPlaybackTargetPickerName:state:]): Ditto.
-            * WebView/WebViewInternal.h:
+                [Mac] Restructure WebMediaSessionManager for testing
+                https://bugs.webkit.org/show_bug.cgi?id=148593
 
-2016-01-14  Matthew Hanson  <matthew_han...@apple.com>
+                Reviewed by Jer Noble.
 
-        Merge r189135. rdar://problem/24154288
+                * WebView/WebMediaPlaybackTargetPicker.mm:
+                (WebMediaPlaybackTargetPicker::addPlaybackTargetPickerClient): Call WebMediaSessionManager::singleton,
+                  not WebMediaSessionManagerMac::singleton.
+                (WebMediaPlaybackTargetPicker::removePlaybackTargetPickerClient): Ditto.
+                (WebMediaPlaybackTargetPicker::showPlaybackTargetPicker): Ditto.
+                (WebMediaPlaybackTargetPicker::playbackTargetPickerClientStateDidChange): Ditto.
+                (WebMediaPlaybackTargetPicker::setPlaybackTarget): Ditto.
+                (WebMediaPlaybackTargetPicker::invalidate): Ditto.
 
-    2015-08-28  Eric Carlson  <eric.carl...@apple.com>
-
-            [Mac] Restructure WebMediaSessionManager for testing
-            https://bugs.webkit.org/show_bug.cgi?id=148593
-
-            Reviewed by Jer Noble.
-
-            * WebView/WebMediaPlaybackTargetPicker.mm:
-            (WebMediaPlaybackTargetPicker::addPlaybackTargetPickerClient): Call WebMediaSessionManager::singleton,
-              not WebMediaSessionManagerMac::singleton.
-            (WebMediaPlaybackTargetPicker::removePlaybackTargetPickerClient): Ditto.
-            (WebMediaPlaybackTargetPicker::showPlaybackTargetPicker): Ditto.
-            (WebMediaPlaybackTargetPicker::playbackTargetPickerClientStateDidChange): Ditto.
-            (WebMediaPlaybackTargetPicker::setPlaybackTarget): Ditto.
-            (WebMediaPlaybackTargetPicker::invalidate): Ditto.
-
 2015-12-17  Babak Shafiei  <bshaf...@apple.com>
 
         Merge r191343.

Modified: branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -211,12 +211,10 @@
 #endif
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
-    void addPlaybackTargetPickerClient(uint64_t /*contextId*/) override;
-    void removePlaybackTargetPickerClient(uint64_t /*contextId*/) override;
-    void showPlaybackTargetPicker(uint64_t /*contextId*/, const WebCore::IntPoint&, bool /* hasVideo */) override;
-    void playbackTargetPickerClientStateDidChange(uint64_t /*contextId*/, WebCore::MediaProducer::MediaStateFlags) override;
-    void setMockMediaPlaybackTargetPickerEnabled(bool) override;
-    void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State) override;
+    virtual void addPlaybackTargetPickerClient(uint64_t /*contextId*/) override;
+    virtual void removePlaybackTargetPickerClient(uint64_t /*contextId*/) override;
+    virtual void showPlaybackTargetPicker(uint64_t /*contextId*/, const WebCore::IntPoint&, bool /* hasVideo */) override;
+    virtual void playbackTargetPickerClientStateDidChange(uint64_t /*contextId*/, WebCore::MediaProducer::MediaStateFlags) override;
 #endif
 
 private:

Modified: branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm	2016-01-20 22:18:49 UTC (rev 195378)
@@ -1041,15 +1041,4 @@
 {
     [m_webView _playbackTargetPickerClientStateDidChange:contextId state:state];
 }
-
-void WebChromeClient::setMockMediaPlaybackTargetPickerEnabled(bool enabled)
-{
-    [m_webView _setMockMediaPlaybackTargetPickerEnabled:enabled];
-}
-
-void WebChromeClient::setMockMediaPlaybackTargetPickerState(const String& name, MediaPlaybackTargetContext::State state)
-{
-    [m_webView _setMockMediaPlaybackTargetPickerName:name state:state];
-}
-
 #endif

Modified: branches/safari-601-branch/Source/WebKit/mac/WebView/WebMediaPlaybackTargetPicker.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit/mac/WebView/WebMediaPlaybackTargetPicker.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit/mac/WebView/WebMediaPlaybackTargetPicker.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -26,7 +26,6 @@
 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
 
 #include <WebCore/MediaPlaybackTarget.h>
-#include <WebCore/MediaPlaybackTargetContext.h>
 #include <WebCore/WebMediaSessionManagerClient.h>
 #include <wtf/Ref.h>
 
@@ -47,8 +46,6 @@
     void removePlaybackTargetPickerClient(uint64_t);
     void showPlaybackTargetPicker(uint64_t, const WebCore::FloatRect&, bool hasVideo);
     void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags);
-    void setMockMediaPlaybackTargetPickerEnabled(bool);
-    void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State);
 
     // WebMediaSessionManagerClient
     virtual void setPlaybackTarget(uint64_t, Ref<WebCore::MediaPlaybackTarget>&&) override;

Modified: branches/safari-601-branch/Source/WebKit/mac/WebView/WebMediaPlaybackTargetPicker.mm (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit/mac/WebView/WebMediaPlaybackTargetPicker.mm	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit/mac/WebView/WebMediaPlaybackTargetPicker.mm	2016-01-20 22:18:49 UTC (rev 195378)
@@ -61,16 +61,6 @@
     WebCore::WebMediaSessionManager::shared().clientStateDidChange(*this, contextId, state);
 }
 
-void WebMediaPlaybackTargetPicker::setMockMediaPlaybackTargetPickerEnabled(bool enabled)
-{
-    WebCore::WebMediaSessionManager::shared().setMockMediaPlaybackTargetPickerEnabled(enabled);
-}
-
-void WebMediaPlaybackTargetPicker::setMockMediaPlaybackTargetPickerState(const String& name, WebCore::MediaPlaybackTargetContext::State state)
-{
-    WebCore::WebMediaSessionManager::shared().setMockMediaPlaybackTargetPickerState(name, state);
-}
-
 void WebMediaPlaybackTargetPicker::setPlaybackTarget(uint64_t contextId, Ref<WebCore::MediaPlaybackTarget>&& target)
 {
     if (!m_page)

Modified: branches/safari-601-branch/Source/WebKit/mac/WebView/WebView.mm (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit/mac/WebView/WebView.mm	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit/mac/WebView/WebView.mm	2016-01-20 22:18:49 UTC (rev 195378)
@@ -8687,16 +8687,6 @@
 {
     [self _devicePicker]->playbackTargetPickerClientStateDidChange(clientId, state);
 }
-
-- (void)_setMockMediaPlaybackTargetPickerEnabled:(bool)enabled
-{
-    [self _devicePicker]->setMockMediaPlaybackTargetPickerEnabled(enabled);
-}
-
-- (void)_setMockMediaPlaybackTargetPickerName:(NSString *)name state:(WebCore::MediaPlaybackTargetContext::State)state
-{
-    [self _devicePicker]->setMockMediaPlaybackTargetPickerState(name, state);
-}
 #endif
 
 @end

Modified: branches/safari-601-branch/Source/WebKit/mac/WebView/WebViewInternal.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit/mac/WebView/WebViewInternal.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit/mac/WebView/WebViewInternal.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -65,7 +65,6 @@
 class WebSelectionServiceController;
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
-#import <WebCore/MediaPlaybackTargetContext.h>
 #import <WebCore/MediaProducer.h>
 #endif
 
@@ -285,8 +284,6 @@
 - (void)_removePlaybackTargetPickerClient:(uint64_t)contextId;
 - (void)_showPlaybackTargetPicker:(uint64_t)contextId location:(const WebCore::IntPoint&)location hasVideo:(BOOL)hasVideo;
 - (void)_playbackTargetPickerClientStateDidChange:(uint64_t)contextId state:(WebCore::MediaProducer::MediaStateFlags)state;
-- (void)_setMockMediaPlaybackTargetPickerEnabled:(bool)enabled;
-- (void)_setMockMediaPlaybackTargetPickerName:(NSString *)name state:(WebCore::MediaPlaybackTargetContext::State)state;
 #endif
 
 @end

Modified: branches/safari-601-branch/Source/WebKit2/ChangeLog (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit2/ChangeLog	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit2/ChangeLog	2016-01-20 22:18:49 UTC (rev 195378)
@@ -1,59 +1,26 @@
-2016-01-14  Matthew Hanson  <matthew_han...@apple.com>
+2016-01-20  Matthew Hanson  <matthew_han...@apple.com>
 
-        Merge r192200. rdar://problem/24154288
+        Roll out r192200 via r195067. rdar://problem/24154288
 
-    2015-11-09  Eric Carlson  <eric.carl...@apple.com>
+2016-01-20  Matthew Hanson  <matthew_han...@apple.com>
 
-            [Mac] Add a mock AppleTV device for testing
-            https://bugs.webkit.org/show_bug.cgi?id=148912
-            <rdar://problem/22596272>
+        Merge r195067. rdar://problem/24154288
 
-            Reviewed by Tim Horton.
+    2016-01-14  Matthew Hanson  <matthew_han...@apple.com>
 
-            * Shared/WebCoreArgumentCoders.cpp:
-            (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encode): Update for MediaPlaybackTargetContext changes.
-            (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decode): Ditto.
-            * Shared/WebCoreArgumentCoders.h:
+            Merge r189135. rdar://problem/24154288
 
-            * Shared/mac/WebCoreArgumentCodersMac.mm:
-            (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
-            (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
+        2015-08-28  Eric Carlson  <eric.carl...@apple.com>
 
-            * UIProcess/WebPageProxy.cpp:
-            (WebKit::WebPageProxy::setMockMediaPlaybackTargetPickerEnabled): New.
-            (WebKit::WebPageProxy::setMockMediaPlaybackTargetPickerState): Ditto.
-            * UIProcess/WebPageProxy.h:
+                [Mac] Restructure WebMediaSessionManager for testing
+                https://bugs.webkit.org/show_bug.cgi?id=148593
 
-            * UIProcess/WebPageProxy.messages.in: Add SetMockMediaPlaybackTargetPickerEnabled and
-              SetMockMediaPlaybackTargetPickerState.
+                Reviewed by Jer Noble.
 
-            * WebProcess/WebCoreSupport/WebChromeClient.cpp:
-            (WebKit::WebChromeClient::setMockMediaPlaybackTargetPickerEnabled): New.
-            (WebKit::WebChromeClient::setMockMediaPlaybackTargetPickerState): Ditto.
-            * WebProcess/WebCoreSupport/WebChromeClient.h:
+                * UIProcess/mac/PageClientImpl.mm:
+                (WebKit::PageClientImpl::mediaSessionManager): Call WebMediaSessionManager::singleton, not
+                  WebMediaSessionManagerMac::singleton.
 
-            * WebProcess/WebPage/WebPage.h: MediaPlaybackTargetContext is a class, not a struct.
-
-            * WebProcess/WebPage/WebPage.messages.in: Ditto.
-
-            * WebProcess/WebPage/mac/WebPageMac.mm:
-            (WebKit::WebPage::playbackTargetSelected): Support mock target.
-
-2016-01-14  Matthew Hanson  <matthew_han...@apple.com>
-
-        Merge r189135. rdar://problem/24154288
-
-    2015-08-28  Eric Carlson  <eric.carl...@apple.com>
-
-            [Mac] Restructure WebMediaSessionManager for testing
-            https://bugs.webkit.org/show_bug.cgi?id=148593
-
-            Reviewed by Jer Noble.
-
-            * UIProcess/mac/PageClientImpl.mm:
-            (WebKit::PageClientImpl::mediaSessionManager): Call WebMediaSessionManager::singleton, not
-              WebMediaSessionManagerMac::singleton.
-
 2015-12-18  Matthew Hanson  <matthew_han...@apple.com>
 
         Merge r188606. rdar://problem/23905024

Modified: branches/safari-601-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp	2016-01-20 22:18:49 UTC (rev 195378)
@@ -2189,47 +2189,26 @@
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
 void ArgumentCoder<MediaPlaybackTargetContext>::encode(ArgumentEncoder& encoder, const MediaPlaybackTargetContext& target)
 {
-    bool hasPlatformData = target.encodingRequiresPlatformData();
-    encoder << hasPlatformData;
-
-    int32_t targetType = target.type();
+    int32_t targetType = target.type;
     encoder << targetType;
 
-    if (target.encodingRequiresPlatformData()) {
-        encodePlatformData(encoder, target);
+    if (!target.encodingRequiresPlatformData())
         return;
-    }
 
-    ASSERT(targetType == MediaPlaybackTargetContext::MockType);
-    encoder << target.mockDeviceName();
-    encoder << static_cast<int32_t>(target.mockState());
+    encodePlatformData(encoder, target);
 }
 
 bool ArgumentCoder<MediaPlaybackTargetContext>::decode(ArgumentDecoder& decoder, MediaPlaybackTargetContext& target)
 {
-    bool hasPlatformData;
-    if (!decoder.decode(hasPlatformData))
-        return false;
-
     int32_t targetType;
     if (!decoder.decode(targetType))
         return false;
 
-    if (hasPlatformData)
-        return decodePlatformData(decoder, target);
-
-    ASSERT(targetType == MediaPlaybackTargetContext::MockType);
-
-    String mockDeviceName;
-    if (!decoder.decode(mockDeviceName))
+    target.type = static_cast<MediaPlaybackTargetContext::ContextType>(targetType);
+    if (!target.encodingRequiresPlatformData())
         return false;
 
-    int32_t mockState;
-    if (!decoder.decode(mockState))
-        return false;
-
-    target = MediaPlaybackTargetContext(mockDeviceName, static_cast<MediaPlaybackTargetContext::State>(mockState));
-    return true;
+    return decodePlatformData(decoder, target);
 }
 #endif
 

Modified: branches/safari-601-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -118,7 +118,7 @@
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
 namespace WebCore {
-class MediaPlaybackTargetContext;
+struct MediaPlaybackTargetContext;
 }
 #endif
 

Modified: branches/safari-601-branch/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm	2016-01-20 22:18:49 UTC (rev 195378)
@@ -491,12 +491,14 @@
 
 void ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData(ArgumentEncoder& encoder, const MediaPlaybackTargetContext& target)
 {
+    ASSERT(target.type == MediaPlaybackTargetContext::AVOutputContextType);
+
     RetainPtr<NSMutableData> data = "" alloc] init]);
     RetainPtr<NSKeyedArchiver> archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
     [archiver setRequiresSecureCoding:YES];
 
     if ([getAVOutputContextClass() conformsToProtocol:@protocol(NSSecureCoding)])
-        [archiver encodeObject:target.avOutputContext() forKey:deviceContextKey()];
+        [archiver encodeObject:target.context.avOutputContext forKey:deviceContextKey()];
 
     [archiver finishEncoding];
     IPC::encode(encoder, reinterpret_cast<CFDataRef>(data.get()));
@@ -505,6 +507,8 @@
 
 bool ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData(ArgumentDecoder& decoder, MediaPlaybackTargetContext& target)
 {
+    ASSERT(target.type == MediaPlaybackTargetContext::AVOutputContextType);
+
     if (![getAVOutputContextClass() conformsToProtocol:@protocol(NSSecureCoding)])
         return false;
 
@@ -519,11 +523,11 @@
     @try {
         context = [unarchiver decodeObjectOfClass:getAVOutputContextClass() forKey:deviceContextKey()];
     } @catch (NSException *exception) {
-        LOG_ERROR("The target picker being decoded is not an AVOutputContext.");
+        LOG_ERROR("The target picker being decoded is not a AVOutputContext.");
         return false;
     }
 
-    target = MediaPlaybackTargetContext(context);
+    target.context.avOutputContext = context;
     
     [unarchiver finishDecoding];
     return true;

Modified: branches/safari-601-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-01-20 22:18:49 UTC (rev 195378)
@@ -6074,16 +6074,6 @@
     m_pageClient.mediaSessionManager().clientStateDidChange(*this, contextId, state);
 }
 
-void WebPageProxy::setMockMediaPlaybackTargetPickerEnabled(bool enabled)
-{
-    m_pageClient.mediaSessionManager().setMockMediaPlaybackTargetPickerEnabled(enabled);
-}
-
-void WebPageProxy::setMockMediaPlaybackTargetPickerState(const String& name, WebCore::MediaPlaybackTargetContext::State state)
-{
-    m_pageClient.mediaSessionManager().setMockMediaPlaybackTargetPickerState(name, state);
-}
-
 void WebPageProxy::setPlaybackTarget(uint64_t contextId, Ref<MediaPlaybackTarget>&& target)
 {
     if (!isValid())

Modified: branches/safari-601-branch/Source/WebKit2/UIProcess/WebPageProxy.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit2/UIProcess/WebPageProxy.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit2/UIProcess/WebPageProxy.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -1058,8 +1058,6 @@
     void removePlaybackTargetPickerClient(uint64_t);
     void showPlaybackTargetPicker(uint64_t, const WebCore::FloatRect&, bool hasVideo);
     void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags);
-    void setMockMediaPlaybackTargetPickerEnabled(bool);
-    void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State);
 
     // WebMediaSessionManagerClient
     virtual void setPlaybackTarget(uint64_t, Ref<WebCore::MediaPlaybackTarget>&&) override;

Modified: branches/safari-601-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2016-01-20 22:18:49 UTC (rev 195378)
@@ -442,8 +442,6 @@
     RemovePlaybackTargetPickerClient(uint64_t contextId)
     ShowPlaybackTargetPicker(uint64_t clientId, WebCore::FloatRect pickerLocation, bool hasVideo)
     PlaybackTargetPickerClientStateDidChange(uint64_t contextId, unsigned mediaState)
-    SetMockMediaPlaybackTargetPickerEnabled(bool enabled)
-    SetMockMediaPlaybackTargetPickerState(String name, unsigned pickerState)
 #endif
 
 #if ENABLE(VIDEO)

Modified: branches/safari-601-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2016-01-20 22:18:49 UTC (rev 195378)
@@ -1156,16 +1156,6 @@
 {
     m_page->send(Messages::WebPageProxy::PlaybackTargetPickerClientStateDidChange(contextId, state));
 }
-
-void WebChromeClient::setMockMediaPlaybackTargetPickerEnabled(bool enabled)
-{
-    m_page->send(Messages::WebPageProxy::SetMockMediaPlaybackTargetPickerEnabled(enabled));
-}
-
-void WebChromeClient::setMockMediaPlaybackTargetPickerState(const String& name, WebCore::MediaPlaybackTargetContext::State state)
-{
-    m_page->send(Messages::WebPageProxy::SetMockMediaPlaybackTargetPickerState(name, state));
-}
 #endif
 
 #if ENABLE(VIDEO)

Modified: branches/safari-601-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -317,12 +317,10 @@
     virtual void handleAutoFillButtonClick(WebCore::HTMLInputElement&) override;
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
-    void addPlaybackTargetPickerClient(uint64_t /*contextId*/) override;
-    void removePlaybackTargetPickerClient(uint64_t /*contextId*/) override;
-    void showPlaybackTargetPicker(uint64_t contextId, const WebCore::IntPoint&, bool) override;
-    void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags) override;
-    void setMockMediaPlaybackTargetPickerEnabled(bool) override;
-    void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State) override;
+    virtual void addPlaybackTargetPickerClient(uint64_t /*contextId*/) override;
+    virtual void removePlaybackTargetPickerClient(uint64_t /*contextId*/) override;
+    virtual void showPlaybackTargetPicker(uint64_t contextId, const WebCore::IntPoint&, bool) override;
+    virtual void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags) override;
 #endif
 
 #if ENABLE(VIDEO)

Modified: branches/safari-601-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h	2016-01-20 22:18:49 UTC (rev 195378)
@@ -129,7 +129,6 @@
 class HTMLPlugInImageElement;
 class IntPoint;
 class KeyboardEvent;
-class MediaPlaybackTargetContext;
 class Page;
 class PrintContext;
 class Range;
@@ -142,6 +141,7 @@
 class VisibleSelection;
 struct Highlight;
 struct KeypressCommand;
+struct MediaPlaybackTargetContext;
 struct TextCheckingResult;
 }
 

Modified: branches/safari-601-branch/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2016-01-20 22:18:49 UTC (rev 195378)
@@ -426,7 +426,7 @@
     SetShouldDispatchFakeMouseMoveEvents(bool shouldDispatchFakeMouseMoveEvents)
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
-    PlaybackTargetSelected(uint64_t contextId, WebCore::MediaPlaybackTargetContext target)
+    PlaybackTargetSelected(uint64_t contextId, struct WebCore::MediaPlaybackTargetContext target)
     PlaybackTargetAvailabilityDidChange(uint64_t contextId, bool available)
     SetShouldPlayToPlaybackTarget(uint64_t contextId, bool shouldPlay)
 #endif

Modified: branches/safari-601-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (195377 => 195378)


--- branches/safari-601-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm	2016-01-20 22:18:33 UTC (rev 195377)
+++ branches/safari-601-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm	2016-01-20 22:18:49 UTC (rev 195378)
@@ -90,7 +90,6 @@
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
 #include <WebCore/MediaPlaybackTargetMac.h>
-#include <WebCore/MediaPlaybackTargetMock.h>
 #endif
 
 using namespace WebCore;
@@ -1266,17 +1265,9 @@
 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
 void WebPage::playbackTargetSelected(uint64_t contextId, const WebCore::MediaPlaybackTargetContext& targetContext) const
 {
-    switch (targetContext.type()) {
-    case MediaPlaybackTargetContext::AVOutputContextType:
-        m_page->setPlaybackTarget(contextId, WebCore::MediaPlaybackTargetMac::create(targetContext.avOutputContext()));
-        break;
-    case MediaPlaybackTargetContext::MockType:
-        m_page->setPlaybackTarget(contextId, WebCore::MediaPlaybackTargetMock::create(targetContext.mockDeviceName(), targetContext.mockState()));
-        break;
-    case MediaPlaybackTargetContext::None:
-        ASSERT_NOT_REACHED();
-        break;
-    }
+    ASSERT(targetContext.type == MediaPlaybackTargetContext::AVOutputContextType);
+
+    m_page->setPlaybackTarget(contextId, WebCore::MediaPlaybackTargetMac::create(targetContext.context.avOutputContext));
 }
 
 void WebPage::playbackTargetAvailabilityDidChange(uint64_t contextId, bool changed)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to