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

Side by Side Diff: net/test/base_test_server.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, 2 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/spdy/spdy_test_util_spdy3.cc ('k') | net/tools/fetch/fetch_client.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 "net/test/base_test_server.h" 5 #include "net/test/base_test_server.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 case TYPE_UDP_ECHO: 161 case TYPE_UDP_ECHO:
162 default: 162 default:
163 NOTREACHED(); 163 NOTREACHED();
164 } 164 }
165 return std::string(); 165 return std::string();
166 } 166 }
167 167
168 bool BaseTestServer::GetAddressList(AddressList* address_list) const { 168 bool BaseTestServer::GetAddressList(AddressList* address_list) const {
169 DCHECK(address_list); 169 DCHECK(address_list);
170 170
171 scoped_ptr<HostResolver> resolver( 171 scoped_ptr<HostResolver> resolver(HostResolver::CreateDefaultResolver(NULL));
172 CreateSystemHostResolver(HostResolver::kDefaultParallelism,
173 HostResolver::kDefaultRetryAttempts,
174 NULL));
175 HostResolver::RequestInfo info(host_port_pair_); 172 HostResolver::RequestInfo info(host_port_pair_);
176 TestCompletionCallback callback; 173 TestCompletionCallback callback;
177 int rv = resolver->Resolve(info, address_list, callback.callback(), NULL, 174 int rv = resolver->Resolve(info, address_list, callback.callback(), NULL,
178 BoundNetLog()); 175 BoundNetLog());
179 if (rv == ERR_IO_PENDING) 176 if (rv == ERR_IO_PENDING)
180 rv = callback.WaitForResult(); 177 rv = callback.WaitForResult();
181 if (rv != net::OK) { 178 if (rv != net::OK) {
182 LOG(ERROR) << "Failed to resolve hostname: " << host_port_pair_.host(); 179 LOG(ERROR) << "Failed to resolve hostname: " << host_port_pair_.host();
183 return false; 180 return false;
184 } 181 }
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 arguments->Set("https-record-resume", base::Value::CreateNullValue()); 387 arguments->Set("https-record-resume", base::Value::CreateNullValue());
391 if (ssl_options_.tls_intolerant != SSLOptions::TLS_INTOLERANT_NONE) { 388 if (ssl_options_.tls_intolerant != SSLOptions::TLS_INTOLERANT_NONE) {
392 arguments->Set("tls-intolerant", 389 arguments->Set("tls-intolerant",
393 base::Value::CreateIntegerValue(ssl_options_.tls_intolerant)); 390 base::Value::CreateIntegerValue(ssl_options_.tls_intolerant));
394 } 391 }
395 } 392 }
396 return true; 393 return true;
397 } 394 }
398 395
399 } // namespace net 396 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_test_util_spdy3.cc ('k') | net/tools/fetch/fetch_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698