| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/metrics/stats_counters.h" | 13 #include "base/metrics/stats_counters.h" |
| 14 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
| 15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 16 #include "net/base/cert_verifier.h" | |
| 17 #include "net/base/completion_callback.h" | 16 #include "net/base/completion_callback.h" |
| 18 #include "net/base/host_resolver.h" | 17 #include "net/base/host_resolver.h" |
| 19 #include "net/base/io_buffer.h" | 18 #include "net/base/io_buffer.h" |
| 19 #include "net/base/multi_threaded_cert_verifier.h" |
| 20 #include "net/base/net_errors.h" | 20 #include "net/base/net_errors.h" |
| 21 #include "net/base/ssl_config_service_defaults.h" | 21 #include "net/base/ssl_config_service_defaults.h" |
| 22 #include "net/http/http_auth_handler_factory.h" | 22 #include "net/http/http_auth_handler_factory.h" |
| 23 #include "net/http/http_cache.h" | 23 #include "net/http/http_cache.h" |
| 24 #include "net/http/http_network_layer.h" | 24 #include "net/http/http_network_layer.h" |
| 25 #include "net/http/http_network_session.h" | 25 #include "net/http/http_network_session.h" |
| 26 #include "net/http/http_request_info.h" | 26 #include "net/http/http_request_info.h" |
| 27 #include "net/http/http_server_properties_impl.h" | 27 #include "net/http/http_server_properties_impl.h" |
| 28 #include "net/http/http_transaction.h" | 28 #include "net/http/http_transaction.h" |
| 29 #include "net/proxy/proxy_service.h" | 29 #include "net/proxy/proxy_service.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 bool use_cache = parsed_command_line.HasSwitch("use-cache"); | 138 bool use_cache = parsed_command_line.HasSwitch("use-cache"); |
| 139 | 139 |
| 140 // Do work here. | 140 // Do work here. |
| 141 MessageLoop loop(MessageLoop::TYPE_IO); | 141 MessageLoop loop(MessageLoop::TYPE_IO); |
| 142 | 142 |
| 143 scoped_ptr<net::HostResolver> host_resolver( | 143 scoped_ptr<net::HostResolver> host_resolver( |
| 144 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, | 144 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, |
| 145 net::HostResolver::kDefaultRetryAttempts, | 145 net::HostResolver::kDefaultRetryAttempts, |
| 146 NULL)); | 146 NULL)); |
| 147 | 147 |
| 148 scoped_ptr<net::CertVerifier> cert_verifier(new net::CertVerifier); | 148 scoped_ptr<net::CertVerifier> cert_verifier( |
| 149 new net::MultiThreadedCertVerifier); |
| 149 scoped_ptr<net::ProxyService> proxy_service( | 150 scoped_ptr<net::ProxyService> proxy_service( |
| 150 net::ProxyService::CreateDirect()); | 151 net::ProxyService::CreateDirect()); |
| 151 scoped_refptr<net::SSLConfigService> ssl_config_service( | 152 scoped_refptr<net::SSLConfigService> ssl_config_service( |
| 152 new net::SSLConfigServiceDefaults); | 153 new net::SSLConfigServiceDefaults); |
| 153 net::HttpTransactionFactory* factory = NULL; | 154 net::HttpTransactionFactory* factory = NULL; |
| 154 scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory( | 155 scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory( |
| 155 net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get())); | 156 net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get())); |
| 156 net::HttpServerPropertiesImpl http_server_properties; | 157 net::HttpServerPropertiesImpl http_server_properties; |
| 157 | 158 |
| 158 net::HttpNetworkSession::Params session_params; | 159 net::HttpNetworkSession::Params session_params; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 std::string name(table.GetRowName(index)); | 216 std::string name(table.GetRowName(index)); |
| 216 if (name.length() > 0) { | 217 if (name.length() > 0) { |
| 217 int value = table.GetRowValue(index); | 218 int value = table.GetRowValue(index); |
| 218 printf("%s:\t%d\n", name.c_str(), value); | 219 printf("%s:\t%d\n", name.c_str(), value); |
| 219 } | 220 } |
| 220 } | 221 } |
| 221 printf("</stats>\n"); | 222 printf("</stats>\n"); |
| 222 } | 223 } |
| 223 return 0; | 224 return 0; |
| 224 } | 225 } |
| OLD | NEW |