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

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 1208143002: Move existing kSitePerProcess checks to a policy-oracle object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@swapped_out_cmdline_checks
Patch Set: Partial fixes to Nasko's comments. Created 5 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
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 2b532814b739244026e1a384f8dc823cebcb4c7b..a37ca06f7d6eb9860269bc9ddf758e785185db0a 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -77,6 +77,7 @@
#include "content/public/browser/user_metrics.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/process_type.h"
+#include "content/public/common/site_isolation_policy.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_message_start.h"
#include "net/base/auth.h"
@@ -1386,10 +1387,11 @@ scoped_ptr<ResourceHandler> ResourceDispatcherHostImpl::CreateResourceHandler(
// to drive the transfer.
bool is_swappable_navigation =
request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME;
- // If we are using --site-per-process, install it for subframes as well.
+ // If out-of-process iframes are possible, then all subframe requests need
+ // to go through the CrossSiteResourceHandler to enforce the site isolation
+ // policy.
if (!is_swappable_navigation &&
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess)) {
+ SiteIsolationPolicy::AreCrossProcessFramesPossible()) {
is_swappable_navigation =
request_data.resource_type == RESOURCE_TYPE_SUB_FRAME;
}

Powered by Google App Engine
This is Rietveld 408576698