OLD | NEW |
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/dns/dns_config_service.h" | 5 #include "net/dns/dns_config_service.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/cancelable_callback.h" | 9 #include "base/cancelable_callback.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 protected: | 34 protected: |
35 NameServerClassifier::NameServersType Classify( | 35 NameServerClassifier::NameServersType Classify( |
36 const std::string& servers_string) { | 36 const std::string& servers_string) { |
37 std::vector<std::string> server_strings; | 37 std::vector<std::string> server_strings; |
38 base::SplitString(servers_string, ' ', &server_strings); | 38 base::SplitString(servers_string, ' ', &server_strings); |
39 | 39 |
40 std::vector<IPEndPoint> servers; | 40 std::vector<IPEndPoint> servers; |
41 for (std::vector<std::string>::const_iterator it = server_strings.begin(); | 41 for (std::vector<std::string>::const_iterator it = server_strings.begin(); |
42 it != server_strings.end(); | 42 it != server_strings.end(); |
43 ++it) { | 43 ++it) { |
44 if (*it == "") | 44 if (it->empty()) |
45 continue; | 45 continue; |
46 | 46 |
47 IPAddressNumber address; | 47 IPAddressNumber address; |
48 bool parsed = ParseIPLiteralToNumber(*it, &address); | 48 bool parsed = ParseIPLiteralToNumber(*it, &address); |
49 EXPECT_TRUE(parsed); | 49 EXPECT_TRUE(parsed); |
50 servers.push_back(IPEndPoint(address, dns_protocol::kDefaultPort)); | 50 servers.push_back(IPEndPoint(address, dns_protocol::kDefaultPort)); |
51 } | 51 } |
52 | 52 |
53 return classifier_.GetNameServersType(servers); | 53 return classifier_.GetNameServersType(servers); |
54 } | 54 } |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 base::Unretained(this))); | 343 base::Unretained(this))); |
344 base::TimeDelta kTimeout = TestTimeouts::action_max_timeout(); | 344 base::TimeDelta kTimeout = TestTimeouts::action_max_timeout(); |
345 WaitForConfig(kTimeout); | 345 WaitForConfig(kTimeout); |
346 ASSERT_TRUE(last_config_.IsValid()) << "Did not receive DnsConfig in " << | 346 ASSERT_TRUE(last_config_.IsValid()) << "Did not receive DnsConfig in " << |
347 kTimeout.InSecondsF() << "s"; | 347 kTimeout.InSecondsF() << "s"; |
348 } | 348 } |
349 #endif // OS_POSIX || OS_WIN | 349 #endif // OS_POSIX || OS_WIN |
350 | 350 |
351 } // namespace net | 351 } // namespace net |
352 | 352 |
OLD | NEW |