WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
proposed patch v2.
0001-WKWebView-should-provide-a-way-for-clients-to-know-t.patch (text/plain), 22.86 KB, created by
Andrew Gold
on 2017-03-07 13:43:12 PST
(
hide
)
Description:
proposed patch v2.
Filename:
MIME Type:
Creator:
Andrew Gold
Created:
2017-03-07 13:43:12 PST
Size:
22.86 KB
patch
obsolete
>From 918304673bbb24e24d45c87583eb9ce2c69678d8 Mon Sep 17 00:00:00 2001 >From: Andrew Gold <agold@apple.com> >Date: Mon, 6 Mar 2017 18:29:05 -0800 >Subject: [PATCH] WKWebView should provide a way for clients to know the > specific media state. https://bugs.webkit.org/show_bug.cgi?id=169140 > <rdar://problem/30838285> > >Reviewed by NOBODY (OOPS!). > >Instead of notifying the UIDelegate only when a capture begins and ends, >we now notify the UIDelegate of any change in capture state, and WKWebView >now has a method for getting the current media capture state. > >* UIProcess/API/APIUIClient.h: >(API::UIClient::mediaCaptureStateDidChange): >(API::UIClient::didBeginCaptureSession): Deleted. >(API::UIClient::didEndCaptureSession): Deleted. > >* UIProcess/API/Cocoa/WKUIDelegatePrivate.h: > >* UIProcess/API/Cocoa/WKWebView.mm: >(-[WKWebView _updateMediaCaptureState:]): Set _mediaCaptureState based on the MediaStateFlags. >(-[WKWebView _mediaCaptureState]): Get the current _mediaCaptureState. >* UIProcess/API/Cocoa/WKWebViewInternal.h: >* UIProcess/API/Cocoa/WKWebViewPrivate.h: > >* UIProcess/Cocoa/UIDelegate.h: >* UIProcess/Cocoa/UIDelegate.mm: >(WebKit::UIDelegate::setDelegate): >(WebKit::UIDelegate::UIClient::mediaCaptureStateDidChange): >(WebKit::UIDelegate::UIClient::didBeginCaptureSession): Deleted. >(WebKit::UIDelegate::UIClient::didEndCaptureSession): Deleted. > >* UIProcess/WebPageProxy.cpp: >(WebKit::WebPageProxy::isPlayingMediaDidChange): >--- > Source/WebKit2/ChangeLog | 35 ++++++++++++++++++++++ > Source/WebKit2/UIProcess/API/APIUIClient.h | 3 +- > .../UIProcess/API/Cocoa/WKUIDelegatePrivate.h | 3 +- > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm | 17 +++++++++++ > .../UIProcess/API/Cocoa/WKWebViewInternal.h | 2 ++ > .../WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h | 9 +++++- > Source/WebKit2/UIProcess/Cocoa/UIDelegate.h | 6 ++-- > Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm | 21 +++++-------- > Source/WebKit2/UIProcess/WebPageProxy.cpp | 16 +++++----- > Tools/ChangeLog | 10 +++++++ > .../TestWebKitAPI.xcodeproj/project.pbxproj | 6 ++++ > .../TestWebKitAPI/Tests/WebKit2/getUserMedia.html | 29 +++++++++--------- > 12 files changed, 112 insertions(+), 45 deletions(-) > >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index 47666f8adcc..20cd2ad5d90 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,38 @@ >+2017-03-06 Andrew Gold <agold@apple.com> >+ >+ WKWebView should provide a way for clients to know the specific media state. >+ https://bugs.webkit.org/show_bug.cgi?id=169140 >+ <rdar://problem/30838285> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Instead of notifying the UIDelegate only when a capture begins and ends, >+ we now notify the UIDelegate of any change in capture state, and WKWebView >+ now has a method for getting the current media capture state. >+ >+ * UIProcess/API/APIUIClient.h: >+ (API::UIClient::mediaCaptureStateDidChange): >+ (API::UIClient::didBeginCaptureSession): Deleted. >+ (API::UIClient::didEndCaptureSession): Deleted. >+ >+ * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: >+ >+ * UIProcess/API/Cocoa/WKWebView.mm: >+ (-[WKWebView _updateMediaCaptureState:]): Set _mediaCaptureState based on the MediaStateFlags. >+ (-[WKWebView _mediaCaptureState]): Get the current _mediaCaptureState. >+ * UIProcess/API/Cocoa/WKWebViewInternal.h: >+ * UIProcess/API/Cocoa/WKWebViewPrivate.h: >+ >+ * UIProcess/Cocoa/UIDelegate.h: >+ * UIProcess/Cocoa/UIDelegate.mm: >+ (WebKit::UIDelegate::setDelegate): >+ (WebKit::UIDelegate::UIClient::mediaCaptureStateDidChange): >+ (WebKit::UIDelegate::UIClient::didBeginCaptureSession): Deleted. >+ (WebKit::UIDelegate::UIClient::didEndCaptureSession): Deleted. >+ >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::isPlayingMediaDidChange): >+ > 2017-03-06 Andreas Kling <akling@apple.com> > > [iOS] Report domains crashing under memory pressure via enhanced privacy logging. >diff --git a/Source/WebKit2/UIProcess/API/APIUIClient.h b/Source/WebKit2/UIProcess/API/APIUIClient.h >index 37eb72d9477..bc269655554 100644 >--- a/Source/WebKit2/UIProcess/API/APIUIClient.h >+++ b/Source/WebKit2/UIProcess/API/APIUIClient.h >@@ -150,8 +150,7 @@ public: > virtual void pinnedStateDidChange(WebKit::WebPageProxy&) { } > > virtual void isPlayingAudioDidChange(WebKit::WebPageProxy&) { } >- virtual void didBeginCaptureSession() { } >- virtual void didEndCaptureSession() { } >+ virtual void mediaCaptureStateDidChange(WebCore::MediaProducer::MediaStateFlags) { } > virtual void handleAutoplayEvent(WebKit::WebPageProxy&, WebCore::AutoplayEvent) { } > > #if ENABLE(MEDIA_SESSION) >diff --git a/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h b/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h >index 361a5caddaf..a8abef1b3d2 100644 >--- a/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h >+++ b/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h >@@ -63,8 +63,7 @@ struct UIEdgeInsets; > - (NSDictionary *)_dataDetectionContextForWebView:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.12), ios(10.0)); > - (void)_webView:(WKWebView *)webView requestUserMediaAuthorizationForMicrophone:(BOOL)microphone camera:(BOOL)camera url:(NSURL *)url mainFrameURL:(NSURL *)mainFrameURL decisionHandler:(void (^)(BOOL authorizedMicrophone, BOOL authorizedCamera))decisionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); > - (void)_webView:(WKWebView *)webView checkUserMediaPermissionForURL:(NSURL *)url mainFrameURL:(NSURL *)mainFrameURL frameIdentifier:(NSUInteger)frameIdentifier decisionHandler:(void (^)(NSString *salt, BOOL authorized))decisionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); >-- (void)_webViewDidBeginCaptureSession:(WKWebView *)webView WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); >-- (void)_webViewDidEndCaptureSession:(WKWebView *)webView WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); >+- (void)_webViewMediaCaptureStateDidChange:(WKWebView *)webView WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); > #if TARGET_OS_IPHONE > - (BOOL)_webView:(WKWebView *)webView shouldIncludeAppLinkActionsForElement:(_WKActivatedElementInfo *)element WK_API_AVAILABLE(ios(9.0)); > - (NSArray *)_webView:(WKWebView *)webView actionsForElement:(_WKActivatedElementInfo *)element defaultActions:(NSArray<_WKElementAction *> *)defaultActions; >diff --git a/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm b/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm >index a6986d2efbe..ad667418c8f 100644 >--- a/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm >+++ b/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm >@@ -209,6 +209,7 @@ @implementation WKWebView { > std::unique_ptr<WebKit::IconLoadingDelegate> _iconLoadingDelegate; > > _WKRenderingProgressEvents _observedRenderingProgressEvents; >+ _WKMediaCaptureState _mediaCaptureState; > > WebKit::WeakObjCPtr<id <_WKInputDelegate>> _inputDelegate; > >@@ -1004,6 +1005,17 @@ - (void)setCustomUserAgent:(NSString *)customUserAgent > _page->setCustomUserAgent(customUserAgent); > } > >+- (void)_updateMediaCaptureState:(WebCore::MediaProducer::MediaStateFlags)state >+{ >+ _WKMediaCaptureState mediaCaptureState = _WKMediaCaptureStateNone; >+ if (state & WebCore::MediaProducer::HasActiveAudioCaptureDevice) >+ mediaCaptureState |= _WKMediaCaptureStateMicrophone; >+ if (state & WebCore::MediaProducer::HasActiveVideoCaptureDevice) >+ mediaCaptureState |= _WKMediaCaptureStateCamera; >+ >+ _mediaCaptureState = mediaCaptureState; >+} >+ > - (WKPageRef)_pageForTesting > { > return toAPI(_page.get()); >@@ -4342,6 +4354,11 @@ - (BOOL)_isInFullscreen > #endif > } > >+- (_WKMediaCaptureState)_mediaCaptureState >+{ >+ return _mediaCaptureState; >+} >+ > - (void)_stopMediaCapture > { > _page->setMuted(WebCore::MediaProducer::CaptureDevicesAreMuted); >diff --git a/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h b/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h >index 70dc378297c..1aef3f075b5 100644 >--- a/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h >+++ b/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h >@@ -29,6 +29,7 @@ > > #import "SameDocumentNavigationType.h" > #import "WKWebViewConfiguration.h" >+#import <WebCore/MediaProducer.h> > #import <wtf/RefPtr.h> > #import <wtf/RetainPtr.h> > >@@ -130,6 +131,7 @@ struct PrintInfo; > @property (nonatomic, readonly) UIEdgeInsets _computedContentInset; > #endif > >+- (void)_updateMediaCaptureState:(WebCore::MediaProducer::MediaStateFlags)state; > - (WKPageRef)_pageForTesting; > > @end >diff --git a/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h b/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h >index 10dba6afce4..74baf33b3cc 100644 >--- a/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h >+++ b/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h >@@ -39,6 +39,12 @@ typedef NS_ENUM(NSInteger, _WKPaginationMode) { > _WKPaginationModeBottomToTop, > } WK_API_AVAILABLE(macosx(10.10), ios(8.0)); > >+typedef NS_OPTIONS(NSInteger, _WKMediaCaptureState) { >+ _WKMediaCaptureStateNone = 0, >+ _WKMediaCaptureStateMicrophone = 1 << 0, >+ _WKMediaCaptureStateCamera = 1 << 1, >+} WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); >+ > #if !TARGET_OS_IPHONE > > typedef NS_ENUM(NSInteger, _WKImmediateActionType) { >@@ -266,7 +272,8 @@ typedef NS_ENUM(NSInteger, _WKImmediateActionType) { > @property (nonatomic, setter=_setFullscreenDelegate:) id<_WKFullscreenDelegate> _fullscreenDelegate WK_API_AVAILABLE(macosx(10.13)); > @property (nonatomic, readonly) BOOL _isInFullscreen WK_API_AVAILABLE(macosx(WK_MAC_TBA)); > >-- (void)_stopMediaCapture; >+@property (nonatomic, readonly) _WKMediaCaptureState _mediaCaptureState WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); >+- (void)_stopMediaCapture WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); > > @end > >diff --git a/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h b/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h >index 20c2102a46a..150864b12c3 100644 >--- a/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h >+++ b/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h >@@ -91,8 +91,7 @@ private: > #endif > bool decidePolicyForUserMediaPermissionRequest(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::SecurityOrigin&, API::SecurityOrigin&, WebKit::UserMediaPermissionRequestProxy&) override; > bool checkUserMediaPermissionForOrigin(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::SecurityOrigin&, API::SecurityOrigin&, WebKit::UserMediaPermissionCheckProxy&) override; >- void didBeginCaptureSession() override; >- void didEndCaptureSession() override; >+ void mediaCaptureStateDidChange(WebCore::MediaProducer::MediaStateFlags) override; > void printFrame(WebKit::WebPageProxy*, WebKit::WebFrameProxy*) override; > #if PLATFORM(IOS) > #if HAVE(APP_LINKS) >@@ -136,8 +135,7 @@ private: > bool webViewDidExitFullscreen : 1; > bool webViewRequestUserMediaAuthorizationForMicrophoneCameraURLMainFrameURLDecisionHandler : 1; > bool webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler : 1; >- bool webViewDidBeginCaptureSession : 1; >- bool webViewDidEndCaptureSession : 1; >+ bool webViewMediaCaptureStateDidChange : 1; > #if PLATFORM(IOS) > #if HAVE(APP_LINKS) > bool webViewShouldIncludeAppLinkActionsForElement : 1; >diff --git a/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm b/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm >index 22a639b586e..c1a3f9a2fab 100644 >--- a/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm >+++ b/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm >@@ -116,8 +116,7 @@ void UIDelegate::setDelegate(id <WKUIDelegate> delegate) > m_delegateMethods.webViewDidNotHandleTapAsClickAtPoint = [delegate respondsToSelector:@selector(_webView:didNotHandleTapAsClickAtPoint:)]; > m_delegateMethods.webViewRequestUserMediaAuthorizationForMicrophoneCameraURLMainFrameURLDecisionHandler = [delegate respondsToSelector:@selector(_webView:requestUserMediaAuthorizationForMicrophone:camera:url:mainFrameURL:decisionHandler:)]; > m_delegateMethods.webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler = [delegate respondsToSelector:@selector(_webView:checkUserMediaPermissionForURL:mainFrameURL:frameIdentifier:decisionHandler:)]; >- m_delegateMethods.webViewDidBeginCaptureSession = [delegate respondsToSelector:@selector(_webViewDidBeginCaptureSession:)]; >- m_delegateMethods.webViewDidEndCaptureSession = [delegate respondsToSelector:@selector(_webViewDidEndCaptureSession:)]; >+ m_delegateMethods.webViewMediaCaptureStateDidChange = [delegate respondsToSelector:@selector(_webViewMediaCaptureStateDidChange:)]; > m_delegateMethods.presentingViewControllerForWebView = [delegate respondsToSelector:@selector(_presentingViewControllerForWebView:)]; > #endif > m_delegateMethods.dataDetectionContextForWebView = [delegate respondsToSelector:@selector(_dataDetectionContextForWebView:)]; >@@ -435,22 +434,16 @@ bool UIDelegate::UIClient::checkUserMediaPermissionForOrigin(WebKit::WebPageProx > return true; > } > >-void UIDelegate::UIClient::didBeginCaptureSession() >-{ >- auto delegate = m_uiDelegate.m_delegate.get(); >- if (!delegate || !m_uiDelegate.m_delegateMethods.webViewDidBeginCaptureSession) >- return; >- >- [(id <WKUIDelegatePrivate>)delegate _webViewDidBeginCaptureSession:m_uiDelegate.m_webView]; >-} >- >-void UIDelegate::UIClient::didEndCaptureSession() >+void UIDelegate::UIClient::mediaCaptureStateDidChange(WebCore::MediaProducer::MediaStateFlags state) > { >+ WKWebView *webView = m_uiDelegate.m_webView; >+ [webView _updateMediaCaptureState:state]; >+ > auto delegate = m_uiDelegate.m_delegate.get(); >- if (!delegate || !m_uiDelegate.m_delegateMethods.webViewDidEndCaptureSession) >+ if (!delegate || !m_uiDelegate.m_delegateMethods.webViewMediaCaptureStateDidChange) > return; > >- [(id <WKUIDelegatePrivate>)delegate _webViewDidEndCaptureSession:m_uiDelegate.m_webView]; >+ [(id <WKUIDelegatePrivate>)delegate _webViewMediaCaptureStateDidChange:webView]; > } > > void UIDelegate::UIClient::reachedApplicationCacheOriginQuota(WebPageProxy*, const WebCore::SecurityOrigin& securityOrigin, uint64_t currentQuota, uint64_t totalBytesNeeded, Function<void (unsigned long long)>&& completionHandler) >diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp >index 7507171970a..0f957a6f00f 100644 >--- a/Source/WebKit2/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp >@@ -6441,9 +6441,10 @@ void WebPageProxy::isPlayingMediaDidChange(MediaProducer::MediaStateFlags state, > if (state == m_mediaState) > return; > >+ WebCore::MediaProducer::MediaStateFlags activeCaptureMask = WebCore::MediaProducer::HasActiveAudioCaptureDevice | WebCore::MediaProducer::HasActiveVideoCaptureDevice; > #if ENABLE(MEDIA_STREAM) >- WebCore::MediaProducer::MediaStateFlags oldMediaStateHasActiveCapture = m_mediaState & (WebCore::MediaProducer::HasActiveAudioCaptureDevice | WebCore::MediaProducer::HasActiveVideoCaptureDevice); >- WebCore::MediaProducer::MediaStateFlags newMediaStateHasActiveCapture = state & (WebCore::MediaProducer::HasActiveAudioCaptureDevice | WebCore::MediaProducer::HasActiveVideoCaptureDevice); >+ WebCore::MediaProducer::MediaStateFlags oldMediaStateHasActiveCapture = m_mediaState & activeCaptureMask; >+ WebCore::MediaProducer::MediaStateFlags newMediaStateHasActiveCapture = state & activeCaptureMask; > #endif > > MediaProducer::MediaStateFlags playingMediaMask = MediaProducer::IsPlayingAudio | MediaProducer::IsPlayingVideo; >@@ -6451,18 +6452,17 @@ void WebPageProxy::isPlayingMediaDidChange(MediaProducer::MediaStateFlags state, > m_mediaState = state; > > #if ENABLE(MEDIA_STREAM) >- if (!oldMediaStateHasActiveCapture && newMediaStateHasActiveCapture) { >- m_uiClient->didBeginCaptureSession(); >+ if ((oldState & activeCaptureMask) != (m_mediaState & activeCaptureMask)) >+ m_uiClient->mediaCaptureStateDidChange(m_mediaState); >+ if (!oldMediaStateHasActiveCapture && newMediaStateHasActiveCapture) > userMediaPermissionRequestManager().startedCaptureSession(); >- } else if (oldMediaStateHasActiveCapture && !newMediaStateHasActiveCapture) { >- m_uiClient->didEndCaptureSession(); >+ else if (oldMediaStateHasActiveCapture && !newMediaStateHasActiveCapture) > userMediaPermissionRequestManager().endedCaptureSession(); >- } > #endif > > activityStateDidChange(ActivityState::IsAudible); > >- playingMediaMask |= MediaProducer::HasActiveAudioCaptureDevice | MediaProducer::HasActiveVideoCaptureDevice; >+ playingMediaMask |= activeCaptureMask; > if ((oldState & playingMediaMask) != (m_mediaState & playingMediaMask)) > m_uiClient->isPlayingAudioDidChange(*this); > #if PLATFORM(MAC) >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 1ada24afdaa..1f96d1b5203 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,13 @@ >+2017-03-06 Andrew Gold <agold@apple.com> >+ >+ Need a short description (OOPS!). >+ Need the bug URL (OOPS!). >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: >+ * TestWebKitAPI/Tests/WebKit2/getUserMedia.html: >+ > 2017-03-06 Yusuke Suzuki <utatane.tea@gmail.com> > > [GTK][JSCOnly] Enable WebAssembly on Linux environment >diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >index 0d96e71f539..ac16bc6d144 100644 >--- a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >+++ b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >@@ -556,7 +556,9 @@ > CEBCA1391E3A807A00C73293 /* page-with-csp-iframe.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CEBCA1341E3A803400C73293 /* page-with-csp-iframe.html */; }; > CEBCA13A1E3A807A00C73293 /* page-without-csp.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CEBCA1371E3A803400C73293 /* page-without-csp.html */; }; > CEBCA13B1E3A807A00C73293 /* page-without-csp-iframe.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CEBCA1361E3A803400C73293 /* page-without-csp-iframe.html */; }; >+ D314C5431E6DF0FB00771033 /* MediaCaptureState.mm in Sources */ = {isa = PBXBuildFile; fileRef = D314C5421E6DF0FB00771033 /* MediaCaptureState.mm */; }; > D34E08761E4E42E1005FF14A /* WKWebViewGetContents.mm in Sources */ = {isa = PBXBuildFile; fileRef = D3BE5E341E4CE85E00FD563A /* WKWebViewGetContents.mm */; }; >+ D3ED5B2A1E6E26AC00E4C754 /* getUserMedia.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 4A410F4D19AF7BEF002EBAB5 /* getUserMedia.html */; }; > E1220DCA155B28AA0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = E1220DC9155B287D0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html */; }; > E194E1BD177E53C7009C4D4E /* StopLoadingFromDidReceiveResponse.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = E194E1BC177E534A009C4D4E /* StopLoadingFromDidReceiveResponse.html */; }; > ECA680CE1E68CC0900731D20 /* StringUtilities.mm in Sources */ = {isa = PBXBuildFile; fileRef = ECA680CD1E68CC0900731D20 /* StringUtilities.mm */; }; >@@ -642,6 +644,7 @@ > dstPath = TestWebKitAPI.resources; > dstSubfolderSpec = 7; > files = ( >+ D3ED5B2A1E6E26AC00E4C754 /* getUserMedia.html in Copy Resources */, > 5120C83E1E67678F0025B250 /* WebsiteDataStoreCustomPaths.html in Copy Resources */, > F4856CA31E649EA8009D7EE7 /* attachment-element.html in Copy Resources */, > 8361F1781E610B4E00759B25 /* link-with-download-attribute-with-slashes.html in Copy Resources */, >@@ -1386,6 +1389,7 @@ > CEBCA1351E3A803400C73293 /* page-with-csp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "page-with-csp.html"; sourceTree = "<group>"; }; > CEBCA1361E3A803400C73293 /* page-without-csp-iframe.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "page-without-csp-iframe.html"; sourceTree = "<group>"; }; > CEBCA1371E3A803400C73293 /* page-without-csp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "page-without-csp.html"; sourceTree = "<group>"; }; >+ D314C5421E6DF0FB00771033 /* MediaCaptureState.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MediaCaptureState.mm; sourceTree = "<group>"; }; > D3BE5E341E4CE85E00FD563A /* WKWebViewGetContents.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewGetContents.mm; sourceTree = "<group>"; }; > DC69AA621CF77C6500C6272F /* ScopedLambda.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScopedLambda.cpp; sourceTree = "<group>"; }; > E1220D9F155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MemoryCacheDisableWithinResourceLoadDelegate.mm; sourceTree = "<group>"; }; >@@ -1607,6 +1611,7 @@ > 51E6A8921D2F1BEC00C004B6 /* LocalStorageClear.mm */, > 46C519D81D355A7300DAA51A /* LocalStorageNullEntries.mm */, > 7A6A2C6F1DCCF87B00C0D085 /* LocalStorageQuirkTest.mm */, >+ D314C5421E6DF0FB00771033 /* MediaCaptureState.mm */, > 51CD1C6A1B38CE3600142CA5 /* ModalAlerts.mm */, > 1ABC3DED1899BE6D004F0626 /* Navigation.mm */, > 2ECFF5541D9B12F800B55394 /* NowPlayingControlsTests.mm */, >@@ -2855,6 +2860,7 @@ > ECA680CE1E68CC0900731D20 /* StringUtilities.mm in Sources */, > 7CCE7F1A1A411AE600447C4C /* WebCoreStatisticsWithNoWebProcess.cpp in Sources */, > 7CCE7EAB1A411A2400447C4C /* WebKitAgnosticTest.mm in Sources */, >+ D314C5431E6DF0FB00771033 /* MediaCaptureState.mm in Sources */, > 5120C83D1E6751290025B250 /* WebsiteDataStoreCustomPaths.mm in Sources */, > 51714EB81CF8CA17004723C4 /* WebProcessKillIDBCleanup.mm in Sources */, > 536770341CC8022800D425B1 /* WebScriptObjectDescription.mm in Sources */, >diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/getUserMedia.html b/Tools/TestWebKitAPI/Tests/WebKit2/getUserMedia.html >index e54f853bf93..4cb1ae02b94 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKit2/getUserMedia.html >+++ b/Tools/TestWebKitAPI/Tests/WebKit2/getUserMedia.html >@@ -1,14 +1,15 @@ >-<script> >-function gotUserMedia(mediaStream) >-{ >- console.log("Got user media"); >-} >- >-function userMediaError(error) >-{ >- console.log(error); >-} >- >-var options = { audio: false, video: true}; >-navigator.webkitGetUserMedia(options, gotUserMedia, userMediaError); >-</script> >+<html> >+ <head> >+ <script> >+ function requestAccess() >+ { >+ var options = { audio: false, video: true }; >+ navigator.mediaDevices.getUserMedia(options) >+ .then(stream => { console.log("Got user media"); }) >+ .catch(error => { console.log(error); }); >+ } >+ </script> >+ </head> >+ <body> >+ </body> >+</html> >-- >2.11.0 (Apple Git-80) >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 169140
:
303598
|
303717
|
303720
|
303735