mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: update chromium/revert_remove_contentrendererclient_shouldfork.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2755314 Upstream has removed `history_list_length_` which we were comparing to 0 to calculate our `is_initial_navigation` bool when calling ShouldFork(). ShouldFork() is ours and none of the code paths actually use that param, so this commit removes it altogether.
This commit is contained in:
committed by
Samuel Attard
parent
06ac6c5d6a
commit
2b0cb2ca2a
@@ -11,7 +11,7 @@ This regressed in https://chromium-review.googlesource.com/c/chromium/src/+/2572
|
||||
Upstream: https://chromium-review.googlesource.com/c/chromium/src/+/2598393
|
||||
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index 0a4280ca5a9eed2cb58b817bcea4e735db5c2238..004cf56996cd42b472797679bf4fb0fa85b5cc05 100644
|
||||
index d265ad81c69b54aff24df0e35398ca26e01c1b93..4ac16e2e92920774fab9617008db7deb36f3e3f3 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -2628,7 +2628,7 @@ blink::WebLocalFrame* RenderFrameImpl::GetWebFrame() {
|
||||
|
||||
@@ -9,17 +9,16 @@ for every navigation to keep Node.js working properly. Once Native Modules in th
|
||||
are required to be NAPI or context aware (Electron v11), this patch can be removed.
|
||||
|
||||
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
|
||||
index 1125d64d872b0c4aa22dd63b51e41313f7f5fe5d..e109c26c0be89906060c1b0d4a2837c1cad05149 100644
|
||||
index 1125d64d872b0c4aa22dd63b51e41313f7f5fe5d..17c5e59e54715c928e16c15cb70911cd7766c013 100644
|
||||
--- a/chrome/renderer/chrome_content_renderer_client.cc
|
||||
+++ b/chrome/renderer/chrome_content_renderer_client.cc
|
||||
@@ -1281,6 +1281,25 @@ ChromeContentRendererClient::GetProtocolHandlerSecurityLevel() {
|
||||
@@ -1281,6 +1281,24 @@ ChromeContentRendererClient::GetProtocolHandlerSecurityLevel() {
|
||||
#endif
|
||||
}
|
||||
|
||||
+bool ChromeContentRendererClient::ShouldFork(WebLocalFrame* frame,
|
||||
+ const GURL& url,
|
||||
+ const std::string& http_method,
|
||||
+ bool is_initial_navigation,
|
||||
+ bool is_server_redirect) {
|
||||
+ DCHECK(!frame->Parent());
|
||||
+
|
||||
@@ -39,33 +38,31 @@ index 1125d64d872b0c4aa22dd63b51e41313f7f5fe5d..e109c26c0be89906060c1b0d4a2837c1
|
||||
WebLocalFrame* frame,
|
||||
ui::PageTransition transition_type,
|
||||
diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h
|
||||
index 4fb3926576c80881a9230bb91bfe7655fec12df1..988769f833354d16b68dd9ace603d17e157a666a 100644
|
||||
index 4fb3926576c80881a9230bb91bfe7655fec12df1..0f7f3773cf5efcf55cbf001885083f393529911b 100644
|
||||
--- a/chrome/renderer/chrome_content_renderer_client.h
|
||||
+++ b/chrome/renderer/chrome_content_renderer_client.h
|
||||
@@ -121,6 +121,11 @@ class ChromeContentRendererClient
|
||||
@@ -121,6 +121,10 @@ class ChromeContentRendererClient
|
||||
base::SingleThreadTaskRunner* compositor_thread_task_runner) override;
|
||||
bool RunIdleHandlerWhenWidgetsHidden() override;
|
||||
bool AllowPopup() override;
|
||||
+ bool ShouldFork(blink::WebLocalFrame* frame,
|
||||
+ const GURL& url,
|
||||
+ const std::string& http_method,
|
||||
+ bool is_initial_navigation,
|
||||
+ bool is_server_redirect) override;
|
||||
blink::ProtocolHandlerSecurityLevel GetProtocolHandlerSecurityLevel()
|
||||
override;
|
||||
void WillSendRequest(blink::WebLocalFrame* frame,
|
||||
diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc
|
||||
index 9745f3208baaf1654c8386c11067958c0e47fd28..8ebebd91eb1216d5ccb4dd31dad0b9772053f2f1 100644
|
||||
index 9745f3208baaf1654c8386c11067958c0e47fd28..f441e4b65835343d385c2377be70d71e7e9c9fca 100644
|
||||
--- a/content/public/renderer/content_renderer_client.cc
|
||||
+++ b/content/public/renderer/content_renderer_client.cc
|
||||
@@ -117,6 +117,14 @@ bool ContentRendererClient::HandleNavigation(
|
||||
@@ -117,6 +117,13 @@ bool ContentRendererClient::HandleNavigation(
|
||||
}
|
||||
#endif
|
||||
|
||||
+bool ContentRendererClient::ShouldFork(blink::WebLocalFrame* frame,
|
||||
+ const GURL& url,
|
||||
+ const std::string& http_method,
|
||||
+ bool is_initial_navigation,
|
||||
+ bool is_server_redirect) {
|
||||
+ return false;
|
||||
+}
|
||||
@@ -74,10 +71,10 @@ index 9745f3208baaf1654c8386c11067958c0e47fd28..8ebebd91eb1216d5ccb4dd31dad0b977
|
||||
blink::WebLocalFrame* frame,
|
||||
ui::PageTransition transition_type,
|
||||
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
|
||||
index f259835ef4cabb8923f8b0fe9b3f6ae8f2b2b79f..205685f200d54e53829ddc29de3bc07e24ea13b1 100644
|
||||
index f259835ef4cabb8923f8b0fe9b3f6ae8f2b2b79f..a538b9ebcfa232b90fc7713e6569608a16c57ed3 100644
|
||||
--- a/content/public/renderer/content_renderer_client.h
|
||||
+++ b/content/public/renderer/content_renderer_client.h
|
||||
@@ -207,6 +207,13 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
@@ -207,6 +207,12 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
bool is_redirect);
|
||||
#endif
|
||||
|
||||
@@ -85,17 +82,16 @@ index f259835ef4cabb8923f8b0fe9b3f6ae8f2b2b79f..205685f200d54e53829ddc29de3bc07e
|
||||
+ virtual bool ShouldFork(blink::WebLocalFrame* frame,
|
||||
+ const GURL& url,
|
||||
+ const std::string& http_method,
|
||||
+ bool is_initial_navigation,
|
||||
+ bool is_server_redirect);
|
||||
+
|
||||
// Notifies the embedder that the given frame is requesting the resource at
|
||||
// |url|. If the function returns a valid |new_url|, the request must be
|
||||
// updated to use it.
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index ae77e7566d47aa86513dc9671dd9a67c684e74f1..0a4280ca5a9eed2cb58b817bcea4e735db5c2238 100644
|
||||
index ae77e7566d47aa86513dc9671dd9a67c684e74f1..d265ad81c69b54aff24df0e35398ca26e01c1b93 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -5318,6 +5318,23 @@ void RenderFrameImpl::BeginNavigation(
|
||||
@@ -5318,6 +5318,22 @@ void RenderFrameImpl::BeginNavigation(
|
||||
// we can do a per-frame check here rather than a process-wide check.
|
||||
bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) ||
|
||||
(enabled_bindings_ & kWebUIBindingsPolicyMask);
|
||||
@@ -110,10 +106,9 @@ index ae77e7566d47aa86513dc9671dd9a67c684e74f1..0a4280ca5a9eed2cb58b817bcea4e735
|
||||
+
|
||||
+ if (!should_fork) {
|
||||
+ // Give the embedder a chance.
|
||||
+ bool is_initial_navigation = render_view_->history_list_length_ == 0;
|
||||
+ should_fork = GetContentClient()->renderer()->ShouldFork(
|
||||
+ frame_, url, info->url_request.HttpMethod().Utf8(),
|
||||
+ is_initial_navigation, false /* is_redirect */);
|
||||
+ false /* is_redirect */);
|
||||
+ }
|
||||
+
|
||||
if (should_fork) {
|
||||
|
||||
@@ -19,10 +19,10 @@ that clearly establishes the worker script is ready for evaluation with the scop
|
||||
initialized.
|
||||
|
||||
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
|
||||
index 205685f200d54e53829ddc29de3bc07e24ea13b1..31656a92b1e0be23ffc4f4fc3d1ba303c76ba234 100644
|
||||
index a538b9ebcfa232b90fc7713e6569608a16c57ed3..53917132e03fc1767083ec4aaa6b8d4a06a0cf07 100644
|
||||
--- a/content/public/renderer/content_renderer_client.h
|
||||
+++ b/content/public/renderer/content_renderer_client.h
|
||||
@@ -378,6 +378,11 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
@@ -377,6 +377,11 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
virtual void DidInitializeWorkerContextOnWorkerThread(
|
||||
v8::Local<v8::Context> context) {}
|
||||
|
||||
|
||||
@@ -197,7 +197,6 @@ void ElectronRendererClient::WillReleaseScriptContext(
|
||||
bool ElectronRendererClient::ShouldFork(blink::WebLocalFrame* frame,
|
||||
const GURL& url,
|
||||
const std::string& http_method,
|
||||
bool is_initial_navigation,
|
||||
bool is_server_redirect) {
|
||||
// Handle all the navigations and reloads in browser.
|
||||
// FIXME We only support GET here because http method will be ignored when
|
||||
|
||||
@@ -44,7 +44,6 @@ class ElectronRendererClient : public RendererClientBase {
|
||||
bool ShouldFork(blink::WebLocalFrame* frame,
|
||||
const GURL& url,
|
||||
const std::string& http_method,
|
||||
bool is_initial_navigation,
|
||||
bool is_server_redirect) override;
|
||||
void WorkerScriptReadyForEvaluationOnWorkerThread(
|
||||
v8::Local<v8::Context> context) override;
|
||||
|
||||
@@ -277,7 +277,6 @@ void ElectronSandboxedRendererClient::WillReleaseScriptContext(
|
||||
bool ElectronSandboxedRendererClient::ShouldFork(blink::WebLocalFrame* frame,
|
||||
const GURL& url,
|
||||
const std::string& http_method,
|
||||
bool is_initial_navigation,
|
||||
bool is_server_redirect) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ class ElectronSandboxedRendererClient : public RendererClientBase {
|
||||
bool ShouldFork(blink::WebLocalFrame* frame,
|
||||
const GURL& url,
|
||||
const std::string& http_method,
|
||||
bool is_initial_navigation,
|
||||
bool is_server_redirect) override;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user