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

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

Issue 9369045: [net] HostResolverImpl + DnsTransaction + DnsConfigService = Asynchronous DNS ready for experiments. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Denitted. Created 8 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/resources/net_internals/events_view.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 21 matching lines...) Expand all
32 #include "chrome/common/chrome_switches.h" 32 #include "chrome/common/chrome_switches.h"
33 #include "chrome/common/pref_names.h" 33 #include "chrome/common/pref_names.h"
34 #include "content/public/browser/browser_thread.h" 34 #include "content/public/browser/browser_thread.h"
35 #include "content/public/common/content_client.h" 35 #include "content/public/common/content_client.h"
36 #include "content/public/common/url_fetcher.h" 36 #include "content/public/common/url_fetcher.h"
37 #include "net/base/cert_verifier.h" 37 #include "net/base/cert_verifier.h"
38 #include "net/base/cookie_monster.h" 38 #include "net/base/cookie_monster.h"
39 #include "net/base/default_origin_bound_cert_store.h" 39 #include "net/base/default_origin_bound_cert_store.h"
40 #include "net/base/host_cache.h" 40 #include "net/base/host_cache.h"
41 #include "net/base/host_resolver.h" 41 #include "net/base/host_resolver.h"
42 #include "net/base/host_resolver_impl.h"
43 #include "net/base/mapped_host_resolver.h" 42 #include "net/base/mapped_host_resolver.h"
44 #include "net/base/net_util.h" 43 #include "net/base/net_util.h"
45 #include "net/base/origin_bound_cert_service.h" 44 #include "net/base/origin_bound_cert_service.h"
46 #include "net/base/sdch_manager.h" 45 #include "net/base/sdch_manager.h"
47 #include "net/dns/async_host_resolver.h"
48 #include "net/ftp/ftp_network_layer.h" 46 #include "net/ftp/ftp_network_layer.h"
49 #include "net/http/http_auth_filter.h" 47 #include "net/http/http_auth_filter.h"
50 #include "net/http/http_auth_handler_factory.h" 48 #include "net/http/http_auth_handler_factory.h"
51 #include "net/http/http_network_layer.h" 49 #include "net/http/http_network_layer.h"
52 #include "net/http/http_network_session.h" 50 #include "net/http/http_network_session.h"
53 #include "net/http/http_server_properties_impl.h" 51 #include "net/http/http_server_properties_impl.h"
54 #include "net/proxy/proxy_config_service.h" 52 #include "net/proxy/proxy_config_service.h"
55 #include "net/proxy/proxy_script_fetcher_impl.h" 53 #include "net/proxy/proxy_script_fetcher_impl.h"
56 #include "net/proxy/proxy_service.h" 54 #include "net/proxy/proxy_service.h"
57 55
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // Parse the switch (it should be a non-negative integer). 128 // Parse the switch (it should be a non-negative integer).
131 int n; 129 int n;
132 if (base::StringToInt(s, &n) && n >= 0) { 130 if (base::StringToInt(s, &n) && n >= 0) {
133 retry_attempts = static_cast<size_t>(n); 131 retry_attempts = static_cast<size_t>(n);
134 } else { 132 } else {
135 LOG(ERROR) << "Invalid switch for host resolver retry attempts: " << s; 133 LOG(ERROR) << "Invalid switch for host resolver retry attempts: " << s;
136 } 134 }
137 } 135 }
138 136
139 net::HostResolver* global_host_resolver = NULL; 137 net::HostResolver* global_host_resolver = NULL;
140 if (command_line.HasSwitch(switches::kDnsServer)) { 138 if (command_line.HasSwitch(switches::kEnableAsyncDns)) {
141 std::string dns_ip_string = 139 global_host_resolver =
142 command_line.GetSwitchValueASCII(switches::kDnsServer); 140 net::CreateAsyncHostResolver(parallelism, retry_attempts, net_log);
143 net::IPAddressNumber dns_ip_number;
144 if (net::ParseIPLiteralToNumber(dns_ip_string, &dns_ip_number)) {
145 global_host_resolver =
146 net::CreateAsyncHostResolver(parallelism, dns_ip_number, net_log);
147 } else {
148 LOG(ERROR) << "Invalid IP address specified for --dns-server: "
149 << dns_ip_string;
150 }
151 } 141 }
152 142
153 if (!global_host_resolver) { 143 if (!global_host_resolver) {
154 global_host_resolver = 144 global_host_resolver =
155 net::CreateSystemHostResolver(parallelism, retry_attempts, net_log); 145 net::CreateSystemHostResolver(parallelism, retry_attempts, net_log);
156 } 146 }
157 147
158 // Determine if we should disable IPv6 support. 148 // Determine if we should disable IPv6 support.
159 if (!command_line.HasSwitch(switches::kEnableIPv6)) { 149 if (!command_line.HasSwitch(switches::kEnableIPv6)) {
160 if (command_line.HasSwitch(switches::kDisableIPv6)) { 150 if (command_line.HasSwitch(switches::kDisableIPv6)) {
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 new net::HttpNetworkLayer( 604 new net::HttpNetworkLayer(
615 new net::HttpNetworkSession(system_params))); 605 new net::HttpNetworkSession(system_params)));
616 globals_->system_ftp_transaction_factory.reset( 606 globals_->system_ftp_transaction_factory.reset(
617 new net::FtpNetworkLayer(globals_->host_resolver.get())); 607 new net::FtpNetworkLayer(globals_->host_resolver.get()));
618 globals_->system_request_context = 608 globals_->system_request_context =
619 ConstructSystemRequestContext(globals_, net_log_); 609 ConstructSystemRequestContext(globals_, net_log_);
620 610
621 sdch_manager_->set_sdch_fetcher( 611 sdch_manager_->set_sdch_fetcher(
622 new SdchDictionaryFetcher(system_url_request_context_getter_.get())); 612 new SdchDictionaryFetcher(system_url_request_context_getter_.get()));
623 } 613 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/net_internals/events_view.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698