Title: [241089] branches/safari-607-branch
- Revision
- 241089
- Author
- [email protected]
- Date
- 2019-02-06 14:18:04 -0800 (Wed, 06 Feb 2019)
Log Message
Cherry-pick r240928. rdar://problem/47810458
Capture state should be managed consistently when doing process swapping
https://bugs.webkit.org/show_bug.cgi?id=194122
<rdar://problem/47609293>
Reviewed by Eric Carlson.
Source/WebKit:
When doing PSON, WebPageProxy::resetState is called.
It resets the media state, but does not call the client delegates.
Instead of directly updating the media state, call the routine used to update it so that client delegates are called.
Covered by new API test and layout test.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _mediaCaptureState]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::isPlayingMediaDidChange):
(WebKit::WebPageProxy::updatePlayingMediaDidChange):
* UIProcess/WebPageProxy.h:
Tools:
* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
(-[GetUserMediaUIDelegate _webView:requestUserMediaAuthorizationForDevices:url:mainFrameURL:decisionHandler:]):
(-[GetUserMediaUIDelegate _webView:checkUserMediaPermissionForURL:mainFrameURL:frameIdentifier:decisionHandler:]):
(-[GetUserMediaUIDelegate _webView:mediaCaptureStateDidChange:]):
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::isDoingMediaCapture const):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::isDoingMediaCapture const):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::isDoingMediaCapture const):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240928 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-607-branch/Source/WebKit/ChangeLog (241088 => 241089)
--- branches/safari-607-branch/Source/WebKit/ChangeLog 2019-02-06 22:18:00 UTC (rev 241088)
+++ branches/safari-607-branch/Source/WebKit/ChangeLog 2019-02-06 22:18:04 UTC (rev 241089)
@@ -1,5 +1,75 @@
2019-02-05 Alan Coon <[email protected]>
+ Cherry-pick r240928. rdar://problem/47810458
+
+ Capture state should be managed consistently when doing process swapping
+ https://bugs.webkit.org/show_bug.cgi?id=194122
+ <rdar://problem/47609293>
+
+ Reviewed by Eric Carlson.
+
+ Source/WebKit:
+
+ When doing PSON, WebPageProxy::resetState is called.
+ It resets the media state, but does not call the client delegates.
+ Instead of directly updating the media state, call the routine used to update it so that client delegates are called.
+
+ Covered by new API test and layout test.
+
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView _mediaCaptureState]):
+ * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::resetState):
+ (WebKit::WebPageProxy::isPlayingMediaDidChange):
+ (WebKit::WebPageProxy::updatePlayingMediaDidChange):
+ * UIProcess/WebPageProxy.h:
+
+ Tools:
+
+ * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
+ (-[GetUserMediaUIDelegate _webView:requestUserMediaAuthorizationForDevices:url:mainFrameURL:decisionHandler:]):
+ (-[GetUserMediaUIDelegate _webView:checkUserMediaPermissionForURL:mainFrameURL:frameIdentifier:decisionHandler:]):
+ (-[GetUserMediaUIDelegate _webView:mediaCaptureStateDidChange:]):
+ * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+ (WTR::TestRunner::isDoingMediaCapture const):
+ * WebKitTestRunner/InjectedBundle/TestRunner.h:
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::isDoingMediaCapture const):
+ * WebKitTestRunner/TestController.h:
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
+ * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
+ (WTR::TestController::isDoingMediaCapture const):
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240928 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-02-04 Youenn Fablet <[email protected]>
+
+ Capture state should be managed consistently when doing process swapping
+ https://bugs.webkit.org/show_bug.cgi?id=194122
+ <rdar://problem/47609293>
+
+ Reviewed by Eric Carlson.
+
+ When doing PSON, WebPageProxy::resetState is called.
+ It resets the media state, but does not call the client delegates.
+ Instead of directly updating the media state, call the routine used to update it so that client delegates are called.
+
+ Covered by new API test and layout test.
+
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView _mediaCaptureState]):
+ * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::resetState):
+ (WebKit::WebPageProxy::isPlayingMediaDidChange):
+ (WebKit::WebPageProxy::updatePlayingMediaDidChange):
+ * UIProcess/WebPageProxy.h:
+
+2019-02-05 Alan Coon <[email protected]>
+
Apply patch. rdar://problem/47810458
fix-194122
Modified: branches/safari-607-branch/Tools/ChangeLog (241088 => 241089)
--- branches/safari-607-branch/Tools/ChangeLog 2019-02-06 22:18:00 UTC (rev 241088)
+++ branches/safari-607-branch/Tools/ChangeLog 2019-02-06 22:18:04 UTC (rev 241089)
@@ -1,5 +1,76 @@
2019-02-05 Alan Coon <[email protected]>
+ Cherry-pick r240928. rdar://problem/47810458
+
+ Capture state should be managed consistently when doing process swapping
+ https://bugs.webkit.org/show_bug.cgi?id=194122
+ <rdar://problem/47609293>
+
+ Reviewed by Eric Carlson.
+
+ Source/WebKit:
+
+ When doing PSON, WebPageProxy::resetState is called.
+ It resets the media state, but does not call the client delegates.
+ Instead of directly updating the media state, call the routine used to update it so that client delegates are called.
+
+ Covered by new API test and layout test.
+
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView _mediaCaptureState]):
+ * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::resetState):
+ (WebKit::WebPageProxy::isPlayingMediaDidChange):
+ (WebKit::WebPageProxy::updatePlayingMediaDidChange):
+ * UIProcess/WebPageProxy.h:
+
+ Tools:
+
+ * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
+ (-[GetUserMediaUIDelegate _webView:requestUserMediaAuthorizationForDevices:url:mainFrameURL:decisionHandler:]):
+ (-[GetUserMediaUIDelegate _webView:checkUserMediaPermissionForURL:mainFrameURL:frameIdentifier:decisionHandler:]):
+ (-[GetUserMediaUIDelegate _webView:mediaCaptureStateDidChange:]):
+ * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+ (WTR::TestRunner::isDoingMediaCapture const):
+ * WebKitTestRunner/InjectedBundle/TestRunner.h:
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::isDoingMediaCapture const):
+ * WebKitTestRunner/TestController.h:
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
+ * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
+ (WTR::TestController::isDoingMediaCapture const):
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240928 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-02-04 Youenn Fablet <[email protected]>
+
+ Capture state should be managed consistently when doing process swapping
+ https://bugs.webkit.org/show_bug.cgi?id=194122
+ <rdar://problem/47609293>
+
+ Reviewed by Eric Carlson.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
+ (-[GetUserMediaUIDelegate _webView:requestUserMediaAuthorizationForDevices:url:mainFrameURL:decisionHandler:]):
+ (-[GetUserMediaUIDelegate _webView:checkUserMediaPermissionForURL:mainFrameURL:frameIdentifier:decisionHandler:]):
+ (-[GetUserMediaUIDelegate _webView:mediaCaptureStateDidChange:]):
+ * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+ (WTR::TestRunner::isDoingMediaCapture const):
+ * WebKitTestRunner/InjectedBundle/TestRunner.h:
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::isDoingMediaCapture const):
+ * WebKitTestRunner/TestController.h:
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
+ * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
+ (WTR::TestController::isDoingMediaCapture const):
+
+2019-02-05 Alan Coon <[email protected]>
+
Apply patch. rdar://problem/47810458
fix-194122
Modified: branches/safari-607-branch/Tools/WebKitTestRunner/TestController.cpp (241088 => 241089)
--- branches/safari-607-branch/Tools/WebKitTestRunner/TestController.cpp 2019-02-06 22:18:00 UTC (rev 241088)
+++ branches/safari-607-branch/Tools/WebKitTestRunner/TestController.cpp 2019-02-06 22:18:04 UTC (rev 241089)
@@ -2828,6 +2828,14 @@
return context.result;
}
+#if !PLATFORM(COCOA)
+bool TestController::isDoingMediaCapture() const
+{
+ return false;
+}
+
+#endif
+
struct ResourceStatisticsCallbackContext {
explicit ResourceStatisticsCallbackContext(TestController& controller)
: testController(controller)
Modified: branches/safari-607-branch/Tools/WebKitTestRunner/TestController.h (241088 => 241089)
--- branches/safari-607-branch/Tools/WebKitTestRunner/TestController.h 2019-02-06 22:18:00 UTC (rev 241088)
+++ branches/safari-607-branch/Tools/WebKitTestRunner/TestController.h 2019-02-06 22:18:04 UTC (rev 241089)
@@ -280,6 +280,8 @@
bool isDoingMediaCapture() const;
+ bool isDoingMediaCapture() const;
+
private:
WKRetainPtr<WKPageConfigurationRef> generatePageConfiguration(WKContextConfigurationRef);
WKRetainPtr<WKContextConfigurationRef> generateContextConfiguration() const;
Modified: branches/safari-607-branch/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm (241088 => 241089)
--- branches/safari-607-branch/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm 2019-02-06 22:18:00 UTC (rev 241088)
+++ branches/safari-607-branch/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm 2019-02-06 22:18:04 UTC (rev 241089)
@@ -391,4 +391,13 @@
#endif
}
+bool TestController::isDoingMediaCapture() const
+{
+#if WK_API_ENABLED
+ return m_mainWebView->platformView()._mediaCaptureState != _WKMediaCaptureStateNone;
+#else
+ return false;
+#endif
+}
+
} // namespace WTR
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes