2018-11-21 20:10:05 +00:00
|
|
|
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
|
2019-05-13 18:49:01 +00:00
|
|
|
index 2151c5b9698e9a2768875d04a2297956cc4c0d41..8a316a117ab367bcbac947894cbe1bc2428de93e 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-05-21 17:05:21 +00:00
|
|
|
index acf458d5c088607d3ceb6d058f28f076bf4cf712..4bdfeefc531b378f33b143ea432aebd69906bf08 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-02-14 16:34:15 +00:00
|
|
|
@@ -61,6 +61,10 @@ ContentBrowserClient::SiteInstanceForNavigationType ContentBrowserClient::Should
|
2018-12-05 08:03:39 +00:00
|
|
|
return SiteInstanceForNavigationType::ASK_CHROMIUM;
|
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;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
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
|
2019-05-21 17:05:21 +00:00
|
|
|
index 9c7c77b44d279219411ce545c5448acecbd56d59..f99105176cc97e13b5d2b7c470b95e23b404de0a 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-05-01 00:18:22 +00:00
|
|
|
@@ -241,6 +241,9 @@ class CONTENT_EXPORT ContentBrowserClient {
|
2018-12-05 08:03:39 +00:00
|
|
|
content::RenderFrameHost* rfh,
|
2019-02-27 01:43:34 +00:00
|
|
|
content::SiteInstance* pending_site_instance) {}
|
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
|
|
|
+
|
|
|
|
// Allows the embedder to set any number of custom BrowserMainParts
|
|
|
|
// implementations for the browser startup code. See comments in
|
|
|
|
// browser_main_parts.h.
|