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

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

Issue 10831277: [net] Change factory methods for HostResolver and HostCache to return a scoped_ptr (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unnecessary initialization; respond to review Created 8 years, 1 month 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/test/base_test_server.cc ('k') | net/url_request/url_request_context_builder.h » ('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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 if (parsed_command_line.HasSwitch("n")) { 134 if (parsed_command_line.HasSwitch("n")) {
135 base::StringToInt(parsed_command_line.GetSwitchValueASCII("n"), 135 base::StringToInt(parsed_command_line.GetSwitchValueASCII("n"),
136 &client_limit); 136 &client_limit);
137 } 137 }
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::HostResolver::CreateDefaultResolver(NULL));
145 net::HostResolver::kDefaultRetryAttempts,
146 NULL));
147
148 scoped_ptr<net::CertVerifier> cert_verifier( 145 scoped_ptr<net::CertVerifier> cert_verifier(
149 net::CertVerifier::CreateDefault()); 146 net::CertVerifier::CreateDefault());
150 scoped_ptr<net::ProxyService> proxy_service( 147 scoped_ptr<net::ProxyService> proxy_service(
151 net::ProxyService::CreateDirect()); 148 net::ProxyService::CreateDirect());
152 scoped_refptr<net::SSLConfigService> ssl_config_service( 149 scoped_refptr<net::SSLConfigService> ssl_config_service(
153 new net::SSLConfigServiceDefaults); 150 new net::SSLConfigServiceDefaults);
154 net::HttpTransactionFactory* factory = NULL; 151 net::HttpTransactionFactory* factory = NULL;
155 scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory( 152 scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory(
156 net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get())); 153 net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get()));
157 net::HttpServerPropertiesImpl http_server_properties; 154 net::HttpServerPropertiesImpl http_server_properties;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 std::string name(table.GetRowName(index)); 213 std::string name(table.GetRowName(index));
217 if (name.length() > 0) { 214 if (name.length() > 0) {
218 int value = table.GetRowValue(index); 215 int value = table.GetRowValue(index);
219 printf("%s:\t%d\n", name.c_str(), value); 216 printf("%s:\t%d\n", name.c_str(), value);
220 } 217 }
221 } 218 }
222 printf("</stats>\n"); 219 printf("</stats>\n");
223 } 220 }
224 return 0; 221 return 0;
225 } 222 }
OLDNEW
« no previous file with comments | « net/test/base_test_server.cc ('k') | net/url_request/url_request_context_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698