Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: chrome/browser/io_thread.cc

Issue 412143009: Moved data reduction proxy initialization logic to ProfileImplIOData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 #if !defined(USE_OPENSSL) 88 #if !defined(USE_OPENSSL)
89 #include "net/cert/ct_log_verifier.h" 89 #include "net/cert/ct_log_verifier.h"
90 #include "net/cert/multi_log_ct_verifier.h" 90 #include "net/cert/multi_log_ct_verifier.h"
91 #endif 91 #endif
92 92
93 #if defined(USE_NSS) || defined(OS_IOS) 93 #if defined(USE_NSS) || defined(OS_IOS)
94 #include "net/ocsp/nss_ocsp.h" 94 #include "net/ocsp/nss_ocsp.h"
95 #endif 95 #endif
96 96
97 #if defined(OS_ANDROID) || defined(OS_IOS) 97 #if defined(SPDY_PROXY_AUTH_ORIGIN)
98 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
99 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact ory.h"
98 #include "components/data_reduction_proxy/browser/data_reduction_proxy_auth_requ est_handler.h" 100 #include "components/data_reduction_proxy/browser/data_reduction_proxy_auth_requ est_handler.h"
99 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h"
100 #include "components/data_reduction_proxy/browser/data_reduction_proxy_protocol. h" 101 #include "components/data_reduction_proxy/browser/data_reduction_proxy_protocol. h"
101 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h" 102
102 #endif 103 using data_reduction_proxy::DataReductionProxyParams;
104 #endif // defined(SPDY_PROXY_AUTH_ORIGIN)
103 105
104 #if defined(OS_CHROMEOS) 106 #if defined(OS_CHROMEOS)
105 #include "chrome/browser/chromeos/login/users/user_manager.h" 107 #include "chrome/browser/chromeos/login/users/user_manager.h"
106 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" 108 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h"
107 #include "chromeos/network/host_resolver_impl_chromeos.h" 109 #include "chromeos/network/host_resolver_impl_chromeos.h"
108 #endif 110 #endif
109 111
110 using content::BrowserThread; 112 using content::BrowserThread;
111 113
112 #if defined(OS_ANDROID) || defined(OS_IOS)
113 using data_reduction_proxy::DataReductionProxyAuthRequestHandler;
114 using data_reduction_proxy::DataReductionProxyParams;
115 using data_reduction_proxy::DataReductionProxyUsageStats;
116 using data_reduction_proxy::DataReductionProxySettings;
117 #endif
118
119 class SafeBrowsingURLRequestContext; 114 class SafeBrowsingURLRequestContext;
120 115
121 // The IOThread object must outlive any tasks posted to the IO thread before the 116 // The IOThread object must outlive any tasks posted to the IO thread before the
122 // Quit task, so base::Bind() calls are not refcounted. 117 // Quit task, so base::Bind() calls are not refcounted.
123 118
124 namespace { 119 namespace {
125 120
126 const char kQuicFieldTrialName[] = "QUIC"; 121 const char kQuicFieldTrialName[] = "QUIC";
127 const char kQuicFieldTrialEnabledGroupName[] = "Enabled"; 122 const char kQuicFieldTrialEnabledGroupName[] = "Enabled";
128 const char kQuicFieldTrialHttpsEnabledGroupName[] = "HttpsEnabled"; 123 const char kQuicFieldTrialHttpsEnabledGroupName[] = "HttpsEnabled";
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 ct_verifier->AddLog(external_log_verifier.Pass()); 627 ct_verifier->AddLog(external_log_verifier.Pass());
633 } 628 }
634 } 629 }
635 #else 630 #else
636 if (command_line.HasSwitch(switches::kCertificateTransparencyLog)) { 631 if (command_line.HasSwitch(switches::kCertificateTransparencyLog)) {
637 LOG(DFATAL) << "Certificate Transparency is not yet supported in Chrome " 632 LOG(DFATAL) << "Certificate Transparency is not yet supported in Chrome "
638 "builds using OpenSSL."; 633 "builds using OpenSSL.";
639 } 634 }
640 #endif 635 #endif
641 globals_->ssl_config_service = GetSSLConfigService(); 636 globals_->ssl_config_service = GetSSLConfigService();
642 #if defined(OS_ANDROID) || defined(OS_IOS) 637
643 #if defined(SPDY_PROXY_AUTH_ORIGIN) 638 #if defined(SPDY_PROXY_AUTH_ORIGIN)
644 int drp_flags = DataReductionProxyParams::kFallbackAllowed; 639 int drp_flags = DataReductionProxyParams::kFallbackAllowed;
645 if (DataReductionProxyParams::IsIncludedInFieldTrial()) 640 if (DataReductionProxyParams::IsIncludedInFieldTrial())
646 drp_flags |= DataReductionProxyParams::kAllowed; 641 drp_flags |= DataReductionProxyParams::kAllowed;
647 if (DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()) 642 if (DataReductionProxyParams::IsIncludedInAlternativeFieldTrial())
648 drp_flags |= DataReductionProxyParams::kAlternativeAllowed; 643 drp_flags |= DataReductionProxyParams::kAlternativeAllowed;
649 if (DataReductionProxyParams::IsIncludedInPromoFieldTrial()) 644 globals_->data_reduction_proxy_params.reset(
650 drp_flags |= DataReductionProxyParams::kPromoAllowed; 645 new DataReductionProxyParams(drp_flags));
willchan no longer on Chromium 2014/07/29 00:26:56 Can you get rid of the using declaration above and
bengr 2014/07/29 21:29:52 Done.
651 DataReductionProxyParams* proxy_params =
652 new DataReductionProxyParams(drp_flags);
653 globals_->data_reduction_proxy_params.reset(proxy_params);
654 globals_->data_reduction_proxy_auth_request_handler.reset( 646 globals_->data_reduction_proxy_auth_request_handler.reset(
655 new DataReductionProxyAuthRequestHandler(proxy_params)); 647 new data_reduction_proxy::DataReductionProxyAuthRequestHandler(
656 globals_->on_resolve_proxy_handler = 648 globals_->data_reduction_proxy_params.get(),
657 ChromeNetworkDelegate::OnResolveProxyHandler( 649 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
658 base::Bind(data_reduction_proxy::OnResolveProxyHandler)); 650
659 DataReductionProxyUsageStats* proxy_usage_stats = 651 // This is the same as in ProfileImplIOData except that we do not collect
660 new DataReductionProxyUsageStats(proxy_params, 652 // usage stats.
661 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), 653 network_delegate->set_data_reduction_proxy_params(
662 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); 654 globals_->data_reduction_proxy_params.get());
663 network_delegate->set_data_reduction_proxy_params(proxy_params);
664 globals_->data_reduction_proxy_usage_stats.reset(proxy_usage_stats);
665 network_delegate->set_data_reduction_proxy_usage_stats(proxy_usage_stats);
666 network_delegate->set_data_reduction_proxy_auth_request_handler( 655 network_delegate->set_data_reduction_proxy_auth_request_handler(
667 globals_->data_reduction_proxy_auth_request_handler.get()); 656 globals_->data_reduction_proxy_auth_request_handler.get());
668 network_delegate->set_on_resolve_proxy_handler( 657 network_delegate->set_on_resolve_proxy_handler(
669 globals_->on_resolve_proxy_handler); 658 base::Bind(data_reduction_proxy::OnResolveProxyHandler));
670 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) 659 #endif // defined(SPDY_PROXY_AUTH_ORIGIN)
671 #endif // defined(OS_ANDROID) || defined(OS_IOS) 660
661
willchan no longer on Chromium 2014/07/29 00:26:56 Can you delete this vertical whitespace? I general
bengr 2014/07/29 21:29:52 Done.
672 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory( 662 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory(
673 globals_->host_resolver.get())); 663 globals_->host_resolver.get()));
674 globals_->http_server_properties.reset(new net::HttpServerPropertiesImpl()); 664 globals_->http_server_properties.reset(new net::HttpServerPropertiesImpl());
675 // For the ProxyScriptFetcher, we use a direct ProxyService. 665 // For the ProxyScriptFetcher, we use a direct ProxyService.
676 globals_->proxy_script_fetcher_proxy_service.reset( 666 globals_->proxy_script_fetcher_proxy_service.reset(
677 net::ProxyService::CreateDirectWithNetLog(net_log_)); 667 net::ProxyService::CreateDirectWithNetLog(net_log_));
678 // In-memory cookie store. 668 // In-memory cookie store.
679 globals_->system_cookie_store = 669 globals_->system_cookie_store =
680 content::CreateCookieStore(content::CookieStoreConfig()); 670 content::CreateCookieStore(content::CookieStoreConfig());
681 // In-memory server bound cert store. 671 // In-memory server bound cert store.
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
1381 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); 1371 net::QuicVersionVector supported_versions = net::QuicSupportedVersions();
1382 for (size_t i = 0; i < supported_versions.size(); ++i) { 1372 for (size_t i = 0; i < supported_versions.size(); ++i) {
1383 net::QuicVersion version = supported_versions[i]; 1373 net::QuicVersion version = supported_versions[i];
1384 if (net::QuicVersionToString(version) == quic_version) { 1374 if (net::QuicVersionToString(version) == quic_version) {
1385 return version; 1375 return version;
1386 } 1376 }
1387 } 1377 }
1388 1378
1389 return net::QUIC_VERSION_UNSUPPORTED; 1379 return net::QUIC_VERSION_UNSUPPORTED;
1390 } 1380 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698