Diff
Modified: branches/safari-607-branch/Source/WebKit/ChangeLog (241049 => 241050)
--- branches/safari-607-branch/Source/WebKit/ChangeLog 2019-02-06 22:02:15 UTC (rev 241049)
+++ branches/safari-607-branch/Source/WebKit/ChangeLog 2019-02-06 22:15:59 UTC (rev 241050)
@@ -1,3 +1,20 @@
+2019-02-05 Alan Coon <alanc...@apple.com>
+
+ Apply patch. rdar://problem/47774509
+
+ fix-194106
+
+ 2019-01-31 Youenn Fablet <you...@apple.com>
+
+ Add an API test to cover UIClient checkUserMediaPermissionForOrigin being nullptr
+ https://bugs.webkit.org/show_bug.cgi?id=194106
+ <rdar://problem/47676333>
+
+ Make sure handler is not called after being moved.
+
+ * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
+ (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
+
2019-01-30 Babak Shafiei <bshaf...@apple.com>
Cherry-pick r240633. rdar://problem/47682687
Modified: branches/safari-607-branch/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp (241049 => 241050)
--- branches/safari-607-branch/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp 2019-02-06 22:02:15 UTC (rev 241049)
+++ branches/safari-607-branch/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp 2019-02-06 22:15:59 UTC (rev 241050)
@@ -419,7 +419,7 @@
m_pendingDeviceRequests.add(requestID, request.copyRef());
if (!m_page.uiClient().checkUserMediaPermissionForOrigin(m_page, *m_page.process().webFrame(frameID), userMediaOrigin.get(), topLevelOrigin.get(), request.get())) {
m_pendingDeviceRequests.take(requestID);
- handler(false);
+ request->setUserMediaAccessInfo(false);
}
}
Modified: branches/safari-607-branch/Tools/ChangeLog (241049 => 241050)
--- branches/safari-607-branch/Tools/ChangeLog 2019-02-06 22:02:15 UTC (rev 241049)
+++ branches/safari-607-branch/Tools/ChangeLog 2019-02-06 22:15:59 UTC (rev 241050)
@@ -1,3 +1,20 @@
+2019-02-05 Alan Coon <alanc...@apple.com>
+
+ Apply patch. rdar://problem/47774509
+
+ fix-194106
+
+ 2019-01-31 Youenn Fablet <you...@apple.com>
+
+ Add an API test to cover UIClient checkUserMediaPermissionForOrigin being nullptr
+ https://bugs.webkit.org/show_bug.cgi?id=194106
+ <rdar://problem/47676333>
+
+ * TestWebKitAPI/Tests/WebKit/UserMedia.cpp:
+ (TestWebKitAPI::didFinishNavigation):
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WebKit/getUserMedia.html:
+
2019-01-30 Babak Shafiei <bshaf...@apple.com>
Cherry-pick r240633. rdar://problem/47682687
Modified: branches/safari-607-branch/Tools/TestWebKitAPI/Tests/WebKit/UserMedia.cpp (241049 => 241050)
--- branches/safari-607-branch/Tools/TestWebKitAPI/Tests/WebKit/UserMedia.cpp 2019-02-06 22:02:15 UTC (rev 241049)
+++ branches/safari-607-branch/Tools/TestWebKitAPI/Tests/WebKit/UserMedia.cpp 2019-02-06 22:15:59 UTC (rev 241050)
@@ -158,6 +158,44 @@
EXPECT_TRUE(!didCrash);
}
+static bool didReceiveMessage;
+static void didFinishNavigation(WKPageRef, WKNavigationRef, WKTypeRef, const void*)
+{
+ didReceiveMessage = true;
+}
+
+TEST(WebKit, EnumerateDevicesCrash)
+{
+ auto context = adoptWK(WKContextCreateWithConfiguration(nullptr));
+
+ WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(Util::toWK("GetUserMedia").get()));
+ WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get());
+ WKPreferencesSetMediaDevicesEnabled(preferences, true);
+ WKPreferencesSetFileAccessFromFileURLsAllowed(preferences, true);
+ WKPreferencesSetMediaCaptureRequiresSecureConnection(preferences, false);
+ WKPreferencesSetMockCaptureDevicesEnabled(preferences, true);
+
+ WKPageUIClientV6 uiClient;
+ // We want uiClient.checkUserMediaPermissionForOrigin to be null.
+ memset(&uiClient, 0, sizeof(uiClient));
+ uiClient.base.version = 6;
+
+ WKPageNavigationClientV3 loaderClient;
+ memset(&loaderClient, 0, sizeof(loaderClient));
+ loaderClient.base.version = 3;
+ loaderClient.didFinishNavigation = didFinishNavigation;
+
+ PlatformWebView webView(context.get(), pageGroup.get());
+ WKPageSetPageUIClient(webView.page(), &uiClient.base);
+ WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
+
+ // Load a page doing enumerateDevices.
+ didReceiveMessage = false;
+ auto url = "" "html"));
+ WKPageLoadURL(webView.page(), url.get());
+ Util::run(&didReceiveMessage);
+}
+
} // namespace TestWebKitAPI
#endif // ENABLE(MEDIA_STREAM)
Modified: branches/safari-607-branch/Tools/TestWebKitAPI/Tests/WebKit/getUserMedia.html (241049 => 241050)
--- branches/safari-607-branch/Tools/TestWebKitAPI/Tests/WebKit/getUserMedia.html 2019-02-06 22:02:15 UTC (rev 241049)
+++ branches/safari-607-branch/Tools/TestWebKitAPI/Tests/WebKit/getUserMedia.html 2019-02-06 22:15:59 UTC (rev 241050)
@@ -5,15 +5,16 @@
let stream = null;
- function promptForCapture()
+ async function promptForCapture()
{
- navigator.mediaDevices.getUserMedia({ audio: false, video: true })
- .then((s) => {
- stream = s;
- video.srcObject = stream;
- console.log("Got user media");
- })
- .catch((error) => console.log(`Failed with error: ${error}`));
+ try {
+ await navigator.mediaDevices.enumerateDevices();
+ const stream = await navigator.mediaDevices.getUserMedia({ audio: false, video: true })
+ video.srcObject = stream;
+ console.log("Got user media");
+ } catch(error) {
+ console.log(`Failed with error: ${error}`);
+ }
}
function stop(kind)