mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
* build: lock chromium major to 78 on 7-0-x * chore: update patches * fix geometry.mojom * Adopt more inclusive language in //net https://chromium-review.googlesource.com/c/chromium/src/+/1718348 * [mojo] Introduce ServiceFactory API https://chromium-review.googlesource.com/c/chromium/src/+/1717474
53 lines
2.5 KiB
Diff
53 lines
2.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: deepak1556 <hop2deep@gmail.com>
|
|
Date: Mon, 3 Jun 2019 14:07:40 -0700
|
|
Subject: cross_site_document_resource_handler.patch
|
|
|
|
Add a content layer hook to disable CORB for a renderer process,
|
|
this patch can be removed once we switch to network service,
|
|
where the embedders have a chance to design their URLLoaders.
|
|
|
|
diff --git a/content/browser/loader/cross_site_document_resource_handler.cc b/content/browser/loader/cross_site_document_resource_handler.cc
|
|
index b74bbef56038e29ca35403affd284a7a8868c201..d6887e576ac197f80a7e5261bd251cd761d1d814 100644
|
|
--- a/content/browser/loader/cross_site_document_resource_handler.cc
|
|
+++ b/content/browser/loader/cross_site_document_resource_handler.cc
|
|
@@ -582,6 +582,9 @@ bool CrossSiteDocumentResourceHandler::ShouldBlockBasedOnHeaders(
|
|
request()->initiator()->scheme() == url::kFileScheme)
|
|
return false;
|
|
|
|
+ if (GetContentClient()->browser()->ShouldBypassCORB(info->GetChildID()))
|
|
+ return false;
|
|
+
|
|
return true;
|
|
}
|
|
|
|
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
|
|
index 5142cfedf46dafa383f615fe8ca72c1d4c20b36e..691fbc819713beb881402cb8a84886bd0780b106 100644
|
|
--- a/content/public/browser/content_browser_client.cc
|
|
+++ b/content/public/browser/content_browser_client.cc
|
|
@@ -71,6 +71,10 @@ std::unique_ptr<BrowserMainParts> ContentBrowserClient::CreateBrowserMainParts(
|
|
return nullptr;
|
|
}
|
|
|
|
+bool ContentBrowserClient::ShouldBypassCORB(int render_process_id) const {
|
|
+ return false;
|
|
+}
|
|
+
|
|
void ContentBrowserClient::PostAfterStartupTask(
|
|
const base::Location& from_here,
|
|
const scoped_refptr<base::TaskRunner>& task_runner,
|
|
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
|
index 671b2ccfb8f8f21018931c454584d7f0bd2b1418..b5361817676abfdf74cc6cf9a628e18a5aeb3dd8 100644
|
|
--- a/content/public/browser/content_browser_client.h
|
|
+++ b/content/public/browser/content_browser_client.h
|
|
@@ -249,6 +249,9 @@ class CONTENT_EXPORT ContentBrowserClient {
|
|
virtual std::unique_ptr<BrowserMainParts> CreateBrowserMainParts(
|
|
const MainFunctionParams& parameters);
|
|
|
|
+ // Electron: Allows bypassing CORB checks for a renderer process.
|
|
+ virtual bool ShouldBypassCORB(int render_process_id) const;
|
|
+
|
|
// Allows the embedder to change the default behavior of
|
|
// BrowserThread::PostAfterStartupTask to better match whatever
|
|
// definition of "startup" the embedder has in mind. This may be
|