| 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/metrics/stats_counters.h" | 10 #include "base/metrics/stats_counters.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 base::StringToInt(parsed_command_line.GetSwitchValueASCII("n"), | 130 base::StringToInt(parsed_command_line.GetSwitchValueASCII("n"), |
| 131 &client_limit); | 131 &client_limit); |
| 132 } | 132 } |
| 133 bool use_cache = parsed_command_line.HasSwitch("use-cache"); | 133 bool use_cache = parsed_command_line.HasSwitch("use-cache"); |
| 134 | 134 |
| 135 // Do work here. | 135 // Do work here. |
| 136 MessageLoop loop(MessageLoop::TYPE_IO); | 136 MessageLoop loop(MessageLoop::TYPE_IO); |
| 137 | 137 |
| 138 scoped_ptr<net::HostResolver> host_resolver( | 138 scoped_ptr<net::HostResolver> host_resolver( |
| 139 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, | 139 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, |
| 140 NULL, NULL)); | 140 NULL)); |
| 141 | 141 |
| 142 scoped_refptr<net::ProxyService> proxy_service( | 142 scoped_refptr<net::ProxyService> proxy_service( |
| 143 net::ProxyService::CreateDirect()); | 143 net::ProxyService::CreateDirect()); |
| 144 scoped_refptr<net::SSLConfigService> ssl_config_service( | 144 scoped_refptr<net::SSLConfigService> ssl_config_service( |
| 145 net::SSLConfigService::CreateSystemSSLConfigService()); | 145 net::SSLConfigService::CreateSystemSSLConfigService()); |
| 146 net::HttpTransactionFactory* factory = NULL; | 146 net::HttpTransactionFactory* factory = NULL; |
| 147 scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory( | 147 scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory( |
| 148 net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get())); | 148 net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get())); |
| 149 if (use_cache) { | 149 if (use_cache) { |
| 150 factory = new net::HttpCache(host_resolver.get(), NULL, proxy_service, | 150 factory = new net::HttpCache(host_resolver.get(), NULL, proxy_service, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 std::string name(table.GetRowName(index)); | 206 std::string name(table.GetRowName(index)); |
| 207 if (name.length() > 0) { | 207 if (name.length() > 0) { |
| 208 int value = table.GetRowValue(index); | 208 int value = table.GetRowValue(index); |
| 209 printf("%s:\t%d\n", name.c_str(), value); | 209 printf("%s:\t%d\n", name.c_str(), value); |
| 210 } | 210 } |
| 211 } | 211 } |
| 212 printf("</stats>\n"); | 212 printf("</stats>\n"); |
| 213 } | 213 } |
| 214 return 0; | 214 return 0; |
| 215 } | 215 } |
| OLD | NEW |