OLD | NEW |
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 <stdint.h> | 7 #include <stdint.h> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 // Limit the lookup to IPv4. When started with the default | 347 // Limit the lookup to IPv4. When started with the default |
348 // address of kLocalhost, testserver.py only supports IPv4. | 348 // address of kLocalhost, testserver.py only supports IPv4. |
349 // If a custom hostname is used, it's possible that the test | 349 // If a custom hostname is used, it's possible that the test |
350 // server will listen on both IPv4 and IPv6, so this will | 350 // server will listen on both IPv4 and IPv6, so this will |
351 // still work. The testserver does not support explicit | 351 // still work. The testserver does not support explicit |
352 // IPv6 literal hostnames. | 352 // IPv6 literal hostnames. |
353 info.set_address_family(ADDRESS_FAMILY_IPV4); | 353 info.set_address_family(ADDRESS_FAMILY_IPV4); |
354 TestCompletionCallback callback; | 354 TestCompletionCallback callback; |
355 std::unique_ptr<HostResolver::Request> request; | 355 std::unique_ptr<HostResolver::Request> request; |
356 int rv = resolver->Resolve(info, DEFAULT_PRIORITY, address_list, | 356 int rv = resolver->Resolve(info, DEFAULT_PRIORITY, address_list, |
357 callback.callback(), &request, BoundNetLog()); | 357 callback.callback(), &request, NetLogWithSource()); |
358 if (rv == ERR_IO_PENDING) | 358 if (rv == ERR_IO_PENDING) |
359 rv = callback.WaitForResult(); | 359 rv = callback.WaitForResult(); |
360 if (rv != OK) { | 360 if (rv != OK) { |
361 LOG(ERROR) << "Failed to resolve hostname: " << host_port_pair_.host(); | 361 LOG(ERROR) << "Failed to resolve hostname: " << host_port_pair_.host(); |
362 return false; | 362 return false; |
363 } | 363 } |
364 return true; | 364 return true; |
365 } | 365 } |
366 | 366 |
367 uint16_t BaseTestServer::GetPort() { | 367 uint16_t BaseTestServer::GetPort() { |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 | 673 |
674 return GenerateAdditionalArguments(arguments); | 674 return GenerateAdditionalArguments(arguments); |
675 } | 675 } |
676 | 676 |
677 bool BaseTestServer::GenerateAdditionalArguments( | 677 bool BaseTestServer::GenerateAdditionalArguments( |
678 base::DictionaryValue* arguments) const { | 678 base::DictionaryValue* arguments) const { |
679 return true; | 679 return true; |
680 } | 680 } |
681 | 681 |
682 } // namespace net | 682 } // namespace net |
OLD | NEW |