Diff
Modified: branches/safari-605-branch/Source/WebCore/ChangeLog (231259 => 231260)
--- branches/safari-605-branch/Source/WebCore/ChangeLog 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebCore/ChangeLog 2018-05-02 20:44:04 UTC (rev 231260)
@@ -1,3 +1,112 @@
+2018-05-02 Jason Marcell <[email protected]>
+
+ Cherry-pick r231242. rdar://problem/39860939
+
+ [iOS] Provide audio route information when invoking AirPlay picker
+ https://bugs.webkit.org/show_bug.cgi?id=185199
+ <rdar://problem/39853103>
+
+ Reviewed by Jer Noble.
+
+ Source/WebCore:
+
+ No new tests, this requires a specific hardware setup.
+
+ * dom/Document.cpp:
+ (WebCore::Document::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+ * dom/Document.h:
+
+ * html/MediaElementSession.cpp:
+ (WebCore::MediaElementSession::showPlaybackTargetPicker): Ditto.
+
+ * loader/EmptyClients.h:
+ * page/ChromeClient.h:
+
+ * page/Page.cpp:
+ (WebCore::Page::showPlaybackTargetPicker): Ditto.
+ * page/Page.h:
+
+ * platform/audio/AudioSession.cpp:
+ (WebCore::AudioSession::routeSharingPolicy const): Empty implementation for non-iOS ports.
+ (WebCore::routingContextUID const): Ditto.
+ * platform/audio/AudioSession.h:
+
+ * platform/audio/ios/AudioSessionIOS.mm:
+ (WebCore::AudioSession::routeSharingPolicy const): Return the route sharing policy.
+ (WebCore::AudioSession::routingContextUID const): Return the route context UID.
+
+ Source/WebCore/PAL:
+
+ * pal/spi/mac/AVFoundationSPI.h: Add additional AVAudioSession SPI.
+
+ Source/WebKit:
+
+ * Scripts/webkit/messages.py:
+ * UIProcess/PageClient.h:
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+ * UIProcess/ios/PageClientImplIOS.h:
+ * UIProcess/ios/PageClientImplIOS.mm:
+ (WebKit::PageClientImpl::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+
+ * UIProcess/ios/WKContentViewInteraction.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): Take same.
+ (-[WKContentView _showPlaybackTargetPicker:fromRect:]): Deleted.
+
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+
+ * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
+ * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
+ (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Take same.
+ (-[WKAirPlayRoutePicker showFromView:]): Deleted.
+
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
+ (WebKit::WebChromeClient::showPlaybackTargetPicker):
+
+ Source/WebKitLegacy/ios:
+
+ * WebCoreSupport/WebChromeClientIOS.h:
+ * WebCoreSupport/WebChromeClientIOS.mm:
+ (WebChromeClientIOS::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231242 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2018-05-02 Eric Carlson <[email protected]>
+
+ [iOS] Provide audio route information when invoking AirPlay picker
+ https://bugs.webkit.org/show_bug.cgi?id=185199
+ <rdar://problem/39853103>
+
+ Reviewed by Jer Noble.
+
+ No new tests, this requires a specific hardware setup.
+
+ * dom/Document.cpp:
+ (WebCore::Document::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+ * dom/Document.h:
+
+ * html/MediaElementSession.cpp:
+ (WebCore::MediaElementSession::showPlaybackTargetPicker): Ditto.
+
+ * loader/EmptyClients.h:
+ * page/ChromeClient.h:
+
+ * page/Page.cpp:
+ (WebCore::Page::showPlaybackTargetPicker): Ditto.
+ * page/Page.h:
+
+ * platform/audio/AudioSession.cpp:
+ (WebCore::AudioSession::routeSharingPolicy const): Empty implementation for non-iOS ports.
+ (WebCore::routingContextUID const): Ditto.
+ * platform/audio/AudioSession.h:
+
+ * platform/audio/ios/AudioSessionIOS.mm:
+ (WebCore::AudioSession::routeSharingPolicy const): Return the route sharing policy.
+ (WebCore::AudioSession::routingContextUID const): Return the route context UID.
+
2018-04-30 Jason Marcell <[email protected]>
Apply patch. rdar://problem/39741039
Modified: branches/safari-605-branch/Source/WebCore/PAL/ChangeLog (231259 => 231260)
--- branches/safari-605-branch/Source/WebCore/PAL/ChangeLog 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebCore/PAL/ChangeLog 2018-05-02 20:44:04 UTC (rev 231260)
@@ -1,3 +1,89 @@
+2018-05-02 Jason Marcell <[email protected]>
+
+ Cherry-pick r231242. rdar://problem/39860939
+
+ [iOS] Provide audio route information when invoking AirPlay picker
+ https://bugs.webkit.org/show_bug.cgi?id=185199
+ <rdar://problem/39853103>
+
+ Reviewed by Jer Noble.
+
+ Source/WebCore:
+
+ No new tests, this requires a specific hardware setup.
+
+ * dom/Document.cpp:
+ (WebCore::Document::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+ * dom/Document.h:
+
+ * html/MediaElementSession.cpp:
+ (WebCore::MediaElementSession::showPlaybackTargetPicker): Ditto.
+
+ * loader/EmptyClients.h:
+ * page/ChromeClient.h:
+
+ * page/Page.cpp:
+ (WebCore::Page::showPlaybackTargetPicker): Ditto.
+ * page/Page.h:
+
+ * platform/audio/AudioSession.cpp:
+ (WebCore::AudioSession::routeSharingPolicy const): Empty implementation for non-iOS ports.
+ (WebCore::routingContextUID const): Ditto.
+ * platform/audio/AudioSession.h:
+
+ * platform/audio/ios/AudioSessionIOS.mm:
+ (WebCore::AudioSession::routeSharingPolicy const): Return the route sharing policy.
+ (WebCore::AudioSession::routingContextUID const): Return the route context UID.
+
+ Source/WebCore/PAL:
+
+ * pal/spi/mac/AVFoundationSPI.h: Add additional AVAudioSession SPI.
+
+ Source/WebKit:
+
+ * Scripts/webkit/messages.py:
+ * UIProcess/PageClient.h:
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+ * UIProcess/ios/PageClientImplIOS.h:
+ * UIProcess/ios/PageClientImplIOS.mm:
+ (WebKit::PageClientImpl::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+
+ * UIProcess/ios/WKContentViewInteraction.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): Take same.
+ (-[WKContentView _showPlaybackTargetPicker:fromRect:]): Deleted.
+
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+
+ * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
+ * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
+ (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Take same.
+ (-[WKAirPlayRoutePicker showFromView:]): Deleted.
+
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
+ (WebKit::WebChromeClient::showPlaybackTargetPicker):
+
+ Source/WebKitLegacy/ios:
+
+ * WebCoreSupport/WebChromeClientIOS.h:
+ * WebCoreSupport/WebChromeClientIOS.mm:
+ (WebChromeClientIOS::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231242 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2018-05-02 Eric Carlson <[email protected]>
+
+ [iOS] Provide audio route information when invoking AirPlay picker
+ https://bugs.webkit.org/show_bug.cgi?id=185199
+ <rdar://problem/39853103>
+
+ Reviewed by Jer Noble.
+
+ * pal/spi/mac/AVFoundationSPI.h: Add additional AVAudioSession SPI.
+
2018-04-10 Kocsen Chung <[email protected]>
Cherry-pick r230467. rdar://problem/39317878
Modified: branches/safari-605-branch/Source/WebCore/PAL/pal/spi/mac/AVFoundationSPI.h (231259 => 231260)
--- branches/safari-605-branch/Source/WebCore/PAL/pal/spi/mac/AVFoundationSPI.h 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebCore/PAL/pal/spi/mac/AVFoundationSPI.h 2018-05-02 20:44:04 UTC (rev 231260)
@@ -271,4 +271,14 @@
NS_ASSUME_NONNULL_END
+#if PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR) && !ENABLE(MINIMAL_SIMULATOR)
+NS_ASSUME_NONNULL_BEGIN
+
+@interface AVAudioSession (AVAudioSessionPrivate)
+@property (readonly) NSString* routingContextUID;
+@end
+
+NS_ASSUME_NONNULL_END
+#endif
+
#endif // __has_include(<AVFoundation/AVSampleBufferAudioRenderer.h>)
Modified: branches/safari-605-branch/Source/WebCore/dom/Document.cpp (231259 => 231260)
--- branches/safari-605-branch/Source/WebCore/dom/Document.cpp 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebCore/dom/Document.cpp 2018-05-02 20:44:04 UTC (rev 231260)
@@ -7160,7 +7160,7 @@
page->removePlaybackTargetPickerClient(clientId);
}
-void Document::showPlaybackTargetPicker(MediaPlaybackTargetClient& client, bool isVideo)
+void Document::showPlaybackTargetPicker(MediaPlaybackTargetClient& client, bool isVideo, RouteSharingPolicy routeSharingPolicy, const String& routingContextUID)
{
Page* page = this->page();
if (!page)
@@ -7170,7 +7170,7 @@
if (it == m_clientToIDMap.end())
return;
- page->showPlaybackTargetPicker(it->value, view()->lastKnownMousePosition(), isVideo);
+ page->showPlaybackTargetPicker(it->value, view()->lastKnownMousePosition(), isVideo, routeSharingPolicy, routingContextUID);
}
void Document::playbackTargetPickerClientStateDidChange(MediaPlaybackTargetClient& client, MediaProducer::MediaStateFlags state)
Modified: branches/safari-605-branch/Source/WebCore/dom/Document.h (231259 => 231260)
--- branches/safari-605-branch/Source/WebCore/dom/Document.h 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebCore/dom/Document.h 2018-05-02 20:44:04 UTC (rev 231260)
@@ -193,6 +193,8 @@
enum CollectionType;
enum class ShouldOpenExternalURLsPolicy;
+enum class RouteSharingPolicy;
+
using PlatformDisplayID = uint32_t;
#if ENABLE(XSLT)
@@ -1303,7 +1305,7 @@
#if ENABLE(WIRELESS_PLAYBACK_TARGET)
void addPlaybackTargetPickerClient(MediaPlaybackTargetClient&);
void removePlaybackTargetPickerClient(MediaPlaybackTargetClient&);
- void showPlaybackTargetPicker(MediaPlaybackTargetClient&, bool);
+ void showPlaybackTargetPicker(MediaPlaybackTargetClient&, bool, RouteSharingPolicy, const String&);
void playbackTargetPickerClientStateDidChange(MediaPlaybackTargetClient&, MediaProducer::MediaStateFlags);
void setPlaybackTarget(uint64_t, Ref<MediaPlaybackTarget>&&);
Modified: branches/safari-605-branch/Source/WebCore/html/MediaElementSession.cpp (231259 => 231260)
--- branches/safari-605-branch/Source/WebCore/html/MediaElementSession.cpp 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebCore/html/MediaElementSession.cpp 2018-05-02 20:44:04 UTC (rev 231260)
@@ -434,7 +434,8 @@
}
#endif
- element.document().showPlaybackTargetPicker(*this, is<HTMLVideoElement>(element));
+ auto& audioSession = AudioSession::sharedSession();
+ element.document().showPlaybackTargetPicker(*this, is<HTMLVideoElement>(element), audioSession.routeSharingPolicy(), audioSession.routingContextUID());
}
bool MediaElementSession::hasWirelessPlaybackTargets(const HTMLMediaElement&) const
Modified: branches/safari-605-branch/Source/WebCore/loader/EmptyClients.h (231259 => 231260)
--- branches/safari-605-branch/Source/WebCore/loader/EmptyClients.h 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebCore/loader/EmptyClients.h 2018-05-02 20:44:04 UTC (rev 231260)
@@ -182,7 +182,7 @@
void removeScrollingLayer(Node*, PlatformLayer*, PlatformLayer*) final { }
void webAppOrientationsUpdated() final { };
- void showPlaybackTargetPicker(bool) final { };
+ void showPlaybackTargetPicker(bool, RouteSharingPolicy, const String&) final { };
#endif // PLATFORM(IOS)
#if ENABLE(ORIENTATION_EVENTS)
Modified: branches/safari-605-branch/Source/WebCore/page/ChromeClient.h (231259 => 231260)
--- branches/safari-605-branch/Source/WebCore/page/ChromeClient.h 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebCore/page/ChromeClient.h 2018-05-02 20:44:04 UTC (rev 231260)
@@ -101,6 +101,8 @@
struct ViewportArguments;
struct WindowFeatures;
+enum class RouteSharingPolicy;
+
class WEBCORE_EXPORT ChromeClient {
public:
virtual void chromeDestroyed() = 0;
@@ -264,7 +266,7 @@
virtual void removeScrollingLayer(Node*, PlatformLayer* scrollingLayer, PlatformLayer* contentsLayer) = 0;
virtual void webAppOrientationsUpdated() = 0;
- virtual void showPlaybackTargetPicker(bool hasVideo) = 0;
+ virtual void showPlaybackTargetPicker(bool hasVideo, RouteSharingPolicy, const String&) = 0;
#endif
#if ENABLE(ORIENTATION_EVENTS)
Modified: branches/safari-605-branch/Source/WebCore/page/Page.cpp (231259 => 231260)
--- branches/safari-605-branch/Source/WebCore/page/Page.cpp 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebCore/page/Page.cpp 2018-05-02 20:44:04 UTC (rev 231260)
@@ -2152,14 +2152,16 @@
chrome().client().removePlaybackTargetPickerClient(contextId);
}
-void Page::showPlaybackTargetPicker(uint64_t contextId, const WebCore::IntPoint& location, bool isVideo)
+void Page::showPlaybackTargetPicker(uint64_t contextId, const WebCore::IntPoint& location, bool isVideo, RouteSharingPolicy routeSharingPolicy, const String& routingContextUID)
{
#if PLATFORM(IOS)
// FIXME: refactor iOS implementation.
UNUSED_PARAM(contextId);
UNUSED_PARAM(location);
- chrome().client().showPlaybackTargetPicker(isVideo);
+ chrome().client().showPlaybackTargetPicker(isVideo, routeSharingPolicy, routingContextUID);
#else
+ UNUSED_PARAM(routeSharingPolicy);
+ UNUSED_PARAM(routingContextUID);
chrome().client().showPlaybackTargetPicker(contextId, location, isVideo);
#endif
}
Modified: branches/safari-605-branch/Source/WebCore/page/Page.h (231259 => 231260)
--- branches/safari-605-branch/Source/WebCore/page/Page.h 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebCore/page/Page.h 2018-05-02 20:44:04 UTC (rev 231260)
@@ -145,6 +145,7 @@
enum class CanWrap : bool;
enum class DidWrap : bool;
+enum class RouteSharingPolicy;
class Page : public Supplementable<Page> {
WTF_MAKE_NONCOPYABLE(Page);
@@ -530,7 +531,7 @@
#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 IntPoint&, bool, RouteSharingPolicy, const String&);
void playbackTargetPickerClientStateDidChange(uint64_t, MediaProducer::MediaStateFlags);
WEBCORE_EXPORT void setMockMediaPlaybackTargetPickerEnabled(bool);
WEBCORE_EXPORT void setMockMediaPlaybackTargetPickerState(const String&, MediaPlaybackTargetContext::State);
Modified: branches/safari-605-branch/Source/WebCore/platform/audio/AudioSession.cpp (231259 => 231260)
--- branches/safari-605-branch/Source/WebCore/platform/audio/AudioSession.cpp 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebCore/platform/audio/AudioSession.cpp 2018-05-02 20:44:04 UTC (rev 231260)
@@ -107,6 +107,17 @@
{
notImplemented();
}
+
+RouteSharingPolicy AudioSession::routeSharingPolicy() const
+{
+ return RouteSharingPolicy::Default;
+}
+
+String AudioSession::routingContextUID() const
+{
+ return emptyString();
+}
+
#endif // !PLATFORM(COCOA)
}
Modified: branches/safari-605-branch/Source/WebCore/platform/audio/AudioSession.h (231259 => 231260)
--- branches/safari-605-branch/Source/WebCore/platform/audio/AudioSession.h 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebCore/platform/audio/AudioSession.h 2018-05-02 20:44:04 UTC (rev 231260)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013-2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -31,6 +31,7 @@
#if USE(AUDIO_SESSION)
#include <memory>
+#include <wtf/EnumTraits.h>
#include <wtf/HashSet.h>
#include <wtf/NeverDestroyed.h>
#include <wtf/Noncopyable.h>
@@ -39,6 +40,12 @@
class AudioSessionPrivate;
+enum class RouteSharingPolicy {
+ Default,
+ LongForm,
+ Independent,
+};
+
class AudioSession {
WTF_MAKE_NONCOPYABLE(AudioSession);
public:
@@ -59,6 +66,9 @@
void setCategoryOverride(CategoryType);
CategoryType categoryOverride() const;
+ RouteSharingPolicy routeSharingPolicy() const;
+ String routingContextUID() const;
+
float sampleRate() const;
size_t bufferSize() const;
size_t numberOfOutputChannels() const;
@@ -92,6 +102,17 @@
}
+namespace WTF {
+template<> struct EnumTraits<WebCore::RouteSharingPolicy> {
+ using values = EnumValues<
+ WebCore::RouteSharingPolicy,
+ WebCore::RouteSharingPolicy::Default,
+ WebCore::RouteSharingPolicy::LongForm,
+ WebCore::RouteSharingPolicy::Independent
+ >;
+};
+}
+
#endif // USE(AUDIO_SESSION)
#endif // AudioSession_h
Modified: branches/safari-605-branch/Source/WebCore/platform/audio/ios/AudioSessionIOS.mm (231259 => 231260)
--- branches/safari-605-branch/Source/WebCore/platform/audio/ios/AudioSessionIOS.mm 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebCore/platform/audio/ios/AudioSessionIOS.mm 2018-05-02 20:44:04 UTC (rev 231260)
@@ -31,11 +31,10 @@
#import "Logging.h"
#import <AVFoundation/AVAudioSession.h>
#import <objc/runtime.h>
+#import <pal/spi/mac/AVFoundationSPI.h>
#import <wtf/RetainPtr.h>
#import <wtf/SoftLinking.h>
-typedef AVAudioSession AVAudioSessionType;
-
SOFT_LINK_FRAMEWORK(AVFoundation)
SOFT_LINK_CLASS(AVFoundation, AVAudioSession)
@@ -166,6 +165,26 @@
return None;
}
+RouteSharingPolicy AudioSession::routeSharingPolicy() const
+{
+ static_assert(static_cast<size_t>(RouteSharingPolicy::Default) == static_cast<size_t>(AVAudioSessionRouteSharingPolicyDefault), "RouteSharingPolicy::Default is not AVAudioSessionRouteSharingPolicyDefault as expected");
+ static_assert(static_cast<size_t>(RouteSharingPolicy::LongForm) == static_cast<size_t>(AVAudioSessionRouteSharingPolicyLongForm), "RouteSharingPolicy::LongForm is not AVAudioSessionRouteSharingPolicyLongForm as expected");
+ static_assert(static_cast<size_t>(RouteSharingPolicy::Independent) == static_cast<size_t>(AVAudioSessionRouteSharingPolicyIndependent), "RouteSharingPolicy::Independent is not AVAudioSessionRouteSharingPolicyIndependent as expected");
+
+ AVAudioSessionRouteSharingPolicy policy = [[AVAudioSession sharedInstance] routeSharingPolicy];
+ ASSERT(static_cast<RouteSharingPolicy>(policy) <= RouteSharingPolicy::Independent);
+ return static_cast<RouteSharingPolicy>(policy);
+}
+
+String AudioSession::routingContextUID() const
+{
+#if !PLATFORM(IOS_SIMULATOR) && !ENABLE(MINIMAL_SIMULATOR) && !PLATFORM(WATCHOS)
+ return [[AVAudioSession sharedInstance] routingContextUID];
+#else
+ return emptyString();
+#endif
+}
+
void AudioSession::setCategoryOverride(CategoryType category)
{
if (m_private->m_categoryOverride == category)
Modified: branches/safari-605-branch/Source/WebCore/platform/audio/mac/AudioSessionMac.cpp (231259 => 231260)
--- branches/safari-605-branch/Source/WebCore/platform/audio/mac/AudioSessionMac.cpp 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebCore/platform/audio/mac/AudioSessionMac.cpp 2018-05-02 20:44:04 UTC (rev 231260)
@@ -131,6 +131,16 @@
return true;
}
+RouteSharingPolicy AudioSession::routeSharingPolicy() const
+{
+ return RouteSharingPolicy::Default;
+}
+
+String AudioSession::routingContextUID() const
+{
+ return emptyString();
+}
+
size_t AudioSession::preferredBufferSize() const
{
UInt32 bufferSize;
Modified: branches/safari-605-branch/Source/WebKit/ChangeLog (231259 => 231260)
--- branches/safari-605-branch/Source/WebKit/ChangeLog 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebKit/ChangeLog 2018-05-02 20:44:04 UTC (rev 231260)
@@ -1,3 +1,112 @@
+2018-05-02 Jason Marcell <[email protected]>
+
+ Cherry-pick r231242. rdar://problem/39860939
+
+ [iOS] Provide audio route information when invoking AirPlay picker
+ https://bugs.webkit.org/show_bug.cgi?id=185199
+ <rdar://problem/39853103>
+
+ Reviewed by Jer Noble.
+
+ Source/WebCore:
+
+ No new tests, this requires a specific hardware setup.
+
+ * dom/Document.cpp:
+ (WebCore::Document::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+ * dom/Document.h:
+
+ * html/MediaElementSession.cpp:
+ (WebCore::MediaElementSession::showPlaybackTargetPicker): Ditto.
+
+ * loader/EmptyClients.h:
+ * page/ChromeClient.h:
+
+ * page/Page.cpp:
+ (WebCore::Page::showPlaybackTargetPicker): Ditto.
+ * page/Page.h:
+
+ * platform/audio/AudioSession.cpp:
+ (WebCore::AudioSession::routeSharingPolicy const): Empty implementation for non-iOS ports.
+ (WebCore::routingContextUID const): Ditto.
+ * platform/audio/AudioSession.h:
+
+ * platform/audio/ios/AudioSessionIOS.mm:
+ (WebCore::AudioSession::routeSharingPolicy const): Return the route sharing policy.
+ (WebCore::AudioSession::routingContextUID const): Return the route context UID.
+
+ Source/WebCore/PAL:
+
+ * pal/spi/mac/AVFoundationSPI.h: Add additional AVAudioSession SPI.
+
+ Source/WebKit:
+
+ * Scripts/webkit/messages.py:
+ * UIProcess/PageClient.h:
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+ * UIProcess/ios/PageClientImplIOS.h:
+ * UIProcess/ios/PageClientImplIOS.mm:
+ (WebKit::PageClientImpl::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+
+ * UIProcess/ios/WKContentViewInteraction.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): Take same.
+ (-[WKContentView _showPlaybackTargetPicker:fromRect:]): Deleted.
+
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+
+ * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
+ * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
+ (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Take same.
+ (-[WKAirPlayRoutePicker showFromView:]): Deleted.
+
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
+ (WebKit::WebChromeClient::showPlaybackTargetPicker):
+
+ Source/WebKitLegacy/ios:
+
+ * WebCoreSupport/WebChromeClientIOS.h:
+ * WebCoreSupport/WebChromeClientIOS.mm:
+ (WebChromeClientIOS::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231242 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2018-05-02 Eric Carlson <[email protected]>
+
+ [iOS] Provide audio route information when invoking AirPlay picker
+ https://bugs.webkit.org/show_bug.cgi?id=185199
+ <rdar://problem/39853103>
+
+ Reviewed by Jer Noble.
+
+ * Scripts/webkit/messages.py:
+ * UIProcess/PageClient.h:
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+ * UIProcess/ios/PageClientImplIOS.h:
+ * UIProcess/ios/PageClientImplIOS.mm:
+ (WebKit::PageClientImpl::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+
+ * UIProcess/ios/WKContentViewInteraction.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): Take same.
+ (-[WKContentView _showPlaybackTargetPicker:fromRect:]): Deleted.
+
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+
+ * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
+ * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
+ (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Take same.
+ (-[WKAirPlayRoutePicker showFromView:]): Deleted.
+
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
+ (WebKit::WebChromeClient::showPlaybackTargetPicker):
+
2018-04-30 Jason Marcell <[email protected]>
Apply patch. rdar://problem/39741039
Modified: branches/safari-605-branch/Source/WebKit/Scripts/webkit/messages.py (231259 => 231260)
--- branches/safari-605-branch/Source/WebKit/Scripts/webkit/messages.py 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebKit/Scripts/webkit/messages.py 2018-05-02 20:44:04 UTC (rev 231260)
@@ -386,6 +386,7 @@
'WebCore::PluginInfo': ['<WebCore/PluginData.h>'],
'WebCore::PolicyAction': ['<WebCore/FrameLoaderTypes.h>'],
'WebCore::RecentSearch': ['<WebCore/SearchPopupMenu.h>'],
+ 'WebCore::RouteSharingPolicy': ['<WebCore/AudioSession.h>'],
'WebCore::SWServerConnectionIdentifier': ['<WebCore/ServiceWorkerTypes.h>'],
'WebCore::ServiceWorkerJobIdentifier': ['<WebCore/ServiceWorkerTypes.h>'],
'WebCore::ServiceWorkerOrClientData': ['<WebCore/ServiceWorkerTypes.h>', '<WebCore/ServiceWorkerClientData.h>', '<WebCore/ServiceWorkerData.h>'],
Modified: branches/safari-605-branch/Source/WebKit/UIProcess/PageClient.h (231259 => 231260)
--- branches/safari-605-branch/Source/WebKit/UIProcess/PageClient.h 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebKit/UIProcess/PageClient.h 2018-05-02 20:44:04 UTC (rev 231260)
@@ -300,7 +300,7 @@
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 120000
virtual void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold) = 0;
#endif
- virtual void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect) = 0;
+ virtual void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect, WebCore::RouteSharingPolicy, const String&) = 0;
virtual void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID) = 0;
virtual double minimumZoomScale() const = 0;
virtual WebCore::FloatRect documentRect() const = 0;
Modified: branches/safari-605-branch/Source/WebKit/UIProcess/WebPageProxy.h (231259 => 231260)
--- branches/safari-605-branch/Source/WebKit/UIProcess/WebPageProxy.h 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebKit/UIProcess/WebPageProxy.h 2018-05-02 20:44:04 UTC (rev 231260)
@@ -1552,7 +1552,7 @@
void autocorrectionContextCallback(const String& beforeText, const String& markedText, const String& selectedText, const String& afterText, uint64_t location, uint64_t length, CallbackID);
void selectionContextCallback(const String& selectedText, const String& beforeText, const String& afterText, CallbackID);
void interpretKeyEvent(const EditorState&, bool isCharEvent, bool& handled);
- void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect);
+ void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect, WebCore::RouteSharingPolicy, const String&);
void selectionRectsCallback(const Vector<WebCore::SelectionRect>&, CallbackID);
#endif
#if PLATFORM(GTK)
Modified: branches/safari-605-branch/Source/WebKit/UIProcess/WebPageProxy.messages.in (231259 => 231260)
--- branches/safari-605-branch/Source/WebKit/UIProcess/WebPageProxy.messages.in 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebKit/UIProcess/WebPageProxy.messages.in 2018-05-02 20:44:04 UTC (rev 231260)
@@ -186,7 +186,7 @@
DidUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold)
#endif
SaveImageToLibrary(WebKit::SharedMemory::Handle handle, uint64_t size)
- ShowPlaybackTargetPicker(bool hasVideo, WebCore::IntRect elementRect)
+ ShowPlaybackTargetPicker(bool hasVideo, WebCore::IntRect elementRect, enum WebCore::RouteSharingPolicy policy, String routingContextUID)
CommitPotentialTapFailed()
DidNotHandleTapAsClick(WebCore::IntPoint point)
DidCompleteSyntheticClick()
Modified: branches/safari-605-branch/Source/WebKit/UIProcess/ios/PageClientImplIOS.h (231259 => 231260)
--- branches/safari-605-branch/Source/WebKit/UIProcess/ios/PageClientImplIOS.h 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebKit/UIProcess/ios/PageClientImplIOS.h 2018-05-02 20:44:04 UTC (rev 231260)
@@ -136,7 +136,7 @@
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 120000
void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold) override;
#endif
- void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect) override;
+ void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect, WebCore::RouteSharingPolicy, const String&) override;
bool handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, API::OpenPanelParameters*, WebOpenPanelResultListenerProxy*) override;
void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID) override;
Modified: branches/safari-605-branch/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm (231259 => 231260)
--- branches/safari-605-branch/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm 2018-05-02 20:44:04 UTC (rev 231260)
@@ -575,9 +575,9 @@
#endif
-void PageClientImpl::showPlaybackTargetPicker(bool hasVideo, const IntRect& elementRect)
+void PageClientImpl::showPlaybackTargetPicker(bool hasVideo, const IntRect& elementRect, WebCore::RouteSharingPolicy policy, const String& contextUID)
{
- [m_contentView _showPlaybackTargetPicker:hasVideo fromRect:elementRect];
+ [m_contentView _showPlaybackTargetPicker:hasVideo fromRect:elementRect routeSharingPolicy:policy routingContextUID:contextUID];
}
bool PageClientImpl::handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, API::OpenPanelParameters* parameters, WebOpenPanelResultListenerProxy* listener)
Modified: branches/safari-605-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (231259 => 231260)
--- branches/safari-605-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2018-05-02 20:44:04 UTC (rev 231260)
@@ -60,6 +60,7 @@
class IntSize;
class SelectionRect;
struct PromisedBlobInfo;
+enum class RouteSharingPolicy;
}
#if ENABLE(DRAG_SUPPORT)
@@ -299,7 +300,7 @@
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 120000
- (void)_didUpdateBlockSelectionWithTouch:(WebKit::SelectionTouch)touch withFlags:(WebKit::SelectionFlags)flags growThreshold:(CGFloat)growThreshold shrinkThreshold:(CGFloat)shrinkThreshold;
#endif
-- (void)_showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(const WebCore::IntRect&)elementRect;
+- (void)_showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(const WebCore::IntRect&)elementRect routeSharingPolicy:(WebCore::RouteSharingPolicy)policy routingContextUID:(NSString *)contextUID;
- (void)_showRunOpenPanel:(API::OpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener;
- (void)accessoryDone;
- (void)_didHandleKeyEvent:(::WebEvent *)event eventWasHandled:(BOOL)eventWasHandled;
Modified: branches/safari-605-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (231259 => 231260)
--- branches/safari-605-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2018-05-02 20:44:04 UTC (rev 231260)
@@ -4086,12 +4086,12 @@
[_textSelectionAssistant activateSelection];
}
-- (void)_showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(const IntRect&)elementRect
+- (void)_showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(const IntRect&)elementRect routeSharingPolicy:(WebCore::RouteSharingPolicy)routeSharingPolicy routingContextUID:(NSString *)routingContextUID
{
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
if (!_airPlayRoutePicker)
_airPlayRoutePicker = adoptNS([[WKAirPlayRoutePicker alloc] init]);
- [_airPlayRoutePicker showFromView:self];
+ [_airPlayRoutePicker showFromView:self routeSharingPolicy:routeSharingPolicy routingContextUID:routingContextUID];
#else
if (!_airPlayRoutePicker)
_airPlayRoutePicker = adoptNS([[WKAirPlayRoutePicker alloc] initWithView:self]);
Modified: branches/safari-605-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (231259 => 231260)
--- branches/safari-605-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm 2018-05-02 20:44:04 UTC (rev 231260)
@@ -1022,9 +1022,9 @@
m_pageClient.setAcceleratedCompositingRootLayer(rootLayer);
}
-void WebPageProxy::showPlaybackTargetPicker(bool hasVideo, const IntRect& elementRect)
+void WebPageProxy::showPlaybackTargetPicker(bool hasVideo, const IntRect& elementRect, WebCore::RouteSharingPolicy policy, const String& contextUID)
{
- m_pageClient.showPlaybackTargetPicker(hasVideo, elementRect);
+ m_pageClient.showPlaybackTargetPicker(hasVideo, elementRect, policy, contextUID);
}
void WebPageProxy::commitPotentialTapFailed()
Modified: branches/safari-605-branch/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.h (231259 => 231260)
--- branches/safari-605-branch/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.h 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.h 2018-05-02 20:44:04 UTC (rev 231260)
@@ -29,10 +29,14 @@
#import <Foundation/Foundation.h>
+namespace WebCore {
+enum class RouteSharingPolicy;
+}
+
@class UIView;
@interface WKAirPlayRoutePicker : NSObject
-- (void)showFromView:(UIView *)view;
+- (void)showFromView:(UIView *)view routeSharingPolicy:(WebCore::RouteSharingPolicy)policy routingContextUID:(NSString *)contextUID;
@end
#else
Modified: branches/safari-605-branch/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.mm (231259 => 231260)
--- branches/safari-605-branch/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.mm 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.mm 2018-05-02 20:44:04 UTC (rev 231260)
@@ -29,6 +29,7 @@
#if PLATFORM(IOS)
#import "UIKitSPI.h"
+#import <WebCore/AudioSession.h>
#import <pal/spi/ios/MediaPlayerSPI.h>
#import <wtf/RetainPtr.h>
#import <wtf/SoftLinking.h>
@@ -167,6 +168,17 @@
SOFT_LINK_CLASS(MediaPlayer, MPAVRoutingController)
SOFT_LINK_CLASS(MediaPlayer, MPMediaControlsViewController)
+enum {
+ WKAirPlayRoutePickerRouteSharingPolicyDefault = 0,
+ WKAirPlayRoutePickerRouteSharingPolicyLongForm = 1,
+ WKAirPlayRoutePickerRouteSharingPolicyIndependent = 2,
+};
+typedef NSInteger WKAirPlayRoutePickerRouteSharingPolicy;
+
+@interface MPMediaControlsViewController (WKMPMediaControlsViewControllerPrivate)
+- (void)setOverrideRouteSharingPolicy:(WKAirPlayRoutePickerRouteSharingPolicy)routeSharingPolicy routingContextUID:(NSString *)routingContextUID;
+@end
+
@implementation WKAirPlayRoutePicker {
RetainPtr<MPMediaControlsViewController> _actionSheet;
}
@@ -177,8 +189,12 @@
[super dealloc];
}
-- (void)showFromView:(UIView *)view
+- (void)showFromView:(UIView *)view routeSharingPolicy:(WebCore::RouteSharingPolicy)routeSharingPolicy routingContextUID:(NSString *)routingContextUID
{
+ static_assert(static_cast<size_t>(WebCore::RouteSharingPolicy::Default) == static_cast<size_t>(WKAirPlayRoutePickerRouteSharingPolicyDefault), "RouteSharingPolicy::Default is not WKAirPlayRoutePickerRouteSharingPolicyDefault as expected");
+ static_assert(static_cast<size_t>(WebCore::RouteSharingPolicy::LongForm) == static_cast<size_t>(WKAirPlayRoutePickerRouteSharingPolicyLongForm), "RouteSharingPolicy::LongForm is not WKAirPlayRoutePickerRouteSharingPolicyLongForm as expected");
+ static_assert(static_cast<size_t>(WebCore::RouteSharingPolicy::Independent) == static_cast<size_t>(WKAirPlayRoutePickerRouteSharingPolicyIndependent), "RouteSharingPolicy::Independent is not WKAirPlayRoutePickerRouteSharingPolicyIndependent as expected");
+
if (_actionSheet)
return;
@@ -186,6 +202,10 @@
[routingController setDiscoveryMode:MPRouteDiscoveryModeDetailed];
_actionSheet = adoptNS([allocMPMediaControlsViewControllerInstance() init]);
+
+ if ([_actionSheet respondsToSelector:@selector(setOverrideRouteSharingPolicy:routingContextUID:)])
+ [_actionSheet setOverrideRouteSharingPolicy:static_cast<WKAirPlayRoutePickerRouteSharingPolicy>(routeSharingPolicy) routingContextUID:routingContextUID];
+
_actionSheet.get().didDismissHandler = ^ {
[routingController setDiscoveryMode:MPRouteDiscoveryModeDisabled];
routingController = nil;
Modified: branches/safari-605-branch/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h (231259 => 231260)
--- branches/safari-605-branch/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h 2018-05-02 20:44:04 UTC (rev 231260)
@@ -178,7 +178,7 @@
void removeScrollingLayer(WebCore::Node*, PlatformLayer* scrollingLayer, PlatformLayer* contentsLayer) final;
void webAppOrientationsUpdated() final;
- void showPlaybackTargetPicker(bool hasVideo) final;
+ void showPlaybackTargetPicker(bool hasVideo, WebCore::RouteSharingPolicy, const String&) final;
Seconds eventThrottlingDelay() final;
#endif
Modified: branches/safari-605-branch/Source/WebKit/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm (231259 => 231260)
--- branches/safari-605-branch/Source/WebKit/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebKit/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm 2018-05-02 20:44:04 UTC (rev 231260)
@@ -35,6 +35,7 @@
#import "WebIconUtilities.h"
#import "WebPage.h"
#import "WebPageProxyMessages.h"
+#import <WebCore/AudioSession.h>
#import <WebCore/Icon.h>
#import <WebCore/NotImplemented.h>
#import <wtf/RefPtr.h>
@@ -134,9 +135,9 @@
notImplemented();
}
-void WebChromeClient::showPlaybackTargetPicker(bool hasVideo)
+void WebChromeClient::showPlaybackTargetPicker(bool hasVideo, WebCore::RouteSharingPolicy policy, const String& routingContextUID)
{
- m_page.send(Messages::WebPageProxy::ShowPlaybackTargetPicker(hasVideo, m_page.rectForElementAtInteractionLocation()));
+ m_page.send(Messages::WebPageProxy::ShowPlaybackTargetPicker(hasVideo, m_page.rectForElementAtInteractionLocation(), policy, routingContextUID));
}
Seconds WebChromeClient::eventThrottlingDelay()
Modified: branches/safari-605-branch/Source/WebKitLegacy/ios/ChangeLog (231259 => 231260)
--- branches/safari-605-branch/Source/WebKitLegacy/ios/ChangeLog 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebKitLegacy/ios/ChangeLog 2018-05-02 20:44:04 UTC (rev 231260)
@@ -1,3 +1,91 @@
+2018-05-02 Jason Marcell <[email protected]>
+
+ Cherry-pick r231242. rdar://problem/39860939
+
+ [iOS] Provide audio route information when invoking AirPlay picker
+ https://bugs.webkit.org/show_bug.cgi?id=185199
+ <rdar://problem/39853103>
+
+ Reviewed by Jer Noble.
+
+ Source/WebCore:
+
+ No new tests, this requires a specific hardware setup.
+
+ * dom/Document.cpp:
+ (WebCore::Document::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+ * dom/Document.h:
+
+ * html/MediaElementSession.cpp:
+ (WebCore::MediaElementSession::showPlaybackTargetPicker): Ditto.
+
+ * loader/EmptyClients.h:
+ * page/ChromeClient.h:
+
+ * page/Page.cpp:
+ (WebCore::Page::showPlaybackTargetPicker): Ditto.
+ * page/Page.h:
+
+ * platform/audio/AudioSession.cpp:
+ (WebCore::AudioSession::routeSharingPolicy const): Empty implementation for non-iOS ports.
+ (WebCore::routingContextUID const): Ditto.
+ * platform/audio/AudioSession.h:
+
+ * platform/audio/ios/AudioSessionIOS.mm:
+ (WebCore::AudioSession::routeSharingPolicy const): Return the route sharing policy.
+ (WebCore::AudioSession::routingContextUID const): Return the route context UID.
+
+ Source/WebCore/PAL:
+
+ * pal/spi/mac/AVFoundationSPI.h: Add additional AVAudioSession SPI.
+
+ Source/WebKit:
+
+ * Scripts/webkit/messages.py:
+ * UIProcess/PageClient.h:
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+ * UIProcess/ios/PageClientImplIOS.h:
+ * UIProcess/ios/PageClientImplIOS.mm:
+ (WebKit::PageClientImpl::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+
+ * UIProcess/ios/WKContentViewInteraction.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): Take same.
+ (-[WKContentView _showPlaybackTargetPicker:fromRect:]): Deleted.
+
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+
+ * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
+ * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
+ (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Take same.
+ (-[WKAirPlayRoutePicker showFromView:]): Deleted.
+
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
+ (WebKit::WebChromeClient::showPlaybackTargetPicker):
+
+ Source/WebKitLegacy/ios:
+
+ * WebCoreSupport/WebChromeClientIOS.h:
+ * WebCoreSupport/WebChromeClientIOS.mm:
+ (WebChromeClientIOS::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231242 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2018-05-02 Eric Carlson <[email protected]>
+
+ [iOS] Provide audio route information when invoking AirPlay picker
+ https://bugs.webkit.org/show_bug.cgi?id=185199
+ <rdar://problem/39853103>
+
+ Reviewed by Jer Noble.
+
+ * WebCoreSupport/WebChromeClientIOS.h:
+ * WebCoreSupport/WebChromeClientIOS.mm:
+ (WebChromeClientIOS::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
+
2017-12-07 Yusuke Suzuki <[email protected]>
Use StaticLock instead of NeverDestroyed<Lock>
Modified: branches/safari-605-branch/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.h (231259 => 231260)
--- branches/safari-605-branch/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.h 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.h 2018-05-02 20:44:04 UTC (rev 231260)
@@ -88,7 +88,7 @@
void webAppOrientationsUpdated() final;
void focusedElementChanged(WebCore::Element*) final;
- void showPlaybackTargetPicker(bool hasVideo) final;
+ void showPlaybackTargetPicker(bool hasVideo, WebCore::RouteSharingPolicy, const String&) final;
RefPtr<WebCore::Icon> createIconForFiles(const Vector<String>& filenames) final;
#if ENABLE(ORIENTATION_EVENTS)
Modified: branches/safari-605-branch/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.mm (231259 => 231260)
--- branches/safari-605-branch/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.mm 2018-05-02 20:34:07 UTC (rev 231259)
+++ branches/safari-605-branch/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.mm 2018-05-02 20:44:04 UTC (rev 231260)
@@ -362,7 +362,7 @@
CallFormDelegate(webView(), @selector(didFocusTextField:inFrame:), kit(&inputElement), kit(inputElement.document().frame()));
}
-void WebChromeClientIOS::showPlaybackTargetPicker(bool hasVideo)
+void WebChromeClientIOS::showPlaybackTargetPicker(bool hasVideo, WebCore::RouteSharingPolicy, const String&)
{
CGPoint point = [[webView() _UIKitDelegateForwarder] interactionLocation];
CGRect elementRect = [[webView() mainFrame] elementRectAtPoint:point];