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 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1528 | 1528 |
1529 bool ChromeContentRendererClient::ShouldReportDetailedMessageForSource( | 1529 bool ChromeContentRendererClient::ShouldReportDetailedMessageForSource( |
1530 const base::string16& source) const { | 1530 const base::string16& source) const { |
1531 #if defined(ENABLE_EXTENSIONS) | 1531 #if defined(ENABLE_EXTENSIONS) |
1532 return extensions::IsSourceFromAnExtension(source); | 1532 return extensions::IsSourceFromAnExtension(source); |
1533 #else | 1533 #else |
1534 return false; | 1534 return false; |
1535 #endif | 1535 #endif |
1536 } | 1536 } |
1537 | 1537 |
1538 bool ChromeContentRendererClient::ShouldEnableSiteIsolationPolicy() const { | 1538 bool ChromeContentRendererClient::ShouldGatherSiteIsolationStats() const { |
1539 // SiteIsolationPolicy is off by default. We would like to activate cross-site | 1539 // Site isolation stats are gathered currently for non-extension renderer |
1540 // document blocking (for UMA data collection) for normal renderer processes | 1540 // processes running a normal web page from the Internet. |
1541 // running a normal web page from the Internet. We only turn on | 1541 // TODO(nick): Gather stats for extension processes too. |
1542 // SiteIsolationPolicy for a renderer process that does not have the extension | |
1543 // flag on. | |
1544 #if defined(ENABLE_EXTENSIONS) | 1542 #if defined(ENABLE_EXTENSIONS) |
1545 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 1543 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
1546 return !command_line->HasSwitch(extensions::switches::kExtensionProcess); | 1544 return !command_line->HasSwitch(extensions::switches::kExtensionProcess); |
1547 #else | 1545 #else |
1548 return true; | 1546 return true; |
1549 #endif | 1547 #endif |
1550 } | 1548 } |
1551 | 1549 |
1552 blink::WebWorkerContentSettingsClientProxy* | 1550 blink::WebWorkerContentSettingsClientProxy* |
1553 ChromeContentRendererClient::CreateWorkerContentSettingsClientProxy( | 1551 ChromeContentRendererClient::CreateWorkerContentSettingsClientProxy( |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1645 WebString header_key(ASCIIToUTF16( | 1643 WebString header_key(ASCIIToUTF16( |
1646 data_reduction_proxy::chrome_proxy_header())); | 1644 data_reduction_proxy::chrome_proxy_header())); |
1647 if (!response.httpHeaderField(header_key).isNull() && | 1645 if (!response.httpHeaderField(header_key).isNull() && |
1648 response.httpHeaderField(header_key).utf8().find( | 1646 response.httpHeaderField(header_key).utf8().find( |
1649 data_reduction_proxy::chrome_proxy_lo_fi_directive()) != | 1647 data_reduction_proxy::chrome_proxy_lo_fi_directive()) != |
1650 std::string::npos) { | 1648 std::string::npos) { |
1651 (*properties)[data_reduction_proxy::chrome_proxy_header()] = | 1649 (*properties)[data_reduction_proxy::chrome_proxy_header()] = |
1652 data_reduction_proxy::chrome_proxy_lo_fi_directive(); | 1650 data_reduction_proxy::chrome_proxy_lo_fi_directive(); |
1653 } | 1651 } |
1654 } | 1652 } |
OLD | NEW |