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

Unified Diff: content/browser/renderer_host/resource_dispatcher_host.cc

Issue 8496027: Enhance --enable-strict-site-isolation to prevent a site-isolated renderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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/renderer_host/render_message_filter.cc ('k') | content/browser/site_instance.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/resource_dispatcher_host.cc
===================================================================
--- content/browser/renderer_host/resource_dispatcher_host.cc (revision 111259)
+++ content/browser/renderer_host/resource_dispatcher_host.cc (working copy)
@@ -544,11 +544,18 @@
if (sync_result)
load_flags |= net::LOAD_IGNORE_LIMITS;
+ ChildProcessSecurityPolicy* policy =
+ ChildProcessSecurityPolicy::GetInstance();
+ if (!policy->CanUseCookiesForOrigin(child_id, request_data.url)) {
+ load_flags |= (net::LOAD_DO_NOT_SEND_COOKIES |
+ net::LOAD_DO_NOT_SEND_AUTH_DATA |
+ net::LOAD_DO_NOT_SAVE_COOKIES);
+ }
+
// Raw headers are sensitive, as they inclide Cookie/Set-Cookie, so only
// allow requesting them if requestor has ReadRawCookies permission.
if ((load_flags & net::LOAD_REPORT_RAW_HEADERS)
- && !ChildProcessSecurityPolicy::GetInstance()->
- CanReadRawCookies(child_id)) {
+ && !policy->CanReadRawCookies(child_id)) {
VLOG(1) << "Denied unathorized request for raw headers";
load_flags &= ~net::LOAD_REPORT_RAW_HEADERS;
}
« no previous file with comments | « content/browser/renderer_host/render_message_filter.cc ('k') | content/browser/site_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698