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

Side by Side Diff: net/dns/dns_test_util.cc

Issue 9190031: DnsClient refactoring + features (timeout, suffix search, server rotation). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Delinted. Created 8 years, 11 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/dns/dns_test_util.h ('k') | net/dns/dns_transaction.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "net/dns/dns_test_util.h"
6
7 #include "base/message_loop.h"
8
9 namespace net {
10
11 bool ConvertStringsToIPAddressList(
12 const char* const ip_strings[], size_t size, IPAddressList* address_list) {
13 DCHECK(address_list);
14 IPAddressList ip_addresses;
15 for (size_t i = 0; i < size; ++i) {
16 IPAddressNumber ip;
17 if (!ParseIPLiteralToNumber(ip_strings[i], &ip))
18 return false;
19 ip_addresses.push_back(ip);
20 }
21 address_list->swap(ip_addresses);
22 return true;
23 }
24
25 bool CreateDnsAddress(
26 const char* ip_string, uint16 port, IPEndPoint* endpoint) {
27 DCHECK(endpoint);
28 IPAddressNumber ip_address;
29 if (!ParseIPLiteralToNumber(ip_string, &ip_address))
30 return false;
31 *endpoint = IPEndPoint(ip_address, port);
32 return true;
33 }
34
35 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/dns_test_util.h ('k') | net/dns/dns_transaction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698