frame_host_manager.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: deepak1556 <[email protected]>
  3. Date: Mon, 3 Jun 2019 14:20:05 -0700
  4. Subject: frame_host_manager.patch
  5. Allows embedder to intercept site instances created by chromium.
  6. diff --git a/content/browser/renderer_host/render_frame_host_manager.cc b/content/browser/renderer_host/render_frame_host_manager.cc
  7. index d8e55dd35c7bcfc341585b901ed8dc261d03870a..eaa3b5fe6320a746298c45c799ef4b29877d3542 100644
  8. --- a/content/browser/renderer_host/render_frame_host_manager.cc
  9. +++ b/content/browser/renderer_host/render_frame_host_manager.cc
  10. @@ -4471,6 +4471,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
  11. request->ResetStateForSiteInstanceChange();
  12. }
  13. + GetContentClient()->browser()->RegisterPendingSiteInstance(
  14. + render_frame_host_.get(), dest_site_instance.get());
  15. +
  16. return dest_site_instance;
  17. }
  18. diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
  19. index 9aff128608ca60c2031b131eff59622e74b5a55a..64c2b82f58f01f2e3044ca6f2ab212384302f380 100644
  20. --- a/content/public/browser/content_browser_client.h
  21. +++ b/content/public/browser/content_browser_client.h
  22. @@ -330,6 +330,11 @@ class CONTENT_EXPORT ContentBrowserClient {
  23. virtual ~ContentBrowserClient() = default;
  24. + // Electron: Registers a pending site instance during a navigation.
  25. + virtual void RegisterPendingSiteInstance(
  26. + content::RenderFrameHost* rfh,
  27. + content::SiteInstance* pending_site_instance) {}
  28. +
  29. // Allows the embedder to set any number of custom BrowserMainParts
  30. // implementations for the browser startup code. See comments in
  31. // browser_main_parts.h.