electron/patches/chromium/cross_site_document_resource_handler.patch
Electron Bot a90306876e chore: bump chromium to b8ae827f4fead0b527079194b9899 (master) (#19112)
* chore: bump chromium in DEPS to c87ad34dfd48610959977db9b6eeeb86f5feafe9

* chore: rebase patches

* chore: bump chromium in DEPS to ad29fca14d77b2a1752f24d9425278c6737c0f70

* chore: bump chromium in DEPS to 22c21a9cc728e7958e3ac1033cfdc6ed0f0a8b10

* chore: bump chromium in DEPS to 8c86dd7f76abf4ad1ab41796d2da6172b1b10866

* chore: update patches

* chore: bump chromium in DEPS to 5a48e127c8cb8ae827f4fead0b527079194b9899

* remove TransformPointToLocalCoordSpaceLegacy

https://chromium-review.googlesource.com/c/chromium/src/+/1637525
2019-07-09 10:00:24 +09:00

52 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 8bbfacaa267dd0fac51593c0f8d6ba6b6ccfe5ee..caf8357a86182996bffbd3ee394c026189709e18 100644
--- a/content/browser/loader/cross_site_document_resource_handler.cc
+++ b/content/browser/loader/cross_site_document_resource_handler.cc
@@ -578,6 +578,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 090eaa070e56d84255f570af3d9f0ea56d02cb69..682b2156f40326ebad00231c0e8bb472fdaf1bbb 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 e67ab701d608f87cfaf259d44b17605467181fea..0127e41aaadf18effcc66e1743ef1ab6223b1d10 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -252,6 +252,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