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

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: add ChromeBrowserFieldTrials::AsyncDnsFieldTrial Created 8 years, 4 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
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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 case TYPE_UDP_ECHO: 156 case TYPE_UDP_ECHO:
157 default: 157 default:
158 NOTREACHED(); 158 NOTREACHED();
159 } 159 }
160 return std::string(); 160 return std::string();
161 } 161 }
162 162
163 bool BaseTestServer::GetAddressList(AddressList* address_list) const { 163 bool BaseTestServer::GetAddressList(AddressList* address_list) const {
164 DCHECK(address_list); 164 DCHECK(address_list);
165 165
166 scoped_ptr<HostResolver> resolver( 166 scoped_ptr<HostResolver> resolver(HostResolver::CreateDefaultResolver(NULL));
167 CreateSystemHostResolver(HostResolver::kDefaultParallelism,
168 HostResolver::kDefaultRetryAttempts,
169 NULL));
170 HostResolver::RequestInfo info(host_port_pair_); 167 HostResolver::RequestInfo info(host_port_pair_);
171 TestCompletionCallback callback; 168 TestCompletionCallback callback;
172 int rv = resolver->Resolve(info, address_list, callback.callback(), NULL, 169 int rv = resolver->Resolve(info, address_list, callback.callback(), NULL,
173 BoundNetLog()); 170 BoundNetLog());
174 if (rv == ERR_IO_PENDING) 171 if (rv == ERR_IO_PENDING)
175 rv = callback.WaitForResult(); 172 rv = callback.WaitForResult();
176 if (rv != net::OK) { 173 if (rv != net::OK) {
177 LOG(ERROR) << "Failed to resolve hostname: " << host_port_pair_.host(); 174 LOG(ERROR) << "Failed to resolve hostname: " << host_port_pair_.host();
178 return false; 175 return false;
179 } 176 }
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 arguments->Set("https-record-resume", base::Value::CreateNullValue()); 380 arguments->Set("https-record-resume", base::Value::CreateNullValue());
384 if (https_options_.tls_intolerant != HTTPSOptions::TLS_INTOLERANT_NONE) { 381 if (https_options_.tls_intolerant != HTTPSOptions::TLS_INTOLERANT_NONE) {
385 arguments->Set("tls-intolerant", 382 arguments->Set("tls-intolerant",
386 base::Value::CreateIntegerValue(https_options_.tls_intolerant)); 383 base::Value::CreateIntegerValue(https_options_.tls_intolerant));
387 } 384 }
388 } 385 }
389 return true; 386 return true;
390 } 387 }
391 388
392 } // namespace net 389 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698