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

Unified Diff: content/browser/site_instance_impl.cc

Issue 151593004: Fix bugs with renderer-side debug URLs, like chrome://crash or javascript:. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clarify comments. Created 6 years, 11 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
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/site_instance_impl.cc
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
index 29f5a7830953afc4bf63d81a531ae00a14324dd8..c003eb734843a205dd15ae244c383e84f49a3db8 100644
--- a/content/browser/site_instance_impl.cc
+++ b/content/browser/site_instance_impl.cc
@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "content/browser/browsing_instance.h"
#include "content/browser/child_process_security_policy_impl.h"
+#include "content/browser/frame_host/debug_urls.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/storage_partition_impl.h"
#include "content/public/browser/content_browser_client.h"
@@ -18,21 +19,6 @@
namespace content {
-static bool IsURLSameAsAnySiteInstance(const GURL& url) {
- if (!url.is_valid())
- return false;
-
- // We treat javascript: as the same site as any URL since it is actually
- // a modifier on existing pages.
- if (url.SchemeIs(kJavaScriptScheme))
- return true;
-
- return url == GURL(kChromeUICrashURL) ||
- url == GURL(kChromeUIKillURL) ||
- url == GURL(kChromeUIHangURL) ||
- url == GURL(kChromeUIShorthangURL);
-}
-
const RenderProcessHostFactory*
SiteInstanceImpl::g_render_process_host_factory_ = NULL;
int32 SiteInstanceImpl::next_site_instance_id_ = 1;
@@ -210,7 +196,7 @@ bool SiteInstanceImpl::HasWrongProcessForURL(const GURL& url) {
// If the URL to navigate to can be associated with any site instance,
// we want to keep it in the same process.
- if (IsURLSameAsAnySiteInstance(url))
+ if (IsRendererDebugURL(url))
return false;
// If the site URL is an extension (e.g., for hosted apps or WebUI) but the
@@ -259,7 +245,7 @@ bool SiteInstance::IsSameWebSite(BrowserContext* browser_context,
// Some special URLs will match the site instance of any other URL. This is
// done before checking both of them for validity, since we want these URLs
// to have the same site instance as even an invalid one.
- if (IsURLSameAsAnySiteInstance(url1) || IsURLSameAsAnySiteInstance(url2))
+ if (IsRendererDebugURL(url1) || IsRendererDebugURL(url2))
return true;
// If either URL is invalid, they aren't part of the same site.
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698