Index: chrome/browser/ui/browser_navigator.cc |
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc |
index b90525ab3d24eeff8bec4cd54b8f6e262f7da2f1..f86afec25d4187449633205d614e98d1cc73be49 100644 |
--- a/chrome/browser/ui/browser_navigator.cc |
+++ b/chrome/browser/ui/browser_navigator.cc |
@@ -248,6 +248,11 @@ void NormalizeDisposition(chrome::NavigateParams* params) { |
// Obtain the profile used by the code that originated the Navigate() request. |
Profile* GetSourceProfile(chrome::NavigateParams* params) { |
+ if (params->source_site_instance) { |
alexmos
2016/10/04 21:24:44
Turned out the source_site_instance check needed t
Lei Zhang
2016/10/06 00:36:47
You may want to write down some of your notes here
alexmos
2016/10/06 00:42:00
Thanks! I'll add the comment in a followup so I c
|
+ return Profile::FromBrowserContext( |
+ params->source_site_instance->GetBrowserContext()); |
+ } |
+ |
if (params->source_contents) { |
return Profile::FromBrowserContext( |
params->source_contents->GetBrowserContext()); |
@@ -465,7 +470,8 @@ void Navigate(NavigateParams* params) { |
if (GetSourceProfile(params) != params->browser->profile()) { |
// A tab is being opened from a link from a different profile, we must reset |
// source information that may cause state to be shared. |
- params->source_contents = NULL; |
+ params->source_contents = nullptr; |
+ params->source_site_instance = nullptr; |
params->referrer = content::Referrer(); |
} |