| OLD | NEW |
| 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_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 // Name of the header that sites can use to opt out of exponential back-off | 65 // Name of the header that sites can use to opt out of exponential back-off |
| 66 // throttling. | 66 // throttling. |
| 67 static const char kExponentialThrottlingHeader[]; | 67 static const char kExponentialThrottlingHeader[]; |
| 68 | 68 |
| 69 // Value for exponential throttling header that can be used to opt out of | 69 // Value for exponential throttling header that can be used to opt out of |
| 70 // exponential back-off throttling. | 70 // exponential back-off throttling. |
| 71 static const char kExponentialThrottlingDisableValue[]; | 71 static const char kExponentialThrottlingDisableValue[]; |
| 72 | 72 |
| 73 // The manager object's lifetime must enclose the lifetime of this object. | 73 // The manager object's lifetime must enclose the lifetime of this object. |
| 74 explicit URLRequestThrottlerEntry(URLRequestThrottlerManager* manager, | 74 URLRequestThrottlerEntry(URLRequestThrottlerManager* manager, |
| 75 const std::string& url_id); | 75 const std::string& url_id); |
| 76 | 76 |
| 77 // The life span of instances created with this constructor is set to | 77 // The life span of instances created with this constructor is set to |
| 78 // infinite, and the number of initial errors to ignore is set to 0. | 78 // infinite, and the number of initial errors to ignore is set to 0. |
| 79 // It is only used by unit tests. | 79 // It is only used by unit tests. |
| 80 URLRequestThrottlerEntry(URLRequestThrottlerManager* manager, | 80 URLRequestThrottlerEntry(URLRequestThrottlerManager* manager, |
| 81 const std::string& url_id, | 81 const std::string& url_id, |
| 82 int sliding_window_period_ms, | 82 int sliding_window_period_ms, |
| 83 int max_send_threshold, | 83 int max_send_threshold, |
| 84 int initial_backoff_ms, | 84 int initial_backoff_ms, |
| 85 double multiply_factor, | 85 double multiply_factor, |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 std::string url_id_; | 182 std::string url_id_; |
| 183 | 183 |
| 184 BoundNetLog net_log_; | 184 BoundNetLog net_log_; |
| 185 | 185 |
| 186 DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerEntry); | 186 DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerEntry); |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 } // namespace net | 189 } // namespace net |
| 190 | 190 |
| 191 #endif // NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_H_ | 191 #endif // NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_H_ |
| OLD | NEW |