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

Side by Side Diff: net/test/spawned_test_server/base_test_server.cc

Issue 1177933002: Resolve RFC 6761 localhost names to loopback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolve test server addresses to IPv4 Created 5 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
« no previous file with comments | « net/dns/host_resolver_impl_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/spawned_test_server/base_test_server.h" 5 #include "net/test/spawned_test_server/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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 NOTREACHED(); 229 NOTREACHED();
230 } 230 }
231 return std::string(); 231 return std::string();
232 } 232 }
233 233
234 bool BaseTestServer::GetAddressList(AddressList* address_list) const { 234 bool BaseTestServer::GetAddressList(AddressList* address_list) const {
235 DCHECK(address_list); 235 DCHECK(address_list);
236 236
237 scoped_ptr<HostResolver> resolver(HostResolver::CreateDefaultResolver(NULL)); 237 scoped_ptr<HostResolver> resolver(HostResolver::CreateDefaultResolver(NULL));
238 HostResolver::RequestInfo info(host_port_pair_); 238 HostResolver::RequestInfo info(host_port_pair_);
239 // Do an IPv4 lookup since kLocalhost is IPv4.
Ryan Sleevi 2015/06/19 23:08:16 nit: maybe expand/reword the comment // Limit the
estark 2015/06/19 23:17:36 Done.
240 info.set_address_family(ADDRESS_FAMILY_IPV4);
239 TestCompletionCallback callback; 241 TestCompletionCallback callback;
240 int rv = resolver->Resolve(info, 242 int rv = resolver->Resolve(info,
241 DEFAULT_PRIORITY, 243 DEFAULT_PRIORITY,
242 address_list, 244 address_list,
243 callback.callback(), 245 callback.callback(),
244 NULL, 246 NULL,
245 BoundNetLog()); 247 BoundNetLog());
246 if (rv == ERR_IO_PENDING) 248 if (rv == ERR_IO_PENDING)
247 rv = callback.WaitForResult(); 249 rv = callback.WaitForResult();
248 if (rv != OK) { 250 if (rv != OK) {
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 509
508 return GenerateAdditionalArguments(arguments); 510 return GenerateAdditionalArguments(arguments);
509 } 511 }
510 512
511 bool BaseTestServer::GenerateAdditionalArguments( 513 bool BaseTestServer::GenerateAdditionalArguments(
512 base::DictionaryValue* arguments) const { 514 base::DictionaryValue* arguments) const {
513 return true; 515 return true;
514 } 516 }
515 517
516 } // namespace net 518 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/host_resolver_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698