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

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

Issue 10826212: [net/dns] Hardcode DnsConfig.timeout to 1 second. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: responded to review Created 8 years, 4 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_config_service.h ('k') | net/dns/dns_config_service_posix.cc » ('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/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.h" 8 #include "base/metrics/histogram.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"
11 11
12 namespace net { 12 namespace net {
13 13
14 // Default values are taken from glibc resolv.h. 14 // Default values are taken from glibc resolv.h except timeout which is set to
15 // |kDnsTimeoutSeconds|.
15 DnsConfig::DnsConfig() 16 DnsConfig::DnsConfig()
16 : append_to_multi_label_name(true), 17 : append_to_multi_label_name(true),
17 ndots(1), 18 ndots(1),
18 timeout(base::TimeDelta::FromSeconds(5)), 19 timeout(base::TimeDelta::FromSeconds(kDnsTimeoutSeconds)),
19 attempts(2), 20 attempts(2),
20 rotate(false), 21 rotate(false),
21 edns0(false) {} 22 edns0(false) {}
22 23
23 DnsConfig::~DnsConfig() {} 24 DnsConfig::~DnsConfig() {}
24 25
25 bool DnsConfig::Equals(const DnsConfig& d) const { 26 bool DnsConfig::Equals(const DnsConfig& d) const {
26 return EqualsIgnoreHosts(d) && (hosts == d.hosts); 27 return EqualsIgnoreHosts(d) && (hosts == d.hosts);
27 } 28 }
28 29
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 timer_.Stop(); 214 timer_.Stop();
214 if (!need_update_) 215 if (!need_update_)
215 return; 216 return;
216 need_update_ = false; 217 need_update_ = false;
217 last_sent_empty_ = false; 218 last_sent_empty_ = false;
218 callback_.Run(dns_config_); 219 callback_.Run(dns_config_);
219 } 220 }
220 221
221 } // namespace net 222 } // namespace net
222 223
OLDNEW
« no previous file with comments | « net/dns/dns_config_service.h ('k') | net/dns/dns_config_service_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698