OLD | NEW |
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 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1388 if (!is_extension_url && | 1388 if (!is_extension_url && |
1389 !opener_is_extension_url && | 1389 !opener_is_extension_url && |
1390 IsStandaloneExtensionProcess() && | 1390 IsStandaloneExtensionProcess() && |
1391 opener_origin.canRequest(WebURL(new_url))) | 1391 opener_origin.canRequest(WebURL(new_url))) |
1392 return false; | 1392 return false; |
1393 | 1393 |
1394 // In all other cases, we want to compare against the URL that determines | 1394 // In all other cases, we want to compare against the URL that determines |
1395 // the type of process. In default Chrome, that's the URL of the opener's | 1395 // the type of process. In default Chrome, that's the URL of the opener's |
1396 // top frame and not the opener frame itself. In --site-per-process, we | 1396 // top frame and not the opener frame itself. In --site-per-process, we |
1397 // can use the opener frame itself. | 1397 // can use the opener frame itself. |
| 1398 // TODO(nick): Either wire this up to SiteIsolationPolicy, or to state on |
| 1399 // |opener_frame|/its ancestors. |
1398 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1400 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
1399 switches::kSitePerProcess)) | 1401 switches::kSitePerProcess)) |
1400 old_url = opener_frame->document().url(); | 1402 old_url = opener_frame->document().url(); |
1401 else | 1403 else |
1402 old_url = opener_frame->top()->document().url(); | 1404 old_url = opener_frame->top()->document().url(); |
1403 } | 1405 } |
1404 | 1406 |
1405 // Only consider keeping non-app URLs in an app process if this window | 1407 // Only consider keeping non-app URLs in an app process if this window |
1406 // has an opener (in which case it might be an OAuth popup that tries to | 1408 // has an opener (in which case it might be an OAuth popup that tries to |
1407 // script an iframe within the app). | 1409 // script an iframe within the app). |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1619 WebString header_key(ASCIIToUTF16( | 1621 WebString header_key(ASCIIToUTF16( |
1620 data_reduction_proxy::chrome_proxy_header())); | 1622 data_reduction_proxy::chrome_proxy_header())); |
1621 if (!response.httpHeaderField(header_key).isNull() && | 1623 if (!response.httpHeaderField(header_key).isNull() && |
1622 response.httpHeaderField(header_key).utf8().find( | 1624 response.httpHeaderField(header_key).utf8().find( |
1623 data_reduction_proxy::chrome_proxy_lo_fi_directive()) != | 1625 data_reduction_proxy::chrome_proxy_lo_fi_directive()) != |
1624 std::string::npos) { | 1626 std::string::npos) { |
1625 (*properties)[data_reduction_proxy::chrome_proxy_header()] = | 1627 (*properties)[data_reduction_proxy::chrome_proxy_header()] = |
1626 data_reduction_proxy::chrome_proxy_lo_fi_directive(); | 1628 data_reduction_proxy::chrome_proxy_lo_fi_directive(); |
1627 } | 1629 } |
1628 } | 1630 } |
OLD | NEW |