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

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

Issue 1565303002: Change IPEndpoint::address() to return a net::IPAddress (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback eroman Created 4 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
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/dns/dns_config_service.h" 5 #include "net/dns/dns_config_service.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "net/base/ip_endpoint.h" 10 #include "net/base/ip_endpoint.h"
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 42
43 NameServerClassifier::~NameServerClassifier() {} 43 NameServerClassifier::~NameServerClassifier() {}
44 44
45 NameServerClassifier::NameServersType NameServerClassifier::GetNameServersType( 45 NameServerClassifier::NameServersType NameServerClassifier::GetNameServersType(
46 const std::vector<IPEndPoint>& nameservers) const { 46 const std::vector<IPEndPoint>& nameservers) const {
47 NameServersType type = NAME_SERVERS_TYPE_NONE; 47 NameServersType type = NAME_SERVERS_TYPE_NONE;
48 for (std::vector<IPEndPoint>::const_iterator it = nameservers.begin(); 48 for (std::vector<IPEndPoint>::const_iterator it = nameservers.begin();
49 it != nameservers.end(); 49 it != nameservers.end();
50 ++it) { 50 ++it) {
51 type = MergeNameServersTypes(type, GetNameServerType(it->address())); 51 type =
52 MergeNameServersTypes(type, GetNameServerType(it->address().bytes()));
52 } 53 }
53 return type; 54 return type;
54 } 55 }
55 56
56 struct NameServerClassifier::NameServerTypeRule { 57 struct NameServerClassifier::NameServerTypeRule {
57 NameServerTypeRule(const char* pattern_string, NameServersType type) 58 NameServerTypeRule(const char* pattern_string, NameServersType type)
58 : type(type) { 59 : type(type) {
59 bool parsed = pattern.ParsePattern(pattern_string); 60 bool parsed = pattern.ParsePattern(pattern_string);
60 DCHECK(parsed); 61 DCHECK(parsed);
61 } 62 }
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 if (watch_failed_) { 311 if (watch_failed_) {
311 // If a watch failed, the config may not be accurate, so report empty. 312 // If a watch failed, the config may not be accurate, so report empty.
312 callback_.Run(DnsConfig()); 313 callback_.Run(DnsConfig());
313 } else { 314 } else {
314 callback_.Run(dns_config_); 315 callback_.Run(dns_config_);
315 } 316 }
316 } 317 }
317 318
318 } // namespace net 319 } // namespace net
319 320
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698