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

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: Attempt to fix compile. 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 59124440b5ddb794867c195d3c91a1c37de51059..5600a23455fc80f8f2a6592077a78be2babcb165 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -61,6 +61,7 @@
#include "content/common/appcache_interfaces.h"
#include "content/common/navigation_params.h"
#include "content/common/resource_messages.h"
+#include "content/common/site_isolation_policy.h"
#include "content/common/ssl_status_serialization.h"
#include "content/common/view_messages.h"
#include "content/public/browser/browser_thread.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