| 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 #ifndef NET_BASE_BACKOFF_ENTRY_H_ | 5 #ifndef NET_BASE_BACKOFF_ENTRY_H_ |
| 6 #define NET_BASE_BACKOFF_ENTRY_H_ | 6 #define NET_BASE_BACKOFF_ENTRY_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/threading/non_thread_safe.h" | 9 #include "base/threading/non_thread_safe.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 // Factor by which the waiting time will be multiplied. | 39 // Factor by which the waiting time will be multiplied. |
| 40 double multiply_factor; | 40 double multiply_factor; |
| 41 | 41 |
| 42 // Fuzzing percentage. ex: 10% will spread requests randomly | 42 // Fuzzing percentage. ex: 10% will spread requests randomly |
| 43 // between 90%-100% of the calculated time. | 43 // between 90%-100% of the calculated time. |
| 44 double jitter_factor; | 44 double jitter_factor; |
| 45 | 45 |
| 46 // Maximum amount of time we are willing to delay our request, -1 | 46 // Maximum amount of time we are willing to delay our request, -1 |
| 47 // for no maximum. | 47 // for no maximum. |
| 48 int64 maximum_backoff_ms; | 48 int64_t maximum_backoff_ms; |
| 49 | 49 |
| 50 // Time to keep an entry from being discarded even when it | 50 // Time to keep an entry from being discarded even when it |
| 51 // has no significant state, -1 to never discard. | 51 // has no significant state, -1 to never discard. |
| 52 int64 entry_lifetime_ms; | 52 int64_t entry_lifetime_ms; |
| 53 | 53 |
| 54 // If true, we always use a delay of initial_delay_ms, even before | 54 // If true, we always use a delay of initial_delay_ms, even before |
| 55 // we've seen num_errors_to_ignore errors. Otherwise, initial_delay_ms | 55 // we've seen num_errors_to_ignore errors. Otherwise, initial_delay_ms |
| 56 // is the first delay once we start exponential backoff. | 56 // is the first delay once we start exponential backoff. |
| 57 // | 57 // |
| 58 // So if we're ignoring 1 error, we'll see (N, N, Nm, Nm^2, ...) if true, | 58 // So if we're ignoring 1 error, we'll see (N, N, Nm, Nm^2, ...) if true, |
| 59 // and (0, 0, N, Nm, ...) when false, where N is initial_backoff_ms and | 59 // and (0, 0, N, Nm, ...) when false, where N is initial_backoff_ms and |
| 60 // m is multiply_factor, assuming we've already seen one success. | 60 // m is multiply_factor, assuming we've already seen one success. |
| 61 bool always_use_initial_delay; | 61 bool always_use_initial_delay; |
| 62 }; | 62 }; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 const Policy* const policy_; // Not owned. | 126 const Policy* const policy_; // Not owned. |
| 127 | 127 |
| 128 base::TickClock* const clock_; // Not owned. | 128 base::TickClock* const clock_; // Not owned. |
| 129 | 129 |
| 130 DISALLOW_COPY_AND_ASSIGN(BackoffEntry); | 130 DISALLOW_COPY_AND_ASSIGN(BackoffEntry); |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 } // namespace net | 133 } // namespace net |
| 134 | 134 |
| 135 #endif // NET_BASE_BACKOFF_ENTRY_H_ | 135 #endif // NET_BASE_BACKOFF_ENTRY_H_ |
| OLD | NEW |