| 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> |
| 9 |
| 8 #include <queue> | 10 #include <queue> |
| 9 #include <string> | 11 #include <string> |
| 10 | 12 |
| 11 #include "base/basictypes.h" | 13 #include "base/macros.h" |
| 12 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 13 #include "net/base/backoff_entry.h" | 15 #include "net/base/backoff_entry.h" |
| 14 #include "net/log/net_log.h" | 16 #include "net/log/net_log.h" |
| 15 #include "net/url_request/url_request_throttler_entry_interface.h" | 17 #include "net/url_request/url_request_throttler_entry_interface.h" |
| 16 | 18 |
| 17 namespace net { | 19 namespace net { |
| 18 | 20 |
| 19 class NetworkDelegate; | 21 class NetworkDelegate; |
| 20 class URLRequestThrottlerManager; | 22 class URLRequestThrottlerManager; |
| 21 | 23 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 bool IsEntryOutdated() const; | 81 bool IsEntryOutdated() const; |
| 80 | 82 |
| 81 // Causes this entry to never reject requests due to back-off. | 83 // Causes this entry to never reject requests due to back-off. |
| 82 void DisableBackoffThrottling(); | 84 void DisableBackoffThrottling(); |
| 83 | 85 |
| 84 // Causes this entry to NULL its manager pointer. | 86 // Causes this entry to NULL its manager pointer. |
| 85 void DetachManager(); | 87 void DetachManager(); |
| 86 | 88 |
| 87 // Implementation of URLRequestThrottlerEntryInterface. | 89 // Implementation of URLRequestThrottlerEntryInterface. |
| 88 bool ShouldRejectRequest(const URLRequest& request) const override; | 90 bool ShouldRejectRequest(const URLRequest& request) const override; |
| 89 int64 ReserveSendingTimeForNextRequest( | 91 int64_t ReserveSendingTimeForNextRequest( |
| 90 const base::TimeTicks& earliest_time) override; | 92 const base::TimeTicks& earliest_time) override; |
| 91 base::TimeTicks GetExponentialBackoffReleaseTime() const override; | 93 base::TimeTicks GetExponentialBackoffReleaseTime() const override; |
| 92 void UpdateWithResponse(int status_code) override; | 94 void UpdateWithResponse(int status_code) override; |
| 93 void ReceivedContentWasMalformed(int response_code) override; | 95 void ReceivedContentWasMalformed(int response_code) override; |
| 94 | 96 |
| 95 protected: | 97 protected: |
| 96 ~URLRequestThrottlerEntry() override; | 98 ~URLRequestThrottlerEntry() override; |
| 97 | 99 |
| 98 void Initialize(); | 100 void Initialize(); |
| 99 | 101 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 std::string url_id_; | 155 std::string url_id_; |
| 154 | 156 |
| 155 BoundNetLog net_log_; | 157 BoundNetLog net_log_; |
| 156 | 158 |
| 157 DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerEntry); | 159 DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerEntry); |
| 158 }; | 160 }; |
| 159 | 161 |
| 160 } // namespace net | 162 } // namespace net |
| 161 | 163 |
| 162 #endif // NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_H_ | 164 #endif // NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_H_ |
| OLD | NEW |