2018-10-24 18:24:11 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-09-21 00:30:26 +00:00
|
|
|
From: deepak1556 <hop2deep@gmail.com>
|
2019-06-04 03:44:12 +00:00
|
|
|
Date: Mon, 3 Jun 2019 14:20:05 -0700
|
2018-09-21 00:30:26 +00:00
|
|
|
Subject: frame_host_manager.patch
|
|
|
|
|
2018-11-14 15:14:10 +00:00
|
|
|
Allows embedder to intercept site instances chosen by chromium
|
2019-05-31 22:47:18 +00:00
|
|
|
and respond with custom instance. Also allows for us to at-runtime
|
|
|
|
enable or disable this patch.
|
2018-09-21 00:30:26 +00:00
|
|
|
|
2019-06-03 20:23:15 +00:00
|
|
|
diff --git a/content/browser/browsing_instance.cc b/content/browser/browsing_instance.cc
|
2020-10-28 00:33:04 +00:00
|
|
|
index 0061b2000ed0f00a12346493604e9e0d9f5831ce..ef296a03ee9429373708d9d01c434caadad066b3 100644
|
2019-06-03 20:23:15 +00:00
|
|
|
--- a/content/browser/browsing_instance.cc
|
|
|
|
+++ b/content/browser/browsing_instance.cc
|
2020-10-16 01:30:41 +00:00
|
|
|
@@ -86,6 +86,13 @@ scoped_refptr<SiteInstanceImpl> BrowsingInstance::GetSiteInstanceForURL(
|
2019-06-03 20:23:15 +00:00
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
+scoped_refptr<SiteInstanceImpl> BrowsingInstance::CreateSiteInstanceForURL(
|
|
|
|
+ const GURL& url) {
|
|
|
|
+ scoped_refptr<SiteInstanceImpl> instance = new SiteInstanceImpl(this);
|
2020-10-16 01:30:41 +00:00
|
|
|
+ instance->SetSite(UrlInfo(url, false));
|
2019-06-03 20:23:15 +00:00
|
|
|
+ return instance;
|
|
|
|
+}
|
|
|
|
+
|
2020-10-16 01:30:41 +00:00
|
|
|
SiteInfo BrowsingInstance::GetSiteInfoForURL(const UrlInfo& url_info,
|
2020-07-22 05:34:34 +00:00
|
|
|
bool allow_default_instance) {
|
|
|
|
scoped_refptr<SiteInstanceImpl> site_instance =
|
2019-06-03 20:23:15 +00:00
|
|
|
diff --git a/content/browser/browsing_instance.h b/content/browser/browsing_instance.h
|
2020-10-16 01:30:41 +00:00
|
|
|
index 8e22428ddd0c545a94b04942fe9a2bf5f137b374..2436871e3d04ec276620d97ddd0a20ddc4f2b36b 100644
|
2019-06-03 20:23:15 +00:00
|
|
|
--- a/content/browser/browsing_instance.h
|
|
|
|
+++ b/content/browser/browsing_instance.h
|
2020-10-16 01:30:41 +00:00
|
|
|
@@ -149,6 +149,11 @@ class CONTENT_EXPORT BrowsingInstance final
|
|
|
|
const UrlInfo& url_info,
|
2019-06-03 20:23:15 +00:00
|
|
|
bool allow_default_instance);
|
|
|
|
|
|
|
|
+ // Create a new SiteInstance for the given URL bound the current
|
|
|
|
+ // BrowsingInstance.
|
|
|
|
+ scoped_refptr<SiteInstanceImpl> CreateSiteInstanceForURL(
|
|
|
|
+ const GURL& url);
|
|
|
|
+
|
|
|
|
// Adds the given SiteInstance to our map, to ensure that we do not create
|
|
|
|
// another SiteInstance for the same site.
|
|
|
|
void RegisterSiteInstance(SiteInstanceImpl* site_instance);
|
2020-09-21 08:00:36 +00:00
|
|
|
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc
|
2020-11-14 00:16:56 +00:00
|
|
|
index ba52e78d28d4198ca028ff678ef58c0121c665e9..2880e8f8f03ecd226c156ac9899917413cb88453 100644
|
2020-09-21 08:00:36 +00:00
|
|
|
--- a/content/browser/renderer_host/navigation_request.cc
|
|
|
|
+++ b/content/browser/renderer_host/navigation_request.cc
|
2020-11-14 00:16:56 +00:00
|
|
|
@@ -1422,6 +1422,21 @@ void NavigationRequest::BeginNavigation() {
|
2020-10-28 00:33:04 +00:00
|
|
|
is_loaded_from_mhtml_archive_ = IsForMhtmlSubframe();
|
|
|
|
ComputeSandboxFlagsToCommit();
|
2019-12-11 00:22:35 +00:00
|
|
|
|
|
|
|
+ // In Electron, a new process is started for every navigation when node is
|
|
|
|
+ // integrated in the renderer. Since GetFrameHostForNavigation is called more
|
|
|
|
+ // than once per navigation, we want to return the same frame host once
|
|
|
|
+ // the response has started, otherwise if the frame host that started the response
|
|
|
|
+ // and the frame host that is available for commit don't match then request will
|
|
|
|
+ // be cancelled. We rely on the NavigationRequest::state_ to determine this
|
|
|
|
+ // factor
|
|
|
|
+ //
|
|
|
|
+ // bool has_response_started =
|
|
|
|
+ // (request->state() >= NavigationRequest::WILL_PROCESS_RESPONSE &&
|
|
|
|
+ // !speculative_render_frame_host_);
|
|
|
|
+ //
|
2020-06-22 17:35:10 +00:00
|
|
|
+ // Hence this call is necesary before the call to GetFrameHostForNavigation.
|
|
|
|
+ SetState(REUSE_SITE_INSTANCE);
|
2019-12-11 00:22:35 +00:00
|
|
|
+
|
|
|
|
// Select an appropriate RenderFrameHost.
|
2020-11-14 00:16:56 +00:00
|
|
|
std::string frame_host_choice_reason;
|
2019-12-11 00:22:35 +00:00
|
|
|
render_frame_host_ =
|
2020-11-14 00:16:56 +00:00
|
|
|
@@ -5239,6 +5254,7 @@ void NavigationRequest::CheckStateTransition(NavigationState state) const {
|
2020-07-14 01:13:34 +00:00
|
|
|
{WILL_START_REQUEST, {
|
|
|
|
WILL_REDIRECT_REQUEST,
|
|
|
|
WILL_PROCESS_RESPONSE,
|
|
|
|
+ REUSE_SITE_INSTANCE,
|
|
|
|
READY_TO_COMMIT,
|
|
|
|
DID_COMMIT,
|
|
|
|
CANCELING,
|
2020-11-14 00:16:56 +00:00
|
|
|
@@ -5252,10 +5268,14 @@ void NavigationRequest::CheckStateTransition(NavigationState state) const {
|
2020-07-14 01:13:34 +00:00
|
|
|
WILL_FAIL_REQUEST,
|
|
|
|
}},
|
|
|
|
{WILL_PROCESS_RESPONSE, {
|
|
|
|
+ REUSE_SITE_INSTANCE,
|
|
|
|
READY_TO_COMMIT,
|
|
|
|
CANCELING,
|
|
|
|
WILL_FAIL_REQUEST,
|
|
|
|
}},
|
|
|
|
+ {REUSE_SITE_INSTANCE, {
|
|
|
|
+ READY_TO_COMMIT,
|
|
|
|
+ }},
|
|
|
|
{READY_TO_COMMIT, {
|
|
|
|
NOT_STARTED,
|
|
|
|
DID_COMMIT,
|
2020-09-21 08:00:36 +00:00
|
|
|
diff --git a/content/browser/renderer_host/navigation_request.h b/content/browser/renderer_host/navigation_request.h
|
2020-11-14 00:16:56 +00:00
|
|
|
index 5ea4a6cbcfdc462783e248293b7c0633812fcd3c..fc6fe28372a1f6cf67db18b76011da20c786193e 100644
|
2020-09-21 08:00:36 +00:00
|
|
|
--- a/content/browser/renderer_host/navigation_request.h
|
|
|
|
+++ b/content/browser/renderer_host/navigation_request.h
|
2020-11-14 00:16:56 +00:00
|
|
|
@@ -131,6 +131,10 @@ class CONTENT_EXPORT NavigationRequest
|
2020-06-22 17:35:10 +00:00
|
|
|
// asynchronous.
|
|
|
|
WILL_PROCESS_RESPONSE,
|
|
|
|
|
|
|
|
+ // Electron: state that is between than WILL_PROCESS_RESPONSE and
|
|
|
|
+ // READY_TO_COMMIT to force reuse the same site instance.
|
|
|
|
+ REUSE_SITE_INSTANCE,
|
|
|
|
+
|
|
|
|
// The response started on the IO thread and is ready to be committed.
|
|
|
|
READY_TO_COMMIT,
|
|
|
|
|
2020-09-21 08:00:36 +00:00
|
|
|
diff --git a/content/browser/renderer_host/render_frame_host_manager.cc b/content/browser/renderer_host/render_frame_host_manager.cc
|
2020-11-14 00:16:56 +00:00
|
|
|
index af2a0a2e5559f3ed58a9c4a74885f74e7779f8a0..229e33b7baed57fb65549dd22a0371289e3847c5 100644
|
2020-09-21 08:00:36 +00:00
|
|
|
--- a/content/browser/renderer_host/render_frame_host_manager.cc
|
|
|
|
+++ b/content/browser/renderer_host/render_frame_host_manager.cc
|
2020-11-14 00:16:56 +00:00
|
|
|
@@ -2631,6 +2631,16 @@ scoped_refptr<SiteInstance>
|
2019-01-12 01:00:43 +00:00
|
|
|
RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
2020-11-14 00:16:56 +00:00
|
|
|
NavigationRequest* request,
|
|
|
|
std::string* reason) {
|
2019-11-05 23:41:20 +00:00
|
|
|
+ // Compute the SiteInstance that the navigation should use, which will be
|
|
|
|
+ // either the current SiteInstance or a new one.
|
|
|
|
+ //
|
|
|
|
+ // TODO(clamy): We should also consider as a candidate SiteInstance the
|
|
|
|
+ // speculative SiteInstance that was computed on redirects.
|
|
|
|
+ SiteInstanceImpl* candidate_site_instance =
|
|
|
|
+ speculative_render_frame_host_
|
|
|
|
+ ? speculative_render_frame_host_->GetSiteInstance()
|
|
|
|
+ : nullptr;
|
2019-07-03 01:22:09 +00:00
|
|
|
+
|
2019-01-12 01:00:43 +00:00
|
|
|
SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance();
|
2019-07-03 01:22:09 +00:00
|
|
|
|
|
|
|
// All children of MHTML documents must be MHTML documents. They all live in
|
2020-11-14 00:16:56 +00:00
|
|
|
@@ -2658,10 +2668,60 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
2019-11-05 23:41:20 +00:00
|
|
|
//
|
2019-05-31 22:47:18 +00:00
|
|
|
// TODO(clamy): We should also consider as a candidate SiteInstance the
|
|
|
|
// speculative SiteInstance that was computed on redirects.
|
2019-07-03 01:22:09 +00:00
|
|
|
- SiteInstanceImpl* candidate_site_instance =
|
2019-11-05 23:41:20 +00:00
|
|
|
- speculative_render_frame_host_
|
|
|
|
- ? speculative_render_frame_host_->GetSiteInstance()
|
|
|
|
- : nullptr;
|
|
|
|
+ if (!GetContentClient()->browser()->CanUseCustomSiteInstance() &&
|
|
|
|
+ frame_tree_node_->IsMainFrame()) {
|
|
|
|
+ BrowserContext* browser_context =
|
|
|
|
+ delegate_->GetControllerForRenderManager().GetBrowserContext();
|
|
|
|
+ bool has_navigation_started = request->state() != NavigationRequest::NOT_STARTED;
|
|
|
|
+ bool has_response_started =
|
2019-12-11 00:22:35 +00:00
|
|
|
+ (request->state() >= NavigationRequest::WILL_PROCESS_RESPONSE &&
|
|
|
|
+ !speculative_render_frame_host_);
|
2019-11-05 23:41:20 +00:00
|
|
|
+ // Gives user a chance to choose a custom site instance.
|
|
|
|
+ SiteInstance* affinity_site_instance = nullptr;
|
|
|
|
+ scoped_refptr<SiteInstance> overriden_site_instance;
|
|
|
|
+ bool should_register_site_instance = false;
|
|
|
|
+ ContentBrowserClient::SiteInstanceForNavigationType siteInstanceType =
|
|
|
|
+ GetContentClient()->browser()->ShouldOverrideSiteInstanceForNavigation(
|
|
|
|
+ current_frame_host(), speculative_frame_host(), browser_context,
|
|
|
|
+ request->common_params().url, has_navigation_started,
|
|
|
|
+ has_response_started, &affinity_site_instance);
|
|
|
|
+ switch (siteInstanceType) {
|
|
|
|
+ case ContentBrowserClient::SiteInstanceForNavigationType::
|
|
|
|
+ FORCE_CANDIDATE_OR_NEW:
|
|
|
|
+ overriden_site_instance =
|
|
|
|
+ candidate_site_instance
|
|
|
|
+ ? candidate_site_instance
|
|
|
|
+ : current_site_instance->CreateRelatedSiteInstance(
|
|
|
|
+ request->common_params().url);
|
|
|
|
+ should_register_site_instance = true;
|
|
|
|
+ break;
|
|
|
|
+ case ContentBrowserClient::SiteInstanceForNavigationType::FORCE_NEW:
|
|
|
|
+ overriden_site_instance = current_site_instance->CreateRelatedSiteInstance(
|
|
|
|
+ request->common_params().url);
|
|
|
|
+ should_register_site_instance = true;
|
|
|
|
+ break;
|
|
|
|
+ case ContentBrowserClient::SiteInstanceForNavigationType::FORCE_CURRENT:
|
|
|
|
+ overriden_site_instance = render_frame_host_->GetSiteInstance();
|
|
|
|
+ break;
|
|
|
|
+ case ContentBrowserClient::SiteInstanceForNavigationType::FORCE_AFFINITY:
|
|
|
|
+ DCHECK(affinity_site_instance);
|
|
|
|
+ overriden_site_instance =
|
|
|
|
+ scoped_refptr<SiteInstance>(affinity_site_instance);
|
|
|
|
+ break;
|
|
|
|
+ case ContentBrowserClient::SiteInstanceForNavigationType::ASK_CHROMIUM:
|
|
|
|
+ DCHECK(!affinity_site_instance);
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if (overriden_site_instance) {
|
|
|
|
+ if (should_register_site_instance) {
|
|
|
|
+ GetContentClient()->browser()->RegisterPendingSiteInstance(
|
|
|
|
+ render_frame_host_.get(), overriden_site_instance.get());
|
|
|
|
+ }
|
|
|
|
+ return overriden_site_instance;
|
|
|
|
+ }
|
2019-05-31 22:47:18 +00:00
|
|
|
+ }
|
|
|
|
|
2020-01-29 21:45:08 +00:00
|
|
|
// Account for renderer-initiated reload as well.
|
|
|
|
// Needed as a workaround for https://crbug.com/1045524, remove it when it is
|
2020-11-14 00:16:56 +00:00
|
|
|
@@ -2700,6 +2760,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
2020-03-03 21:35:05 +00:00
|
|
|
request->ResetStateForSiteInstanceChange();
|
|
|
|
}
|
2018-12-05 08:03:39 +00:00
|
|
|
|
|
|
|
+ GetContentClient()->browser()->RegisterPendingSiteInstance(
|
|
|
|
+ render_frame_host_.get(), dest_site_instance.get());
|
|
|
|
+
|
|
|
|
return dest_site_instance;
|
|
|
|
}
|
|
|
|
|
2019-06-03 20:23:15 +00:00
|
|
|
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
|
2020-11-14 00:16:56 +00:00
|
|
|
index 814cc90ee58f0606bb41b3703b17e92602e84813..dfa649b86a683005a4c59863034e986decade20e 100644
|
2019-06-03 20:23:15 +00:00
|
|
|
--- a/content/browser/site_instance_impl.cc
|
|
|
|
+++ b/content/browser/site_instance_impl.cc
|
2020-10-28 00:33:04 +00:00
|
|
|
@@ -707,6 +707,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const SiteInfo& site_info) {
|
2020-07-22 05:34:34 +00:00
|
|
|
return browsing_instance_->HasSiteInstance(site_info);
|
2019-06-03 20:23:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+scoped_refptr<SiteInstance> SiteInstanceImpl::CreateRelatedSiteInstance(const GURL& url) {
|
|
|
|
+ return browsing_instance_->CreateSiteInstanceForURL(url);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
scoped_refptr<SiteInstance> SiteInstanceImpl::GetRelatedSiteInstance(
|
|
|
|
const GURL& url) {
|
2020-10-16 01:30:41 +00:00
|
|
|
return GetRelatedSiteInstanceImpl(
|
2019-06-03 20:23:15 +00:00
|
|
|
diff --git a/content/browser/site_instance_impl.h b/content/browser/site_instance_impl.h
|
2020-11-14 00:16:56 +00:00
|
|
|
index 2c215c8761f202d7bd29e14693dcbf7596a0b89b..d613c1ac74c2c6a4560bfecd2c79352a36b229ba 100644
|
2019-06-03 20:23:15 +00:00
|
|
|
--- a/content/browser/site_instance_impl.h
|
|
|
|
+++ b/content/browser/site_instance_impl.h
|
2020-11-14 00:16:56 +00:00
|
|
|
@@ -321,6 +321,7 @@ class CONTENT_EXPORT SiteInstanceImpl final : public SiteInstance,
|
2019-06-03 20:23:15 +00:00
|
|
|
BrowserContext* GetBrowserContext() override;
|
|
|
|
const GURL& GetSiteURL() override;
|
|
|
|
scoped_refptr<SiteInstance> GetRelatedSiteInstance(const GURL& url) override;
|
2019-06-04 03:44:12 +00:00
|
|
|
+ scoped_refptr<SiteInstance> CreateRelatedSiteInstance(const GURL& url) override;
|
2019-06-03 20:23:15 +00:00
|
|
|
bool IsRelatedSiteInstance(const SiteInstance* instance) override;
|
|
|
|
size_t GetRelatedActiveContentsCount() override;
|
|
|
|
bool RequiresDedicatedProcess() override;
|
2018-12-05 08:03:39 +00:00
|
|
|
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
|
2020-11-14 00:16:56 +00:00
|
|
|
index 1c10e687a745b261cd57c045c2d7abfc5d1ae6e8..1d6c523c8d3a59fe3b35e8ec765f69a68cc873a1 100644
|
2018-12-05 08:03:39 +00:00
|
|
|
--- a/content/public/browser/content_browser_client.cc
|
|
|
|
+++ b/content/public/browser/content_browser_client.cc
|
2020-10-28 00:33:04 +00:00
|
|
|
@@ -64,6 +64,21 @@
|
2019-08-15 20:50:58 +00:00
|
|
|
|
|
|
|
namespace content {
|
2018-12-05 08:03:39 +00:00
|
|
|
|
2019-05-31 22:47:18 +00:00
|
|
|
+bool ContentBrowserClient::CanUseCustomSiteInstance() {
|
|
|
|
+ return false;
|
|
|
|
+}
|
|
|
|
+
|
2018-12-05 08:03:39 +00:00
|
|
|
+ContentBrowserClient::SiteInstanceForNavigationType ContentBrowserClient::ShouldOverrideSiteInstanceForNavigation(
|
|
|
|
+ content::RenderFrameHost* current_rfh,
|
|
|
|
+ content::RenderFrameHost* speculative_rfh,
|
|
|
|
+ content::BrowserContext* browser_context,
|
|
|
|
+ const GURL& url,
|
2019-08-08 18:48:33 +00:00
|
|
|
+ bool has_navigation_started,
|
2018-12-05 08:03:39 +00:00
|
|
|
+ bool has_request_started,
|
|
|
|
+ content::SiteInstance** affinity_site_instance) const {
|
|
|
|
+ return SiteInstanceForNavigationType::ASK_CHROMIUM;
|
|
|
|
+}
|
|
|
|
+
|
2019-06-04 03:44:12 +00:00
|
|
|
std::unique_ptr<BrowserMainParts> ContentBrowserClient::CreateBrowserMainParts(
|
2018-12-05 08:03:39 +00:00
|
|
|
const MainFunctionParams& parameters) {
|
|
|
|
return nullptr;
|
2018-09-14 05:02:16 +00:00
|
|
|
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
2020-11-14 00:16:56 +00:00
|
|
|
index e90958ad2c59e0ce54713af341ed7f69f8915564..9e2443720e0532281a7a5970a15ac9639cf545f2 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/public/browser/content_browser_client.h
|
|
|
|
+++ b/content/public/browser/content_browser_client.h
|
2020-10-28 00:33:04 +00:00
|
|
|
@@ -252,8 +252,45 @@ class CONTENT_EXPORT ContentBrowserClient {
|
2020-01-17 18:41:52 +00:00
|
|
|
using IsClipboardPasteAllowedCallback =
|
|
|
|
base::OnceCallback<void(ClipboardPasteAllowed)>;
|
|
|
|
|
2018-12-05 08:03:39 +00:00
|
|
|
+ // Identifies the type of site instance to use for a navigation.
|
|
|
|
+ enum SiteInstanceForNavigationType {
|
|
|
|
+ // Use either the candidate site instance or, if it doesn't exist
|
|
|
|
+ // a new, unrelated site instance for the navigation.
|
|
|
|
+ FORCE_CANDIDATE_OR_NEW = 0,
|
|
|
|
+
|
|
|
|
+ // Use the current site instance for the navigation.
|
|
|
|
+ FORCE_CURRENT,
|
|
|
|
+
|
2019-08-08 18:48:33 +00:00
|
|
|
+ // Use a new, unrelated site instance.
|
|
|
|
+ FORCE_NEW,
|
|
|
|
+
|
2018-12-05 08:03:39 +00:00
|
|
|
+ // Use the provided affinity site instance for the navigation.
|
|
|
|
+ FORCE_AFFINITY,
|
|
|
|
+
|
|
|
|
+ // Delegate the site instance creation to Chromium.
|
|
|
|
+ ASK_CHROMIUM
|
|
|
|
+ };
|
2019-06-04 03:44:12 +00:00
|
|
|
+
|
2018-09-14 05:02:16 +00:00
|
|
|
virtual ~ContentBrowserClient() {}
|
|
|
|
|
2019-05-31 22:47:18 +00:00
|
|
|
+ // Electron: Allows disabling the below ShouldOverride patch
|
|
|
|
+ virtual bool CanUseCustomSiteInstance();
|
|
|
|
+
|
2018-09-14 05:02:16 +00:00
|
|
|
+ // Electron: Allows overriding the SiteInstance when navigating.
|
2018-12-05 08:03:39 +00:00
|
|
|
+ virtual SiteInstanceForNavigationType ShouldOverrideSiteInstanceForNavigation(
|
2019-06-04 03:44:12 +00:00
|
|
|
+ content::RenderFrameHost* current_rfh,
|
|
|
|
+ content::RenderFrameHost* speculative_rfh,
|
|
|
|
+ content::BrowserContext* browser_context,
|
|
|
|
+ const GURL& url,
|
2019-08-08 18:48:33 +00:00
|
|
|
+ bool has_navigation_started,
|
2019-06-04 03:44:12 +00:00
|
|
|
+ bool has_request_started,
|
|
|
|
+ content::SiteInstance** affinity_site_instance) const;
|
2018-12-05 08:03:39 +00:00
|
|
|
+
|
|
|
|
+ // Electron: Registers a pending site instance during a navigation.
|
|
|
|
+ virtual void RegisterPendingSiteInstance(
|
|
|
|
+ content::RenderFrameHost* rfh,
|
2019-02-27 01:43:34 +00:00
|
|
|
+ content::SiteInstance* pending_site_instance) {}
|
2018-09-14 05:02:16 +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.
|
2019-06-03 20:23:15 +00:00
|
|
|
diff --git a/content/public/browser/site_instance.h b/content/public/browser/site_instance.h
|
2020-10-16 01:30:41 +00:00
|
|
|
index a721f2fbab6e621085a8c7806abd92b8077340a8..e9b936e05e1d6ac8ea6eb5eb4d412b37ae4acc86 100644
|
2019-06-03 20:23:15 +00:00
|
|
|
--- a/content/public/browser/site_instance.h
|
|
|
|
+++ b/content/public/browser/site_instance.h
|
2020-10-16 01:30:41 +00:00
|
|
|
@@ -135,6 +135,11 @@ class CONTENT_EXPORT SiteInstance : public base::RefCounted<SiteInstance> {
|
2019-06-03 20:23:15 +00:00
|
|
|
// corresponds to a site URL with the host "example.com".
|
|
|
|
virtual const GURL& GetSiteURL() = 0;
|
|
|
|
|
2019-06-04 03:44:12 +00:00
|
|
|
+ // Create a SiteInstance for the given URL that shares the current
|
|
|
|
+ // BrowsingInstance.
|
|
|
|
+ virtual scoped_refptr<SiteInstance> CreateRelatedSiteInstance(
|
|
|
|
+ const GURL& url) = 0;
|
2019-06-03 20:23:15 +00:00
|
|
|
+
|
|
|
|
// Gets a SiteInstance for the given URL that shares the current
|
|
|
|
// BrowsingInstance, creating a new SiteInstance if necessary. This ensures
|
|
|
|
// that a BrowsingInstance only has one SiteInstance per site, so that pages
|