Chromium Code Reviews| Index: content/browser/site_instance.cc |
| diff --git a/content/browser/site_instance.cc b/content/browser/site_instance.cc |
| index ed8cd9b7bedc371198ac2fb03d29c17ae6b1641e..bd07b3004164441115a88e6dbc180990d344cd9d 100644 |
| --- a/content/browser/site_instance.cc |
| +++ b/content/browser/site_instance.cc |
| @@ -4,25 +4,32 @@ |
| #include "content/browser/site_instance.h" |
| -#include "chrome/common/url_constants.h" |
| #include "content/browser/browsing_instance.h" |
| #include "content/browser/content_browser_client.h" |
| #include "content/browser/renderer_host/browser_render_process_host.h" |
| #include "content/browser/webui/web_ui_factory.h" |
| -#include "content/common/notification_service.h" |
| #include "content/common/content_client.h" |
| +#include "content/common/notification_service.h" |
| +#include "content/common/url_constants.h" |
| #include "net/base/registry_controlled_domain.h" |
| -// We treat javascript:, about:crash, about:hang, and about:shorthang as the |
| -// same site as any URL since they are actually modifiers on existing pages. |
| static bool IsURLSameAsAnySiteInstance(const GURL& url) { |
| if (!url.is_valid()) |
| return false; |
| - return url.SchemeIs(chrome::kJavaScriptScheme) || |
| - url.spec() == chrome::kAboutCrashURL || |
| - url.spec() == chrome::kAboutKillURL || |
| - url.spec() == chrome::kAboutHangURL || |
| - url.spec() == chrome::kAboutShorthangURL; |
| + |
| + // We treat javascript: and about:crash as the same site as any URL since they |
| + // are actually modifiers on existing pages. |
| + if (url.SchemeIs(chrome::kJavaScriptScheme) || |
| + url.spec() == chrome::kAboutCrashURL) { |
| + return true; |
| + } |
| + |
| + const std::set<std::string>* schemes = |
| + content::GetContentClient()->browser()->GetSchemesSameAsAnySiteInstance(); |
|
jam
2011/05/18 22:12:29
instead of getting a set back of urls that the con
Avi (use Gerrit)
2011/05/18 22:13:59
Much better idea, thanks! Will do that.
|
| + if (!schemes) |
| + return false; |
| + |
| + return schemes->find(url.spec()) != schemes->end(); |
| } |
| int32 SiteInstance::next_site_instance_id_ = 1; |