Chromium Code Reviews| 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 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |