Pass RenderFrameHost to ShouldCreateNewSiteInstance

This commit is contained in:
Ryohei Ikegami 2017-04-05 13:47:02 +09:00
parent 61fa8693d2
commit 90852c665d
2 changed files with 7 additions and 3 deletions

View file

@ -87,10 +87,10 @@ content::WebContents* AtomBrowserClient::GetWebContentsFromProcessID(
}
bool AtomBrowserClient::ShouldCreateNewSiteInstance(
content::RenderFrameHost* render_frame_host,
content::BrowserContext* browser_context,
content::SiteInstance* current_instance,
const GURL& url) {
if (url.SchemeIs(url::kJavaScriptScheme))
// "javacript:" scheme should always use same SiteInstance
return false;
@ -183,6 +183,7 @@ std::string AtomBrowserClient::GetApplicationLocale() {
}
void AtomBrowserClient::OverrideSiteInstanceForNavigation(
content::RenderFrameHost* render_frame_host,
content::BrowserContext* browser_context,
content::SiteInstance* current_instance,
const GURL& url,
@ -192,7 +193,8 @@ void AtomBrowserClient::OverrideSiteInstanceForNavigation(
return;
}
if (!ShouldCreateNewSiteInstance(browser_context, current_instance, url))
if (!ShouldCreateNewSiteInstance(render_frame_host, browser_context,
current_instance, url))
return;
scoped_refptr<content::SiteInstance> site_instance =

View file

@ -54,6 +54,7 @@ class AtomBrowserClient : public brightray::BrowserClient,
content::WebPreferences* prefs) override;
std::string GetApplicationLocale() override;
void OverrideSiteInstanceForNavigation(
content::RenderFrameHost* render_frame_host,
content::BrowserContext* browser_context,
content::SiteInstance* current_instance,
const GURL& dest_url,
@ -111,7 +112,8 @@ class AtomBrowserClient : public brightray::BrowserClient,
void RenderProcessHostDestroyed(content::RenderProcessHost* host) override;
private:
bool ShouldCreateNewSiteInstance(content::BrowserContext* browser_context,
bool ShouldCreateNewSiteInstance(content::RenderFrameHost* render_frame_host,
content::BrowserContext* browser_context,
content::SiteInstance* current_instance,
const GURL& dest_url);
struct ProcessPreferences {