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_posix.h" | 5 #include "net/dns/dns_config_service_posix.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 explicit ConfigReader(DnsConfigServicePosix* service) | 259 explicit ConfigReader(DnsConfigServicePosix* service) |
260 : service_(service), success_(false) {} | 260 : service_(service), success_(false) {} |
261 | 261 |
262 virtual void DoWork() OVERRIDE { | 262 virtual void DoWork() OVERRIDE { |
263 base::TimeTicks start_time = base::TimeTicks::Now(); | 263 base::TimeTicks start_time = base::TimeTicks::Now(); |
264 ConfigParsePosixResult result = ReadDnsConfig(&dns_config_); | 264 ConfigParsePosixResult result = ReadDnsConfig(&dns_config_); |
265 switch (result) { | 265 switch (result) { |
266 case CONFIG_PARSE_POSIX_MISSING_OPTIONS: | 266 case CONFIG_PARSE_POSIX_MISSING_OPTIONS: |
267 case CONFIG_PARSE_POSIX_UNHANDLED_OPTIONS: | 267 case CONFIG_PARSE_POSIX_UNHANDLED_OPTIONS: |
268 DCHECK(dns_config_.unhandled_options); | 268 DCHECK(dns_config_.unhandled_options); |
269 // Fall through. | 269 FALLTHROUGH_INTENDED; |
270 case CONFIG_PARSE_POSIX_OK: | 270 case CONFIG_PARSE_POSIX_OK: |
271 success_ = true; | 271 success_ = true; |
272 break; | 272 break; |
273 default: | 273 default: |
274 success_ = false; | 274 success_ = false; |
275 break; | 275 break; |
276 } | 276 } |
277 UMA_HISTOGRAM_ENUMERATION("AsyncDNS.ConfigParsePosix", | 277 UMA_HISTOGRAM_ENUMERATION("AsyncDNS.ConfigParsePosix", |
278 result, CONFIG_PARSE_POSIX_MAX); | 278 result, CONFIG_PARSE_POSIX_MAX); |
279 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.ConfigParseResult", success_); | 279 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.ConfigParseResult", success_); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 virtual void ReadNow() OVERRIDE {} | 500 virtual void ReadNow() OVERRIDE {} |
501 virtual bool StartWatching() OVERRIDE { return false; } | 501 virtual bool StartWatching() OVERRIDE { return false; } |
502 }; | 502 }; |
503 // static | 503 // static |
504 scoped_ptr<DnsConfigService> DnsConfigService::CreateSystemService() { | 504 scoped_ptr<DnsConfigService> DnsConfigService::CreateSystemService() { |
505 return scoped_ptr<DnsConfigService>(new StubDnsConfigService()); | 505 return scoped_ptr<DnsConfigService>(new StubDnsConfigService()); |
506 } | 506 } |
507 #endif | 507 #endif |
508 | 508 |
509 } // namespace net | 509 } // namespace net |
OLD | NEW |