| 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_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 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <queue> | 10 #include <queue> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "net/base/backoff_entry.h" | 15 #include "net/base/backoff_entry.h" |
| 16 #include "net/base/net_export.h" | 16 #include "net/base/net_export.h" |
| 17 #include "net/log/net_log_with_source.h" | 17 #include "net/log/net_log_with_source.h" |
| 18 #include "net/url_request/url_request_throttler_entry_interface.h" | 18 #include "net/url_request/url_request_throttler_entry_interface.h" |
| 19 | 19 |
| 20 namespace net { | 20 namespace net { |
| 21 | 21 |
| 22 class NetworkDelegate; | |
| 23 class URLRequestThrottlerManager; | 22 class URLRequestThrottlerManager; |
| 24 | 23 |
| 25 // URLRequestThrottlerEntry represents an entry of URLRequestThrottlerManager. | 24 // URLRequestThrottlerEntry represents an entry of URLRequestThrottlerManager. |
| 26 // It analyzes requests of a specific URL over some period of time, in order to | 25 // It analyzes requests of a specific URL over some period of time, in order to |
| 27 // deduce the back-off time for every request. | 26 // deduce the back-off time for every request. |
| 28 // The back-off algorithm consists of two parts. Firstly, exponential back-off | 27 // The back-off algorithm consists of two parts. Firstly, exponential back-off |
| 29 // is used when receiving 5XX server errors or malformed response bodies. | 28 // is used when receiving 5XX server errors or malformed response bodies. |
| 30 // The exponential back-off rule is enforced by URLRequestHttpJob. Any | 29 // The exponential back-off rule is enforced by URLRequestHttpJob. Any |
| 31 // request sent during the back-off period will be cancelled. | 30 // request sent during the back-off period will be cancelled. |
| 32 // Secondly, a sliding window is used to count recent requests to a given | 31 // Secondly, a sliding window is used to count recent requests to a given |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 std::string url_id_; | 150 std::string url_id_; |
| 152 | 151 |
| 153 NetLogWithSource net_log_; | 152 NetLogWithSource net_log_; |
| 154 | 153 |
| 155 DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerEntry); | 154 DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerEntry); |
| 156 }; | 155 }; |
| 157 | 156 |
| 158 } // namespace net | 157 } // namespace net |
| 159 | 158 |
| 160 #endif // NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_H_ | 159 #endif // NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_H_ |
| OLD | NEW |