Diff
Modified: trunk/Source/WebCore/ChangeLog (231241 => 231242)
--- trunk/Source/WebCore/ChangeLog 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebCore/ChangeLog 2018-05-02 17:51:45 UTC (rev 231242)
@@ -1,3 +1,36 @@
+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-05-02 Dean Jackson <[email protected]>
Draw SystemPreview badge to specification on iOS
Modified: trunk/Source/WebCore/PAL/ChangeLog (231241 => 231242)
--- trunk/Source/WebCore/PAL/ChangeLog 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebCore/PAL/ChangeLog 2018-05-02 17:51:45 UTC (rev 231242)
@@ -1,3 +1,13 @@
+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-05-01 Jer Noble <[email protected]>
Protect against changes to CoreMedia function signatures
Modified: trunk/Source/WebCore/PAL/pal/spi/mac/AVFoundationSPI.h (231241 => 231242)
--- trunk/Source/WebCore/PAL/pal/spi/mac/AVFoundationSPI.h 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebCore/PAL/pal/spi/mac/AVFoundationSPI.h 2018-05-02 17:51:45 UTC (rev 231242)
@@ -270,4 +270,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: trunk/Source/WebCore/dom/Document.cpp (231241 => 231242)
--- trunk/Source/WebCore/dom/Document.cpp 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebCore/dom/Document.cpp 2018-05-02 17:51:45 UTC (rev 231242)
@@ -7189,7 +7189,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)
@@ -7199,7 +7199,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: trunk/Source/WebCore/dom/Document.h (231241 => 231242)
--- trunk/Source/WebCore/dom/Document.h 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebCore/dom/Document.h 2018-05-02 17:51:45 UTC (rev 231242)
@@ -196,6 +196,8 @@
enum CollectionType;
enum class ShouldOpenExternalURLsPolicy;
+enum class RouteSharingPolicy;
+
using PlatformDisplayID = uint32_t;
#if ENABLE(XSLT)
@@ -1317,7 +1319,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: trunk/Source/WebCore/html/MediaElementSession.cpp (231241 => 231242)
--- trunk/Source/WebCore/html/MediaElementSession.cpp 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebCore/html/MediaElementSession.cpp 2018-05-02 17:51:45 UTC (rev 231242)
@@ -434,7 +434,8 @@
}
#endif
- document.showPlaybackTargetPicker(*this, is<HTMLVideoElement>(m_element));
+ auto& audioSession = AudioSession::sharedSession();
+ document.showPlaybackTargetPicker(*this, is<HTMLVideoElement>(m_element), audioSession.routeSharingPolicy(), audioSession.routingContextUID());
}
bool MediaElementSession::hasWirelessPlaybackTargets() const
Modified: trunk/Source/WebCore/loader/EmptyClients.h (231241 => 231242)
--- trunk/Source/WebCore/loader/EmptyClients.h 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebCore/loader/EmptyClients.h 2018-05-02 17:51:45 UTC (rev 231242)
@@ -177,7 +177,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: trunk/Source/WebCore/page/ChromeClient.h (231241 => 231242)
--- trunk/Source/WebCore/page/ChromeClient.h 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebCore/page/ChromeClient.h 2018-05-02 17:51:45 UTC (rev 231242)
@@ -101,6 +101,8 @@
struct ViewportArguments;
struct WindowFeatures;
+enum class RouteSharingPolicy;
+
class WEBCORE_EXPORT ChromeClient {
public:
virtual void chromeDestroyed() = 0;
@@ -260,7 +262,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: trunk/Source/WebCore/page/Page.cpp (231241 => 231242)
--- trunk/Source/WebCore/page/Page.cpp 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebCore/page/Page.cpp 2018-05-02 17:51:45 UTC (rev 231242)
@@ -2200,14 +2200,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: trunk/Source/WebCore/page/Page.h (231241 => 231242)
--- trunk/Source/WebCore/page/Page.h 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebCore/page/Page.h 2018-05-02 17:51:45 UTC (rev 231242)
@@ -156,6 +156,7 @@
enum class CanWrap : bool;
enum class DidWrap : bool;
enum class NavigationPolicyCheck;
+enum class RouteSharingPolicy;
class Page : public Supplementable<Page> {
WTF_MAKE_NONCOPYABLE(Page);
@@ -573,7 +574,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: trunk/Source/WebCore/platform/audio/AudioSession.cpp (231241 => 231242)
--- trunk/Source/WebCore/platform/audio/AudioSession.cpp 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebCore/platform/audio/AudioSession.cpp 2018-05-02 17:51:45 UTC (rev 231242)
@@ -107,6 +107,17 @@
{
notImplemented();
}
+
+RouteSharingPolicy AudioSession::routeSharingPolicy() const
+{
+ return RouteSharingPolicy::Default;
+}
+
+String AudioSession::routingContextUID() const
+{
+ return emptyString();
+}
+
#endif // !PLATFORM(COCOA)
}
Modified: trunk/Source/WebCore/platform/audio/AudioSession.h (231241 => 231242)
--- trunk/Source/WebCore/platform/audio/AudioSession.h 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebCore/platform/audio/AudioSession.h 2018-05-02 17:51:45 UTC (rev 231242)
@@ -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
@@ -29,6 +29,7 @@
#if USE(AUDIO_SESSION)
#include <memory>
+#include <wtf/EnumTraits.h>
#include <wtf/HashSet.h>
#include <wtf/NeverDestroyed.h>
#include <wtf/Noncopyable.h>
@@ -37,6 +38,12 @@
class AudioSessionPrivate;
+enum class RouteSharingPolicy {
+ Default,
+ LongForm,
+ Independent,
+};
+
class AudioSession {
WTF_MAKE_NONCOPYABLE(AudioSession);
public:
@@ -57,6 +64,9 @@
void setCategoryOverride(CategoryType);
CategoryType categoryOverride() const;
+ RouteSharingPolicy routeSharingPolicy() const;
+ String routingContextUID() const;
+
float sampleRate() const;
size_t bufferSize() const;
size_t numberOfOutputChannels() const;
@@ -90,6 +100,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: trunk/Source/WebCore/platform/audio/ios/AudioSessionIOS.mm (231241 => 231242)
--- trunk/Source/WebCore/platform/audio/ios/AudioSessionIOS.mm 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebCore/platform/audio/ios/AudioSessionIOS.mm 2018-05-02 17:51:45 UTC (rev 231242)
@@ -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: trunk/Source/WebCore/platform/audio/mac/AudioSessionMac.cpp (231241 => 231242)
--- trunk/Source/WebCore/platform/audio/mac/AudioSessionMac.cpp 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebCore/platform/audio/mac/AudioSessionMac.cpp 2018-05-02 17:51:45 UTC (rev 231242)
@@ -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: trunk/Source/WebKit/ChangeLog (231241 => 231242)
--- trunk/Source/WebKit/ChangeLog 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebKit/ChangeLog 2018-05-02 17:51:45 UTC (rev 231242)
@@ -1,3 +1,36 @@
+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-05-02 Jer Noble <[email protected]>
Get the WebKit.framework bundle by asking for WKWebView
Modified: trunk/Source/WebKit/Scripts/webkit/messages.py (231241 => 231242)
--- trunk/Source/WebKit/Scripts/webkit/messages.py 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebKit/Scripts/webkit/messages.py 2018-05-02 17:51:45 UTC (rev 231242)
@@ -394,6 +394,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: trunk/Source/WebKit/UIProcess/PageClient.h (231241 => 231242)
--- trunk/Source/WebKit/UIProcess/PageClient.h 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebKit/UIProcess/PageClient.h 2018-05-02 17:51:45 UTC (rev 231242)
@@ -295,7 +295,7 @@
virtual bool interpretKeyEvent(const NativeWebKeyboardEvent&, bool isCharEvent) = 0;
virtual void positionInformationDidChange(const InteractionInformationAtPosition&) = 0;
virtual void saveImageToLibrary(Ref<WebCore::SharedBuffer>&&) = 0;
- 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: trunk/Source/WebKit/UIProcess/WebPageProxy.h (231241 => 231242)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.h 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h 2018-05-02 17:51:45 UTC (rev 231242)
@@ -1597,7 +1597,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: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (231241 => 231242)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2018-05-02 17:51:45 UTC (rev 231242)
@@ -188,7 +188,7 @@
InterpretKeyEvent(struct WebKit::EditorState state, bool isCharEvent) -> (bool handled)
DidReceivePositionInformation(struct WebKit::InteractionInformationAtPosition information)
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: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h (231241 => 231242)
--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h 2018-05-02 17:51:45 UTC (rev 231242)
@@ -132,7 +132,7 @@
bool interpretKeyEvent(const NativeWebKeyboardEvent&, bool isCharEvent) override;
void positionInformationDidChange(const InteractionInformationAtPosition&) override;
void saveImageToLibrary(Ref<WebCore::SharedBuffer>&&) override;
- 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: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm (231241 => 231242)
--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm 2018-05-02 17:51:45 UTC (rev 231242)
@@ -562,9 +562,9 @@
[m_contentView _stopAssistingNode];
}
-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: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (231241 => 231242)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2018-05-02 17:51:45 UTC (rev 231242)
@@ -60,6 +60,7 @@
class IntSize;
class SelectionRect;
struct PromisedBlobInfo;
+enum class RouteSharingPolicy;
}
#if ENABLE(DRAG_SUPPORT)
@@ -318,7 +319,7 @@
- (void)_didEndScrollingOrZooming;
- (void)_overflowScrollingWillBegin;
- (void)_overflowScrollingDidEnd;
-- (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: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (231241 => 231242)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2018-05-02 17:51:45 UTC (rev 231242)
@@ -4576,13 +4576,13 @@
[_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 ENABLE(AIRPLAY_PICKER)
#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: trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (231241 => 231242)
--- trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm 2018-05-02 17:51:45 UTC (rev 231242)
@@ -1033,9 +1033,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: trunk/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.h (231241 => 231242)
--- trunk/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.h 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.h 2018-05-02 17:51:45 UTC (rev 231242)
@@ -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: trunk/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.mm (231241 => 231242)
--- trunk/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.mm 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.mm 2018-05-02 17:51:45 UTC (rev 231242)
@@ -29,6 +29,7 @@
#if PLATFORM(IOS) && ENABLE(AIRPLAY_PICKER)
#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: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h (231241 => 231242)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h 2018-05-02 17:51:45 UTC (rev 231242)
@@ -173,7 +173,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: trunk/Source/WebKit/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm (231241 => 231242)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm 2018-05-02 17:51:45 UTC (rev 231242)
@@ -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: trunk/Source/WebKitLegacy/ios/ChangeLog (231241 => 231242)
--- trunk/Source/WebKitLegacy/ios/ChangeLog 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebKitLegacy/ios/ChangeLog 2018-05-02 17:51:45 UTC (rev 231242)
@@ -1,3 +1,15 @@
+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.
+
2018-04-05 Yusuke Suzuki <[email protected]>
[WTF] Remove StaticLock
Modified: trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.h (231241 => 231242)
--- trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.h 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.h 2018-05-02 17:51:45 UTC (rev 231242)
@@ -89,7 +89,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: trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.mm (231241 => 231242)
--- trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.mm 2018-05-02 17:36:59 UTC (rev 231241)
+++ trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.mm 2018-05-02 17:51:45 UTC (rev 231242)
@@ -367,7 +367,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];