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

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

Issue 18054010: Use a direct include of time headers in net/, part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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_session.h ('k') | net/dns/dns_transaction.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_session.h" 5 #include "net/dns/dns_session.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/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "base/metrics/sample_vector.h" 11 #include "base/metrics/sample_vector.h"
12 #include "base/rand_util.h" 12 #include "base/rand_util.h"
13 #include "base/stl_util.h" 13 #include "base/stl_util.h"
14 #include "base/time.h" 14 #include "base/time/time.h"
15 #include "net/base/ip_endpoint.h" 15 #include "net/base/ip_endpoint.h"
16 #include "net/base/net_errors.h" 16 #include "net/base/net_errors.h"
17 #include "net/dns/dns_config_service.h" 17 #include "net/dns/dns_config_service.h"
18 #include "net/dns/dns_socket_pool.h" 18 #include "net/dns/dns_socket_pool.h"
19 #include "net/socket/stream_socket.h" 19 #include "net/socket/stream_socket.h"
20 #include "net/udp/datagram_client_socket.h" 20 #include "net/udp/datagram_client_socket.h"
21 21
22 namespace net { 22 namespace net {
23 23
24 namespace { 24 namespace {
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 timeout = std::max(timeout, base::TimeDelta::FromMilliseconds(kMinTimeoutMs)); 295 timeout = std::max(timeout, base::TimeDelta::FromMilliseconds(kMinTimeoutMs));
296 296
297 // The timeout still doubles every full round. 297 // The timeout still doubles every full round.
298 unsigned num_backoffs = attempt / config_.nameservers.size(); 298 unsigned num_backoffs = attempt / config_.nameservers.size();
299 299
300 return std::min(timeout * (1 << num_backoffs), 300 return std::min(timeout * (1 << num_backoffs),
301 base::TimeDelta::FromMilliseconds(kMaxTimeoutMs)); 301 base::TimeDelta::FromMilliseconds(kMaxTimeoutMs));
302 } 302 }
303 303
304 } // namespace net 304 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/dns_session.h ('k') | net/dns/dns_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698