Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(978)

Unified Diff: content/browser/site_instance.cc

Issue 7044013: Drop url_constants dependency in content/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: forgot null check Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698