browser(webkit): don't leak pages on window.open (#1261)

This commit is contained in:
Joel Einbinder 2020-03-06 08:21:14 -08:00 committed by GitHub
parent 1d770af804
commit 9c80c9efa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -1 +1 @@
1168
1169

View File

@ -6131,10 +6131,20 @@ index 0000000000000000000000000000000000000000..1bff4e694f19264d1be418198b792178
+
+WebKit::WebPageProxy* webkitBrowserInspectorCreateNewPageInContext(WebKitWebContext*);
diff --git a/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp b/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp
index f769407fdc660c6f6fef77af90a43bd5dca9d544..ba010ed593bdedc0d70e4f4d3139e73d3c395463 100644
index f769407fdc660c6f6fef77af90a43bd5dca9d544..bee8a907fb9a7924d9551d9aa64d98fb8c5746de 100644
--- a/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp
+++ b/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp
@@ -91,6 +91,10 @@ private:
@@ -64,7 +64,8 @@ private:
void createNewPage(WebPageProxy& page, WebCore::WindowFeatures&& windowFeatures, Ref<API::NavigationAction>&& apiNavigationAction, CompletionHandler<void(RefPtr<WebPageProxy>&&)>&& completionHandler) final
{
WebKitNavigationAction navigationAction(WTFMove(apiNavigationAction));
- completionHandler(webkitWebViewCreateNewPage(m_webView, windowFeatures, &navigationAction));
+ WebPageProxy* newPage = webkitWebViewCreateNewPage(m_webView, windowFeatures, &navigationAction);
+ completionHandler(adoptRef(newPage));
}
void showPage(WebPageProxy*) final
@@ -91,6 +92,10 @@ private:
{
webkitWebViewRunJavaScriptPrompt(m_webView, message.utf8(), defaultValue.utf8(), WTFMove(completionHandler));
}