Index: content/browser/site_instance.cc |
diff --git a/content/browser/site_instance.cc b/content/browser/site_instance.cc |
index f96e3b2a6d7671d4e1e5d0d85e0a74fcf432a6c6..610de02d61a1ff66125775e267477ac9dc0dc67b 100644 |
--- a/content/browser/site_instance.cc |
+++ b/content/browser/site_instance.cc |
@@ -116,6 +116,18 @@ SiteInstance* SiteInstance::GetRelatedSiteInstance(const GURL& url) { |
return browsing_instance_->GetSiteInstanceForURL(url); |
} |
+bool SiteInstance::HasWrongProcessForURL(const GURL& url) const { |
+ // Having no process isn't a problem, since we'll assign it correctly. |
+ if (!HasProcess()) |
+ return false; |
+ |
+ // If the effective URL is an extension (e.g., for hosted apps) but the |
+ // process is not (or vice versa), make sure we notice and fix it. |
+ GURL effective_url = GetEffectiveURL(browsing_instance_->profile(), url); |
+ return effective_url.SchemeIs(chrome::kExtensionScheme) != |
+ process_->is_extension_process(); |
+} |
+ |
/*static*/ |
SiteInstance* SiteInstance::CreateSiteInstance(Profile* profile) { |
return new SiteInstance(new BrowsingInstance(profile)); |