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

Side by Side Diff: net/tools/fetch/fetch_client.cc

Issue 15829004: Update net/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: license twerk Created 7 years, 6 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 | « net/tools/dump_cache/simple_cache_dumper.cc ('k') | net/tools/fetch/http_listen_socket.cc » ('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 "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"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory( 154 scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory(
155 net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get())); 155 net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get()));
156 net::HttpServerPropertiesImpl http_server_properties; 156 net::HttpServerPropertiesImpl http_server_properties;
157 157
158 net::HttpNetworkSession::Params session_params; 158 net::HttpNetworkSession::Params session_params;
159 session_params.host_resolver = host_resolver.get(); 159 session_params.host_resolver = host_resolver.get();
160 session_params.cert_verifier = cert_verifier.get(); 160 session_params.cert_verifier = cert_verifier.get();
161 session_params.proxy_service = proxy_service.get(); 161 session_params.proxy_service = proxy_service.get();
162 session_params.http_auth_handler_factory = http_auth_handler_factory.get(); 162 session_params.http_auth_handler_factory = http_auth_handler_factory.get();
163 session_params.http_server_properties = &http_server_properties; 163 session_params.http_server_properties = &http_server_properties;
164 session_params.ssl_config_service = ssl_config_service; 164 session_params.ssl_config_service = ssl_config_service.get();
165 165
166 scoped_refptr<net::HttpNetworkSession> network_session( 166 scoped_refptr<net::HttpNetworkSession> network_session(
167 new net::HttpNetworkSession(session_params)); 167 new net::HttpNetworkSession(session_params));
168 if (use_cache) { 168 if (use_cache) {
169 factory = new net::HttpCache(network_session, 169 factory = new net::HttpCache(network_session.get(),
170 net::HttpCache::DefaultBackend::InMemory(0)); 170 net::HttpCache::DefaultBackend::InMemory(0));
171 } else { 171 } else {
172 factory = new net::HttpNetworkLayer(network_session); 172 factory = new net::HttpNetworkLayer(network_session.get());
173 } 173 }
174 174
175 { 175 {
176 base::StatsCounterTimer driver_time("FetchClient.total_time"); 176 base::StatsCounterTimer driver_time("FetchClient.total_time");
177 base::StatsScope<base::StatsCounterTimer> scope(driver_time); 177 base::StatsScope<base::StatsCounterTimer> scope(driver_time);
178 178
179 Client** clients = new Client*[client_limit]; 179 Client** clients = new Client*[client_limit];
180 for (int i = 0; i < client_limit; i++) 180 for (int i = 0; i < client_limit; i++)
181 clients[i] = new Client(factory, url); 181 clients[i] = new Client(factory, url);
182 182
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 std::string name(table.GetRowName(index)); 215 std::string name(table.GetRowName(index));
216 if (name.length() > 0) { 216 if (name.length() > 0) {
217 int value = table.GetRowValue(index); 217 int value = table.GetRowValue(index);
218 printf("%s:\t%d\n", name.c_str(), value); 218 printf("%s:\t%d\n", name.c_str(), value);
219 } 219 }
220 } 220 }
221 printf("</stats>\n"); 221 printf("</stats>\n");
222 } 222 }
223 return 0; 223 return 0;
224 } 224 }
OLDNEW
« no previous file with comments | « net/tools/dump_cache/simple_cache_dumper.cc ('k') | net/tools/fetch/http_listen_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698