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

Side by Side Diff: net/base/host_resolver_impl.cc

Issue 10543168: [net/dns] Instrument DnsConfigService to measure performance and failures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 8 years, 6 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 | « no previous file | net/dns/dns_config_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/base/host_resolver_impl.h" 5 #include "net/base/host_resolver_impl.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <Winsock2.h> 8 #include <Winsock2.h>
9 #elif defined(OS_POSIX) 9 #elif defined(OS_POSIX)
10 #include <netdb.h> 10 #include <netdb.h>
(...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 1376
1377 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_HOST_RESOLVER_IMPL_JOB, 1377 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_HOST_RESOLVER_IMPL_JOB,
1378 net_error); 1378 net_error);
1379 1379
1380 DCHECK(!requests_.empty()); 1380 DCHECK(!requests_.empty());
1381 1381
1382 if (net_error == OK) { 1382 if (net_error == OK) {
1383 SetPortOnAddressList(requests_->front()->info().port(), &list); 1383 SetPortOnAddressList(requests_->front()->info().port(), &list);
1384 // Record this histogram here, when we know the system has a valid DNS 1384 // Record this histogram here, when we know the system has a valid DNS
1385 // configuration. 1385 // configuration.
1386 UMA_HISTOGRAM_ENUMERATION("AsyncDNS.HaveDnsConfig", 1386 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.HaveDnsConfig",
1387 resolver_->received_dns_config_ ? 1 : 0, 1387 resolver_->received_dns_config_);
1388 2);
1389 } 1388 }
1390 1389
1391 if ((net_error != ERR_ABORTED) && 1390 if ((net_error != ERR_ABORTED) &&
1392 (net_error != ERR_HOST_RESOLVER_QUEUE_TOO_LARGE)) { 1391 (net_error != ERR_HOST_RESOLVER_QUEUE_TOO_LARGE)) {
1393 resolver_->CacheResult(key_, net_error, list, ttl); 1392 resolver_->CacheResult(key_, net_error, list, ttl);
1394 } 1393 }
1395 1394
1396 // Complete all of the requests that were attached to the job. 1395 // Complete all of the requests that were attached to the job.
1397 for (RequestsList::const_iterator it = requests_.begin(); 1396 for (RequestsList::const_iterator it = requests_.begin();
1398 it != requests_.end(); ++it) { 1397 it != requests_.end(); ++it) {
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
1930 if (self) 1929 if (self)
1931 TryServingAllJobsFromHosts(); 1930 TryServingAllJobsFromHosts();
1932 } 1931 }
1933 } 1932 }
1934 1933
1935 bool HostResolverImpl::HaveDnsConfig() const { 1934 bool HostResolverImpl::HaveDnsConfig() const {
1936 return (dns_client_.get() != NULL) && (dns_client_->GetConfig() != NULL); 1935 return (dns_client_.get() != NULL) && (dns_client_->GetConfig() != NULL);
1937 } 1936 }
1938 1937
1939 } // namespace net 1938 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/dns/dns_config_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698