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/browser/io_thread.h" | 5 #include "chrome/browser/io_thread.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 #include "build/build_config.h" | 28 #include "build/build_config.h" |
29 #include "chrome/browser/browser_process.h" | 29 #include "chrome/browser/browser_process.h" |
30 #include "chrome/browser/net/async_dns_field_trial.h" | 30 #include "chrome/browser/net/async_dns_field_trial.h" |
31 #include "chrome/browser/net/chrome_net_log.h" | 31 #include "chrome/browser/net/chrome_net_log.h" |
32 #include "chrome/browser/net/chrome_network_delegate.h" | 32 #include "chrome/browser/net/chrome_network_delegate.h" |
33 #include "chrome/browser/net/chrome_url_request_context.h" | 33 #include "chrome/browser/net/chrome_url_request_context.h" |
34 #include "chrome/browser/net/connect_interceptor.h" | 34 #include "chrome/browser/net/connect_interceptor.h" |
35 #include "chrome/browser/net/dns_probe_service.h" | 35 #include "chrome/browser/net/dns_probe_service.h" |
36 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 36 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
37 #include "chrome/browser/net/proxy_service_factory.h" | 37 #include "chrome/browser/net/proxy_service_factory.h" |
38 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | |
38 #include "chrome/common/chrome_content_client.h" | 39 #include "chrome/common/chrome_content_client.h" |
39 #include "chrome/common/chrome_switches.h" | 40 #include "chrome/common/chrome_switches.h" |
40 #include "chrome/common/chrome_version_info.h" | 41 #include "chrome/common/chrome_version_info.h" |
41 #include "chrome/common/pref_names.h" | 42 #include "chrome/common/pref_names.h" |
42 #include "components/data_reduction_proxy/browser/data_reduction_proxy_prefs.h" | 43 #include "components/data_reduction_proxy/browser/data_reduction_proxy_prefs.h" |
43 #include "components/policy/core/common/policy_service.h" | 44 #include "components/policy/core/common/policy_service.h" |
44 #include "components/variations/variations_associated_data.h" | 45 #include "components/variations/variations_associated_data.h" |
45 #include "content/public/browser/browser_thread.h" | 46 #include "content/public/browser/browser_thread.h" |
46 #include "content/public/browser/cookie_store_factory.h" | 47 #include "content/public/browser/cookie_store_factory.h" |
47 #include "net/base/host_mapping_rules.h" | 48 #include "net/base/host_mapping_rules.h" |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
644 int drp_flags = DataReductionProxyParams::kFallbackAllowed; | 645 int drp_flags = DataReductionProxyParams::kFallbackAllowed; |
645 if (DataReductionProxyParams::IsIncludedInFieldTrial()) | 646 if (DataReductionProxyParams::IsIncludedInFieldTrial()) |
646 drp_flags |= DataReductionProxyParams::kAllowed; | 647 drp_flags |= DataReductionProxyParams::kAllowed; |
647 if (DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()) | 648 if (DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()) |
648 drp_flags |= DataReductionProxyParams::kAlternativeAllowed; | 649 drp_flags |= DataReductionProxyParams::kAlternativeAllowed; |
649 if (DataReductionProxyParams::IsIncludedInPromoFieldTrial()) | 650 if (DataReductionProxyParams::IsIncludedInPromoFieldTrial()) |
650 drp_flags |= DataReductionProxyParams::kPromoAllowed; | 651 drp_flags |= DataReductionProxyParams::kPromoAllowed; |
651 DataReductionProxyParams* proxy_params = | 652 DataReductionProxyParams* proxy_params = |
652 new DataReductionProxyParams(drp_flags); | 653 new DataReductionProxyParams(drp_flags); |
653 globals_->data_reduction_proxy_params.reset(proxy_params); | 654 globals_->data_reduction_proxy_params.reset(proxy_params); |
655 chrome::VersionInfo version_info; | |
bengr
2014/07/31 18:22:40
This is an implementation detail, so put it inside
megjablon
2014/07/31 20:48:36
Done.
| |
654 globals_->data_reduction_proxy_auth_request_handler.reset( | 656 globals_->data_reduction_proxy_auth_request_handler.reset( |
655 new DataReductionProxyAuthRequestHandler(proxy_params)); | 657 new DataReductionProxyAuthRequestHandler( |
658 proxy_params, | |
659 DataReductionProxyChromeSettings::GetBuildAndPatchNumber( | |
660 version_info.Version()))); | |
656 globals_->on_resolve_proxy_handler = | 661 globals_->on_resolve_proxy_handler = |
657 ChromeNetworkDelegate::OnResolveProxyHandler( | 662 ChromeNetworkDelegate::OnResolveProxyHandler( |
658 base::Bind(data_reduction_proxy::OnResolveProxyHandler)); | 663 base::Bind(data_reduction_proxy::OnResolveProxyHandler)); |
659 DataReductionProxyUsageStats* proxy_usage_stats = | 664 DataReductionProxyUsageStats* proxy_usage_stats = |
660 new DataReductionProxyUsageStats(proxy_params, | 665 new DataReductionProxyUsageStats(proxy_params, |
661 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | 666 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
662 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 667 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
663 network_delegate->set_data_reduction_proxy_params(proxy_params); | 668 network_delegate->set_data_reduction_proxy_params(proxy_params); |
664 globals_->data_reduction_proxy_usage_stats.reset(proxy_usage_stats); | 669 globals_->data_reduction_proxy_usage_stats.reset(proxy_usage_stats); |
665 network_delegate->set_data_reduction_proxy_usage_stats(proxy_usage_stats); | 670 network_delegate->set_data_reduction_proxy_usage_stats(proxy_usage_stats); |
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1381 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1386 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
1382 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1387 for (size_t i = 0; i < supported_versions.size(); ++i) { |
1383 net::QuicVersion version = supported_versions[i]; | 1388 net::QuicVersion version = supported_versions[i]; |
1384 if (net::QuicVersionToString(version) == quic_version) { | 1389 if (net::QuicVersionToString(version) == quic_version) { |
1385 return version; | 1390 return version; |
1386 } | 1391 } |
1387 } | 1392 } |
1388 | 1393 |
1389 return net::QUIC_VERSION_UNSUPPORTED; | 1394 return net::QUIC_VERSION_UNSUPPORTED; |
1390 } | 1395 } |
OLD | NEW |