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

Side by Side Diff: net/base/backoff_entry.h

Issue 6969077: net: Add NET_API to net/base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef NET_BASE_BACKOFF_ITEM_H_ 5 #ifndef NET_BASE_BACKOFF_ITEM_H_
6 #define NET_BASE_BACKOFF_ITEM_H_ 6 #define NET_BASE_BACKOFF_ITEM_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/threading/non_thread_safe.h" 9 #include "base/threading/non_thread_safe.h"
10 #include "base/time.h" 10 #include "base/time.h"
11 #include "net/base/net_api.h"
11 12
12 namespace net { 13 namespace net {
13 14
14 // Provides the core logic needed for randomized exponential back-off 15 // Provides the core logic needed for randomized exponential back-off
15 // on requests to a given resource, given a back-off policy. 16 // on requests to a given resource, given a back-off policy.
16 // 17 //
17 // This utility class knows nothing about network specifics; it is 18 // This utility class knows nothing about network specifics; it is
18 // intended for reuse in various networking scenarios. 19 // intended for reuse in various networking scenarios.
19 class BackoffEntry : public base::NonThreadSafe { 20 class NET_TEST BackoffEntry : NON_EXPORTED_BASE(public base::NonThreadSafe) {
20 public: 21 public:
21 // The set of parameters that define a back-off policy. 22 // The set of parameters that define a back-off policy.
22 struct Policy { 23 struct Policy {
23 // Number of initial errors (in sequence) to ignore before applying 24 // Number of initial errors (in sequence) to ignore before applying
24 // exponential back-off rules. 25 // exponential back-off rules.
25 int num_errors_to_ignore; 26 int num_errors_to_ignore;
26 27
27 // Initial delay for exponential back-off. 28 // Initial delay for exponential back-off.
28 int initial_backoff_ms; 29 int initial_backoff_ms;
29 30
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 int failure_count_; 86 int failure_count_;
86 87
87 const Policy* const policy_; 88 const Policy* const policy_;
88 89
89 DISALLOW_COPY_AND_ASSIGN(BackoffEntry); 90 DISALLOW_COPY_AND_ASSIGN(BackoffEntry);
90 }; 91 };
91 92
92 } // namespace net 93 } // namespace net
93 94
94 #endif // NET_BASE_BACKOFF_ITEM_H_ 95 #endif // NET_BASE_BACKOFF_ITEM_H_
OLDNEW
« base/compiler_specific.h ('K') | « net/base/auth.h ('k') | net/base/capturing_net_log.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698