| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 usage(argv[0]); | 126 usage(argv[0]); |
| 127 int client_limit = 1; | 127 int client_limit = 1; |
| 128 if (parsed_command_line.HasSwitch("n")) | 128 if (parsed_command_line.HasSwitch("n")) |
| 129 StringToInt(parsed_command_line.GetSwitchValueASCII("n"), &client_limit); | 129 StringToInt(parsed_command_line.GetSwitchValueASCII("n"), &client_limit); |
| 130 bool use_cache = parsed_command_line.HasSwitch("use-cache"); | 130 bool use_cache = parsed_command_line.HasSwitch("use-cache"); |
| 131 | 131 |
| 132 // Do work here. | 132 // Do work here. |
| 133 MessageLoop loop(MessageLoop::TYPE_IO); | 133 MessageLoop loop(MessageLoop::TYPE_IO); |
| 134 | 134 |
| 135 scoped_refptr<net::HostResolver> host_resolver( | 135 scoped_refptr<net::HostResolver> host_resolver( |
| 136 net::CreateSystemHostResolver()); | 136 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism)); |
| 137 | 137 |
| 138 scoped_refptr<net::ProxyService> proxy_service( | 138 scoped_refptr<net::ProxyService> proxy_service( |
| 139 net::ProxyService::CreateNull()); | 139 net::ProxyService::CreateNull()); |
| 140 scoped_refptr<net::SSLConfigService> ssl_config_service( | 140 scoped_refptr<net::SSLConfigService> ssl_config_service( |
| 141 net::SSLConfigService::CreateSystemSSLConfigService()); | 141 net::SSLConfigService::CreateSystemSSLConfigService()); |
| 142 net::HttpTransactionFactory* factory = NULL; | 142 net::HttpTransactionFactory* factory = NULL; |
| 143 scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory( | 143 scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory( |
| 144 net::HttpAuthHandlerFactory::CreateDefault()); | 144 net::HttpAuthHandlerFactory::CreateDefault()); |
| 145 if (use_cache) { | 145 if (use_cache) { |
| 146 factory = new net::HttpCache(host_resolver, proxy_service, | 146 factory = new net::HttpCache(host_resolver, proxy_service, |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 std::string name(table.GetRowName(index)); | 196 std::string name(table.GetRowName(index)); |
| 197 if (name.length() > 0) { | 197 if (name.length() > 0) { |
| 198 int value = table.GetRowValue(index); | 198 int value = table.GetRowValue(index); |
| 199 printf("%s:\t%d\n", name.c_str(), value); | 199 printf("%s:\t%d\n", name.c_str(), value); |
| 200 } | 200 } |
| 201 } | 201 } |
| 202 printf("</stats>\n"); | 202 printf("</stats>\n"); |
| 203 } | 203 } |
| 204 return 0; | 204 return 0; |
| 205 } | 205 } |
| OLD | NEW |