2018-11-21 20:10:05 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: deepak1556 <hop2deep@gmail.com>
|
2019-06-04 03:44:12 +00:00
|
|
|
Date: Mon, 3 Jun 2019 14:07:40 -0700
|
2018-11-21 20:10:05 +00:00
|
|
|
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
|
2019-07-24 22:58:51 +00:00
|
|
|
index b74bbef56038e29ca35403affd284a7a8868c201..d6887e576ac197f80a7e5261bd251cd761d1d814 100644
|
2018-11-21 20:10:05 +00:00
|
|
|
--- a/content/browser/loader/cross_site_document_resource_handler.cc
|
|
|
|
+++ b/content/browser/loader/cross_site_document_resource_handler.cc
|
2019-07-24 22:58:51 +00:00
|
|
|
@@ -582,6 +582,9 @@ bool CrossSiteDocumentResourceHandler::ShouldBlockBasedOnHeaders(
|
2019-07-09 01:00:24 +00:00
|
|
|
request()->initiator()->scheme() == url::kFileScheme)
|
2018-11-21 20:10:05 +00:00
|
|
|
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
|
2019-07-26 19:18:32 +00:00
|
|
|
index 39d3c28ca33fa1eeab14b67ec31a6ae09f25c354..1fc64dd493536f1aefafd6a683c19289920000b7 100644
|
2018-11-21 20:10:05 +00:00
|
|
|
--- a/content/public/browser/content_browser_client.cc
|
|
|
|
+++ b/content/public/browser/content_browser_client.cc
|
2019-06-04 03:44:12 +00:00
|
|
|
@@ -71,6 +71,10 @@ std::unique_ptr<BrowserMainParts> ContentBrowserClient::CreateBrowserMainParts(
|
2019-05-31 22:47:18 +00:00
|
|
|
return nullptr;
|
2018-11-21 20:10:05 +00:00
|
|
|
}
|
|
|
|
|
2018-12-05 08:03:39 +00:00
|
|
|
+bool ContentBrowserClient::ShouldBypassCORB(int render_process_id) const {
|
2018-11-21 20:10:05 +00:00
|
|
|
+ return false;
|
|
|
|
+}
|
|
|
|
+
|
2019-05-31 22:47:18 +00:00
|
|
|
void ContentBrowserClient::PostAfterStartupTask(
|
|
|
|
const base::Location& from_here,
|
|
|
|
const scoped_refptr<base::TaskRunner>& task_runner,
|
2018-11-21 20:10:05 +00:00
|
|
|
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
2019-07-26 19:18:32 +00:00
|
|
|
index 3d518759a3bc190970a2d45ec178c97096fa250d..b2c12759d2cd94d7971f20bc289c7fa70f1fe863 100644
|
2018-11-21 20:10:05 +00:00
|
|
|
--- a/content/public/browser/content_browser_client.h
|
|
|
|
+++ b/content/public/browser/content_browser_client.h
|
2019-07-26 19:18:32 +00:00
|
|
|
@@ -249,6 +249,9 @@ class CONTENT_EXPORT ContentBrowserClient {
|
2019-06-04 03:44:12 +00:00
|
|
|
virtual std::unique_ptr<BrowserMainParts> CreateBrowserMainParts(
|
2019-05-31 22:47:18 +00:00
|
|
|
const MainFunctionParams& parameters);
|
2018-11-21 20:10:05 +00:00
|
|
|
|
|
|
|
+ // Electron: Allows bypassing CORB checks for a renderer process.
|
2018-12-05 08:03:39 +00:00
|
|
|
+ virtual bool ShouldBypassCORB(int render_process_id) const;
|
2018-11-21 20:10:05 +00:00
|
|
|
+
|
2019-05-31 22:47:18 +00:00
|
|
|
// 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
|