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-04-20 17:20:37 +00:00
|
|
|
index a3651be4e397f85350bdf13179ca826c18b44cb5..6f3b476f027d768140813654033e44cd121365db 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-04-20 17:20:37 +00:00
|
|
|
@@ -3669,6 +3669,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-04-20 17:20:37 +00:00
|
|
|
index 7deab3ea78fc85815a7c713dc7718723f9302975..cf352ff127ea9aee0dcf5eff3915b21def76f0bb 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/common/frame.mojom
|
|
|
|
+++ b/content/common/frame.mojom
|
2019-04-20 17:20:37 +00:00
|
|
|
@@ -288,6 +288,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-04-20 17:20:37 +00:00
|
|
|
index 445e1febebe62b014d995a2bfb8ceefedc1e5e6a..03999fb7f9bfc1bb21cda1bfe15e95fb3bc9b678 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-04-20 17:20:37 +00:00
|
|
|
@@ -519,6 +519,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-04-20 17:20:37 +00:00
|
|
|
index 0a1bf5d0b4d1fddcef30d2da697dc77b5b7f8c79..424bdb1dde40cc4003e022908de702a9d9e488d4 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-04-20 17:20:37 +00:00
|
|
|
@@ -178,6 +178,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-04-20 17:20:37 +00:00
|
|
|
@@ -798,6 +799,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-04-20 17:20:37 +00:00
|
|
|
index 3e328daa58275e05b30b7a3fabb03f69db2fd7d2..d207e3760d8b48c1283085da132ee03eddb4c17c 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"
|
|
|
|
@@ -1370,6 +1371,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-04-20 17:20:37 +00:00
|
|
|
index a303b169acb638a0c4bbec1349a028c8d89762bd..c95dcedefc74e5ad9883d16448bb36fcb5a088a6 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-04-20 17:20:37 +00:00
|
|
|
@@ -298,6 +298,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-04-20 17:20:37 +00:00
|
|
|
index 6413e5f117d7dfd4a61779d4c971c28a14a86082..a02e232249cf99c55ec5b07a94b29f0a6d4a38bf 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-04-20 17:20:37 +00:00
|
|
|
@@ -68,6 +68,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;
|