WebPageProxy should nullify m_userMediaPermissionRequestManager after resetting the...
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Feb 2019 18:09:19 +0000 (18:09 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Feb 2019 18:09:19 +0000 (18:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195028
<rdar://problem/48243733>

Reviewed by Eric Carlson.

Source/WebKit:

Covered by API test.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242089 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebPageProxy.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm

index da6bd5b..e0290ef 100644 (file)
@@ -1,3 +1,16 @@
+2019-02-26  Youenn Fablet  <youenn@apple.com>
+
+        WebPageProxy should nullify m_userMediaPermissionRequestManager after resetting the media state
+        https://bugs.webkit.org/show_bug.cgi?id=195028
+        <rdar://problem/48243733>
+
+        Reviewed by Eric Carlson.
+
+        Covered by API test.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::resetState):
+
 2019-02-26  Philippe Normand <pnormand@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [WPE] Add API for webview background color configuration
index 4a61cf9..b91bbe3 100644 (file)
@@ -6707,10 +6707,6 @@ void WebPageProxy::resetState(ResetStateReason resetStateReason)
     m_geolocationPermissionRequestManager.invalidateRequests();
 #endif
 
-#if ENABLE(MEDIA_STREAM)
-    m_userMediaPermissionRequestManager = nullptr;
-#endif
-
     m_notificationPermissionRequestManager.invalidateRequests();
 
     m_toolTip = String();
@@ -6783,7 +6779,11 @@ void WebPageProxy::resetState(ResetStateReason resetStateReason)
         editCommand->invalidate();
 
     m_activePopupMenu = nullptr;
+
     updatePlayingMediaDidChange(MediaProducer::IsNotPlaying);
+#if ENABLE(MEDIA_STREAM)
+    m_userMediaPermissionRequestManager = nullptr;
+#endif
 
 #if ENABLE(POINTER_LOCK)
     requestPointerUnlock();
index a3bae19..fce99fe 100644 (file)
@@ -1,3 +1,13 @@
+2019-02-26  Youenn Fablet  <youenn@apple.com>
+
+        WebPageProxy should nullify m_userMediaPermissionRequestManager after resetting the media state
+        https://bugs.webkit.org/show_bug.cgi?id=195028
+        <rdar://problem/48243733>
+
+        Reviewed by Eric Carlson.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
+
 2019-02-26  Philippe Normand  <pnormand@igalia.com>
 
         [WPE] Add API for webview background color configuration
index 163a270..2a5ba06 100644 (file)
@@ -5273,6 +5273,11 @@ TEST(ProcessSwap, GetUserMediaCaptureState)
 
     EXPECT_FALSE(isCapturing);
     EXPECT_FALSE(pid1 == pid2);
+
+    isCapturing = false;
+    [webView goBack];
+    TestWebKitAPI::Util::run(&isCapturing);
+    isCapturing = false;
 }
 
 #if !PLATFORM(MAC)