mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
* SiteInstance::CreateRelatedSiteInstance and use it * Some relies on preloads in opened window The fact that, now, we always have an opener for opened windows diables note integration in opened windows, except if `nodeIntegrationInSubFrames` is enabled. * Add a test on window.opener after cross-orgin navigation * Make sure to unregisterProtocol in tests * Introduc and use a NetworkSandbox for tests * Modify tests about zoom persistence to properly simulate cross-origin navigation * Revert "Modify tests about zoom persistence to properly simulate cross-origin navigation" This reverts commit 0a7537f2eb7f183ddec16637e8a2e92a0d600321.
53 lines
2.4 KiB
Diff
53 lines
2.4 KiB
Diff
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 bd62ed07876ad4a2a7c6e8309843281719dbefb6..13e67994997caf175ba1b30ba8070718a697588d 100644
|
|
--- a/content/browser/loader/cross_site_document_resource_handler.cc
|
|
+++ b/content/browser/loader/cross_site_document_resource_handler.cc
|
|
@@ -673,6 +673,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 0aff71c4339d0eacecf6b6d86ab750738696c31e..d3b2cdece52c4ca47776b6c79a97f2239fb253b6 100644
|
|
--- a/content/public/browser/content_browser_client.cc
|
|
+++ b/content/public/browser/content_browser_client.cc
|
|
@@ -58,6 +58,10 @@ ContentBrowserClient::SiteInstanceForNavigationType ContentBrowserClient::Should
|
|
return SiteInstanceForNavigationType::ASK_CHROMIUM;
|
|
}
|
|
|
|
+bool ContentBrowserClient::ShouldBypassCORB(int render_process_id) const {
|
|
+ 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 9f0a966d8abf72b606906b14f00748b4466f8b0a..d01b1eaa680a6cfd999a67ecbdfd3cd29c311dc9 100644
|
|
--- a/content/public/browser/content_browser_client.h
|
|
+++ b/content/public/browser/content_browser_client.h
|
|
@@ -237,6 +237,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) const;
|
|
+
|
|
// Allows the embedder to set any number of custom BrowserMainParts
|
|
// implementations for the browser startup code. See comments in
|
|
// browser_main_parts.h.
|