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

Unified Diff: content/browser/site_instance_impl.cc

Issue 2964033002: Disable cross-process navigations in --single-process. (Closed)
Patch Set: Only update --site-per-process Created 3 years, 5 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/frame_host/render_frame_host_manager.cc ('k') | content/public/common/content_switches.cc » ('j') | 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 7a5ed8e4c3f0d9e64296a6553d8d9aecc5bd345e..08cb4e3cf76d89fda4ca112a2bcf327633502c6e 100644
--- a/content/browser/site_instance_impl.cc
+++ b/content/browser/site_instance_impl.cc
@@ -4,6 +4,7 @@
#include "content/browser/site_instance_impl.h"
+#include "base/command_line.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "content/browser/browsing_instance.h"
@@ -16,6 +17,7 @@
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/render_process_host_factory.h"
#include "content/public/browser/web_ui_controller_factory.h"
+#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
@@ -434,6 +436,12 @@ bool SiteInstanceImpl::DoesSiteRequireDedicatedProcess(
// static
bool SiteInstanceImpl::ShouldLockToOrigin(BrowserContext* browser_context,
GURL site_url) {
+ // Don't lock to origin in --single-process mode, since this mode puts
+ // cross-site pages into the same process.
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSingleProcess))
+ return false;
+
if (!DoesSiteRequireDedicatedProcess(browser_context, site_url))
return false;
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager.cc ('k') | content/public/common/content_switches.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698