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

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/crash_logging.h" 8 #include "base/debug/crash_logging.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 if (!is_extension_url && 1393 if (!is_extension_url &&
1394 !opener_is_extension_url && 1394 !opener_is_extension_url &&
1395 IsStandaloneExtensionProcess() && 1395 IsStandaloneExtensionProcess() &&
1396 opener_origin.canRequest(WebURL(new_url))) 1396 opener_origin.canRequest(WebURL(new_url)))
1397 return false; 1397 return false;
1398 1398
1399 // In all other cases, we want to compare against the URL that determines 1399 // In all other cases, we want to compare against the URL that determines
1400 // the type of process. In default Chrome, that's the URL of the opener's 1400 // the type of process. In default Chrome, that's the URL of the opener's
1401 // top frame and not the opener frame itself. In --site-per-process, we 1401 // top frame and not the opener frame itself. In --site-per-process, we
1402 // can use the opener frame itself. 1402 // can use the opener frame itself.
1403 // TODO(nick): Either wire this up to SiteIsolationPolicy, or to state on
1404 // |opener_frame|/its ancestors.
Charlie Reis 2015/07/13 22:13:14 Yeah, this one's a bit awkward, since there's a ch
ncarter (slow) 2015/07/20 17:45:46 Acknowledged.
1403 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 1405 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
1404 switches::kSitePerProcess)) 1406 switches::kSitePerProcess))
1405 old_url = opener_frame->document().url(); 1407 old_url = opener_frame->document().url();
1406 else 1408 else
1407 old_url = opener_frame->top()->document().url(); 1409 old_url = opener_frame->top()->document().url();
1408 } 1410 }
1409 1411
1410 // Only consider keeping non-app URLs in an app process if this window 1412 // Only consider keeping non-app URLs in an app process if this window
1411 // has an opener (in which case it might be an OAuth popup that tries to 1413 // has an opener (in which case it might be an OAuth popup that tries to
1412 // script an iframe within the app). 1414 // script an iframe within the app).
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1620 WebString header_key(ASCIIToUTF16( 1622 WebString header_key(ASCIIToUTF16(
1621 data_reduction_proxy::chrome_proxy_header())); 1623 data_reduction_proxy::chrome_proxy_header()));
1622 if (!response.httpHeaderField(header_key).isNull() && 1624 if (!response.httpHeaderField(header_key).isNull() &&
1623 response.httpHeaderField(header_key).utf8().find( 1625 response.httpHeaderField(header_key).utf8().find(
1624 data_reduction_proxy::chrome_proxy_lo_fi_directive()) != 1626 data_reduction_proxy::chrome_proxy_lo_fi_directive()) !=
1625 std::string::npos) { 1627 std::string::npos) {
1626 (*properties)[data_reduction_proxy::chrome_proxy_header()] = 1628 (*properties)[data_reduction_proxy::chrome_proxy_header()] =
1627 data_reduction_proxy::chrome_proxy_lo_fi_directive(); 1629 data_reduction_proxy::chrome_proxy_lo_fi_directive();
1628 } 1630 }
1629 } 1631 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698