2018-10-24 18:24:11 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-09-21 00:30:26 +00:00
|
|
|
From: Cheng Zhao <zcbenz@gmail.com>
|
|
|
|
Date: Thu, 20 Sep 2018 17:45:32 -0700
|
|
|
|
Subject: can_create_window.patch
|
|
|
|
|
|
|
|
|
2018-09-14 05:02:16 +00:00
|
|
|
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
|
2019-05-21 17:05:21 +00:00
|
|
|
index 14bc2ffdcdb71e70b294960333eab765332e280d..d2863986ddafcece65fc88b0ad1f5f7a84ecf9a0 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/browser/frame_host/render_frame_host_impl.cc
|
|
|
|
+++ b/content/browser/frame_host/render_frame_host_impl.cc
|
2019-05-21 17:05:21 +00:00
|
|
|
@@ -3725,6 +3725,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
2019-01-16 18:07:52 +00:00
|
|
|
last_committed_origin_, params->window_container_type,
|
2019-01-08 23:59:47 +00:00
|
|
|
params->target_url, params->referrer.To<Referrer>(),
|
|
|
|
params->frame_name, params->disposition, *params->features,
|
2019-01-24 14:52:14 +00:00
|
|
|
+ params->additional_features, params->body,
|
2018-09-21 00:30:26 +00:00
|
|
|
effective_transient_activation_state, params->opener_suppressed,
|
|
|
|
&no_javascript_access);
|
2018-09-14 05:02:16 +00:00
|
|
|
|
|
|
|
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
|
2019-05-21 17:05:21 +00:00
|
|
|
index 82882159b0bac6d47d678c485de0aacc7db06c2d..dd2299094b79d82da7ec1cd8f559050b6f0e2af5 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/common/frame.mojom
|
|
|
|
+++ b/content/common/frame.mojom
|
2019-05-13 18:49:01 +00:00
|
|
|
@@ -291,6 +291,10 @@ struct CreateNewWindowParams {
|
2018-09-14 05:02:16 +00:00
|
|
|
|
|
|
|
// The window features to use for the new window.
|
|
|
|
blink.mojom.WindowFeatures features;
|
|
|
|
+
|
|
|
|
+ // Extra fields added by Electron.
|
|
|
|
+ array<string> additional_features;
|
2019-01-24 14:52:14 +00:00
|
|
|
+ network.mojom.URLRequestBody? body;
|
2018-09-14 05:02:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Operation result when the renderer asks the browser to create a new window.
|
|
|
|
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
|
2019-05-21 17:05:21 +00:00
|
|
|
index da482a1a1638f27a413502d9be16a5fb12e9678c..de19cb3a5f3d6685d8dede7c3cdb5b47183ed07f 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/public/browser/content_browser_client.cc
|
|
|
|
+++ b/content/public/browser/content_browser_client.cc
|
2019-05-01 00:18:22 +00:00
|
|
|
@@ -518,6 +518,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
2018-09-14 05:02:16 +00:00
|
|
|
const std::string& frame_name,
|
|
|
|
WindowOpenDisposition disposition,
|
|
|
|
const blink::mojom::WindowFeatures& features,
|
|
|
|
+ const std::vector<std::string>& additional_features,
|
|
|
|
+ const scoped_refptr<network::ResourceRequestBody>& body,
|
|
|
|
bool user_gesture,
|
|
|
|
bool opener_suppressed,
|
|
|
|
bool* no_javascript_access) {
|
|
|
|
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
2019-05-21 17:05:21 +00:00
|
|
|
index 5e79a99f045272846f3840547345adffb991421b..2c722d14437cdad69544e0c67921dbaec15b97da 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/public/browser/content_browser_client.h
|
|
|
|
+++ b/content/public/browser/content_browser_client.h
|
2019-05-01 00:18:22 +00:00
|
|
|
@@ -175,6 +175,7 @@ class RenderFrameHost;
|
2018-09-14 05:02:16 +00:00
|
|
|
class RenderProcessHost;
|
|
|
|
class RenderViewHost;
|
|
|
|
class ResourceContext;
|
|
|
|
+class ResourceRequestBody;
|
2019-02-14 16:34:15 +00:00
|
|
|
class SerialDelegate;
|
2018-09-14 18:03:43 +00:00
|
|
|
class ServiceManagerConnection;
|
2018-09-14 05:02:16 +00:00
|
|
|
class SiteInstance;
|
2019-05-01 00:18:22 +00:00
|
|
|
@@ -801,6 +802,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
2018-09-14 05:02:16 +00:00
|
|
|
const std::string& frame_name,
|
|
|
|
WindowOpenDisposition disposition,
|
|
|
|
const blink::mojom::WindowFeatures& features,
|
|
|
|
+ const std::vector<std::string>& additional_features,
|
|
|
|
+ const scoped_refptr<network::ResourceRequestBody>& body,
|
|
|
|
bool user_gesture,
|
|
|
|
bool opener_suppressed,
|
|
|
|
bool* no_javascript_access);
|
|
|
|
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
|
2019-05-21 17:05:21 +00:00
|
|
|
index 25ab2ac5822670c6f912e4b032f280497cb26ec3..8917dbce71a415c60764f52a977c27a6fe8d335e 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/renderer/render_view_impl.cc
|
|
|
|
+++ b/content/renderer/render_view_impl.cc
|
2019-04-20 17:20:37 +00:00
|
|
|
@@ -77,6 +77,7 @@
|
2018-09-14 18:03:43 +00:00
|
|
|
#include "content/renderer/ime_event_guard.h"
|
2018-09-14 05:02:16 +00:00
|
|
|
#include "content/renderer/internal_document_state_data.h"
|
|
|
|
#include "content/renderer/loader/request_extra_data.h"
|
|
|
|
+#include "content/renderer/loader/web_url_request_util.h"
|
2018-09-21 00:30:26 +00:00
|
|
|
#include "content/renderer/media/audio/audio_device_factory.h"
|
2018-09-14 05:02:16 +00:00
|
|
|
#include "content/renderer/media/stream/media_stream_device_observer.h"
|
2019-04-20 17:20:37 +00:00
|
|
|
#include "content/renderer/media/video_capture/video_capture_impl_manager.h"
|
2019-05-13 18:49:01 +00:00
|
|
|
@@ -1358,6 +1359,8 @@ WebView* RenderViewImpl::CreateView(
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
|
|
|
params->features = ConvertWebWindowFeaturesToMojoWindowFeatures(features);
|
|
|
|
|
2019-01-24 14:52:14 +00:00
|
|
|
+ params->body = GetRequestBodyForWebURLRequest(request);
|
2018-09-14 05:02:16 +00:00
|
|
|
+
|
|
|
|
// We preserve this information before sending the message since |params| is
|
|
|
|
// moved on send.
|
|
|
|
bool is_background_tab =
|
2019-01-16 18:07:52 +00:00
|
|
|
diff --git a/content/shell/browser/web_test/web_test_content_browser_client.cc b/content/shell/browser/web_test/web_test_content_browser_client.cc
|
2019-05-13 18:49:01 +00:00
|
|
|
index 3e3f251af3c531fca379f7fa00f67d671bbe2d5f..e77427146729664247e4dd3313f8533a78059bf7 100644
|
2019-01-16 18:07:52 +00:00
|
|
|
--- a/content/shell/browser/web_test/web_test_content_browser_client.cc
|
|
|
|
+++ b/content/shell/browser/web_test/web_test_content_browser_client.cc
|
2019-05-13 18:49:01 +00:00
|
|
|
@@ -299,6 +299,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
|
2018-09-14 05:02:16 +00:00
|
|
|
const std::string& frame_name,
|
|
|
|
WindowOpenDisposition disposition,
|
|
|
|
const blink::mojom::WindowFeatures& features,
|
|
|
|
+ const std::vector<std::string>& additional_features,
|
|
|
|
+ const scoped_refptr<network::ResourceRequestBody>& body,
|
|
|
|
bool user_gesture,
|
|
|
|
bool opener_suppressed,
|
|
|
|
bool* no_javascript_access) {
|
2019-01-16 18:07:52 +00:00
|
|
|
diff --git a/content/shell/browser/web_test/web_test_content_browser_client.h b/content/shell/browser/web_test/web_test_content_browser_client.h
|
2019-05-13 18:49:01 +00:00
|
|
|
index 8b9ae118bca4678c315d820af6b4dbe850943ed4..acde862d6d48429db5936f2e6735017dc2ef647e 100644
|
2019-01-16 18:07:52 +00:00
|
|
|
--- a/content/shell/browser/web_test/web_test_content_browser_client.h
|
|
|
|
+++ b/content/shell/browser/web_test/web_test_content_browser_client.h
|
2019-05-13 18:49:01 +00:00
|
|
|
@@ -69,6 +69,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
|
2018-09-14 05:02:16 +00:00
|
|
|
const std::string& frame_name,
|
|
|
|
WindowOpenDisposition disposition,
|
|
|
|
const blink::mojom::WindowFeatures& features,
|
|
|
|
+ const std::vector<std::string>& additional_features,
|
|
|
|
+ const scoped_refptr<network::ResourceRequestBody>& body,
|
|
|
|
bool user_gesture,
|
|
|
|
bool opener_suppressed,
|
|
|
|
bool* no_javascript_access) override;
|