| 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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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); |
| 654 globals_->data_reduction_proxy_auth_request_handler.reset( | 655 globals_->data_reduction_proxy_auth_request_handler.reset( |
| 655 new DataReductionProxyAuthRequestHandler(proxy_params)); | 656 new DataReductionProxyAuthRequestHandler( |
| 657 DataReductionProxyChromeSettings::GetClient(), |
| 658 DataReductionProxyChromeSettings::GetBuildAndPatchNumber(), |
| 659 proxy_params)); |
| 656 globals_->on_resolve_proxy_handler = | 660 globals_->on_resolve_proxy_handler = |
| 657 ChromeNetworkDelegate::OnResolveProxyHandler( | 661 ChromeNetworkDelegate::OnResolveProxyHandler( |
| 658 base::Bind(data_reduction_proxy::OnResolveProxyHandler)); | 662 base::Bind(data_reduction_proxy::OnResolveProxyHandler)); |
| 659 DataReductionProxyUsageStats* proxy_usage_stats = | 663 DataReductionProxyUsageStats* proxy_usage_stats = |
| 660 new DataReductionProxyUsageStats(proxy_params, | 664 new DataReductionProxyUsageStats(proxy_params, |
| 661 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | 665 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
| 662 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 666 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
| 663 network_delegate->set_data_reduction_proxy_params(proxy_params); | 667 network_delegate->set_data_reduction_proxy_params(proxy_params); |
| 664 globals_->data_reduction_proxy_usage_stats.reset(proxy_usage_stats); | 668 globals_->data_reduction_proxy_usage_stats.reset(proxy_usage_stats); |
| 665 network_delegate->set_data_reduction_proxy_usage_stats(proxy_usage_stats); | 669 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(); | 1385 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
| 1382 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1386 for (size_t i = 0; i < supported_versions.size(); ++i) { |
| 1383 net::QuicVersion version = supported_versions[i]; | 1387 net::QuicVersion version = supported_versions[i]; |
| 1384 if (net::QuicVersionToString(version) == quic_version) { | 1388 if (net::QuicVersionToString(version) == quic_version) { |
| 1385 return version; | 1389 return version; |
| 1386 } | 1390 } |
| 1387 } | 1391 } |
| 1388 | 1392 |
| 1389 return net::QUIC_VERSION_UNSUPPORTED; | 1393 return net::QUIC_VERSION_UNSUPPORTED; |
| 1390 } | 1394 } |
| OLD | NEW |