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-06-04 03:44:12 +00:00
|
|
|
index d514c10160dd12f225c42e927977660cacbc9c43..49345f1d4d75c8b96efe485202d89774a05b6e34 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-05-13 18:49:01 +00:00
|
|
|
@@ -671,6 +671,9 @@ bool CrossSiteDocumentResourceHandler::ShouldBlockBasedOnHeaders(
|
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-06-12 19:34:07 +00:00
|
|
|
index ce64276225d5b0acf684e9e70c600a64a56fe96e..2a9661d877fbc09904eb469191523b5cd59eaeda 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-06-12 19:34:07 +00:00
|
|
|
index 5bf7340b106bd3ce826ff3322106ef94cbe19d29..ba27455e1c0934f77ed2871ee585361807ab701a 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-06-04 03:44:12 +00:00
|
|
|
@@ -252,6 +252,9 @@ class CONTENT_EXPORT ContentBrowserClient {
|
|
|
|
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
|