| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(NULL, host_resolver, proxy_service, | 146 factory = new net::HttpCache(NULL, host_resolver, proxy_service, |
| 147 ssl_config_service, | 147 ssl_config_service, |
| 148 http_auth_handler_factory.get(), | 148 http_auth_handler_factory.get(), |
| 149 NULL, |
| 149 net::HttpCache::DefaultBackend::InMemory(0)); | 150 net::HttpCache::DefaultBackend::InMemory(0)); |
| 150 } else { | 151 } else { |
| 151 factory = new net::HttpNetworkLayer( | 152 factory = new net::HttpNetworkLayer( |
| 152 net::ClientSocketFactory::GetDefaultFactory(), NULL, host_resolver, | 153 net::ClientSocketFactory::GetDefaultFactory(), NULL, host_resolver, |
| 153 proxy_service, ssl_config_service, http_auth_handler_factory.get()); | 154 proxy_service, ssl_config_service, http_auth_handler_factory.get(), |
| 155 NULL); |
| 154 } | 156 } |
| 155 | 157 |
| 156 { | 158 { |
| 157 StatsCounterTimer driver_time("FetchClient.total_time"); | 159 StatsCounterTimer driver_time("FetchClient.total_time"); |
| 158 StatsScope<StatsCounterTimer> scope(driver_time); | 160 StatsScope<StatsCounterTimer> scope(driver_time); |
| 159 | 161 |
| 160 Client** clients = new Client*[client_limit]; | 162 Client** clients = new Client*[client_limit]; |
| 161 for (int i = 0; i < client_limit; i++) | 163 for (int i = 0; i < client_limit; i++) |
| 162 clients[i] = new Client(factory, url); | 164 clients[i] = new Client(factory, url); |
| 163 | 165 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 std::string name(table.GetRowName(index)); | 198 std::string name(table.GetRowName(index)); |
| 197 if (name.length() > 0) { | 199 if (name.length() > 0) { |
| 198 int value = table.GetRowValue(index); | 200 int value = table.GetRowValue(index); |
| 199 printf("%s:\t%d\n", name.c_str(), value); | 201 printf("%s:\t%d\n", name.c_str(), value); |
| 200 } | 202 } |
| 201 } | 203 } |
| 202 printf("</stats>\n"); | 204 printf("</stats>\n"); |
| 203 } | 205 } |
| 204 return 0; | 206 return 0; |
| 205 } | 207 } |
| OLD | NEW |