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 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1531 | 1531 |
1532 bool ChromeContentRendererClient::ShouldReportDetailedMessageForSource( | 1532 bool ChromeContentRendererClient::ShouldReportDetailedMessageForSource( |
1533 const base::string16& source) const { | 1533 const base::string16& source) const { |
1534 #if defined(ENABLE_EXTENSIONS) | 1534 #if defined(ENABLE_EXTENSIONS) |
1535 return extensions::IsSourceFromAnExtension(source); | 1535 return extensions::IsSourceFromAnExtension(source); |
1536 #else | 1536 #else |
1537 return false; | 1537 return false; |
1538 #endif | 1538 #endif |
1539 } | 1539 } |
1540 | 1540 |
1541 bool ChromeContentRendererClient::ShouldEnableSiteIsolationPolicy() const { | 1541 bool ChromeContentRendererClient::ShouldGatherSiteIsolationStats() const { |
1542 // SiteIsolationPolicy is off by default. We would like to activate cross-site | 1542 // Site isolation stats are gathered currently for non-extension renderer |
1543 // document blocking (for UMA data collection) for normal renderer processes | 1543 // processes running a normal web page from the Internet. |
1544 // running a normal web page from the Internet. We only turn on | 1544 // TODO(nick): Gather stats for extension processes too; we would need to |
Lei Zhang
2015/06/16 22:41:20
If there's a bug # associated with this, please in
ncarter (slow)
2015/06/16 23:00:18
Done.
| |
1545 // SiteIsolationPolicy for a renderer process that does not have the extension | 1545 // check the extension's manifest to know which sites it's allowed to access. |
1546 // flag on. | |
1547 #if defined(ENABLE_EXTENSIONS) | 1546 #if defined(ENABLE_EXTENSIONS) |
1548 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 1547 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
1549 return !command_line->HasSwitch(extensions::switches::kExtensionProcess); | 1548 return !command_line->HasSwitch(extensions::switches::kExtensionProcess); |
1550 #else | 1549 #else |
1551 return true; | 1550 return true; |
1552 #endif | 1551 #endif |
1553 } | 1552 } |
1554 | 1553 |
1555 blink::WebWorkerContentSettingsClientProxy* | 1554 blink::WebWorkerContentSettingsClientProxy* |
1556 ChromeContentRendererClient::CreateWorkerContentSettingsClientProxy( | 1555 ChromeContentRendererClient::CreateWorkerContentSettingsClientProxy( |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1648 WebString header_key(ASCIIToUTF16( | 1647 WebString header_key(ASCIIToUTF16( |
1649 data_reduction_proxy::chrome_proxy_header())); | 1648 data_reduction_proxy::chrome_proxy_header())); |
1650 if (!response.httpHeaderField(header_key).isNull() && | 1649 if (!response.httpHeaderField(header_key).isNull() && |
1651 response.httpHeaderField(header_key).utf8().find( | 1650 response.httpHeaderField(header_key).utf8().find( |
1652 data_reduction_proxy::chrome_proxy_lo_fi_directive()) != | 1651 data_reduction_proxy::chrome_proxy_lo_fi_directive()) != |
1653 std::string::npos) { | 1652 std::string::npos) { |
1654 (*properties)[data_reduction_proxy::chrome_proxy_header()] = | 1653 (*properties)[data_reduction_proxy::chrome_proxy_header()] = |
1655 data_reduction_proxy::chrome_proxy_lo_fi_directive(); | 1654 data_reduction_proxy::chrome_proxy_lo_fi_directive(); |
1656 } | 1655 } |
1657 } | 1656 } |
OLD | NEW |