Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04a678a
commit b179c93
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
patches/common/chromium/cross_site_document_resource_handler.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: deepak1556 <hop2deep@gmail.com> | ||
Date: Thu, 15 Nov 2018 22:04:34 +0530 | ||
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 907922701280b589bf11691342de0ec95cdec6a1..eaf8bac18f8e3a2735ce7ded606199092a3746d3 100644 | ||
--- a/content/browser/loader/cross_site_document_resource_handler.cc | ||
+++ b/content/browser/loader/cross_site_document_resource_handler.cc | ||
@@ -593,6 +593,9 @@ bool CrossSiteDocumentResourceHandler::ShouldBlockBasedOnHeaders( | ||
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 2d0633f38ddfc0fa1999674903b1d5e8952e22d5..f6d805520c2c65d02a426391ec1309b8664a14ca 100644 | ||
--- a/content/public/browser/content_browser_client.cc | ||
+++ b/content/public/browser/content_browser_client.cc | ||
@@ -57,6 +57,10 @@ ContentBrowserClient::ShouldOverrideSiteInstanceForNavigation( | ||
return SiteInstanceForNavigationType::ASK_CHROMIUM; | ||
} | ||
|
||
+bool ContentBrowserClient::ShouldBypassCORB(int render_process_id) { | ||
+ return false; | ||
+} | ||
+ | ||
BrowserMainParts* ContentBrowserClient::CreateBrowserMainParts( | ||
const MainFunctionParams& parameters) { | ||
return nullptr; | ||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h | ||
index 0554de92d81e54367e6f430bfe0c93e3a486ea66..64732e916ae5b40ec216f3fed5a85324aaff69fb 100644 | ||
--- a/content/public/browser/content_browser_client.h | ||
+++ b/content/public/browser/content_browser_client.h | ||
@@ -224,6 +224,9 @@ class CONTENT_EXPORT ContentBrowserClient { | ||
content::RenderFrameHost* rfh, | ||
content::SiteInstance* pending_site_instance){}; | ||
|
||
+ // Electron: Allows bypassing CORB checks for a renderer process. | ||
+ virtual bool ShouldBypassCORB(int render_process_id); | ||
+ | ||
// Allows the embedder to set any number of custom BrowserMainParts | ||
// implementations for the browser startup code. See comments in | ||
// browser_main_parts.h. |