| 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 <queue> | 8 #include <queue> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 // Causes this entry to never reject requests due to back-off. | 89 // Causes this entry to never reject requests due to back-off. |
| 90 void DisableBackoffThrottling(); | 90 void DisableBackoffThrottling(); |
| 91 | 91 |
| 92 // Causes this entry to NULL its manager pointer. | 92 // Causes this entry to NULL its manager pointer. |
| 93 void DetachManager(); | 93 void DetachManager(); |
| 94 | 94 |
| 95 // Implementation of URLRequestThrottlerEntryInterface. | 95 // Implementation of URLRequestThrottlerEntryInterface. |
| 96 virtual bool ShouldRejectRequest( | 96 virtual bool ShouldRejectRequest( |
| 97 const URLRequest& request, | 97 const URLRequest& request, |
| 98 NetworkDelegate* network_delegate) const OVERRIDE; | 98 NetworkDelegate* network_delegate) const override; |
| 99 virtual int64 ReserveSendingTimeForNextRequest( | 99 virtual int64 ReserveSendingTimeForNextRequest( |
| 100 const base::TimeTicks& earliest_time) OVERRIDE; | 100 const base::TimeTicks& earliest_time) override; |
| 101 virtual base::TimeTicks GetExponentialBackoffReleaseTime() const OVERRIDE; | 101 virtual base::TimeTicks GetExponentialBackoffReleaseTime() const override; |
| 102 virtual void UpdateWithResponse( | 102 virtual void UpdateWithResponse( |
| 103 const std::string& host, | 103 const std::string& host, |
| 104 const URLRequestThrottlerHeaderInterface* response) OVERRIDE; | 104 const URLRequestThrottlerHeaderInterface* response) override; |
| 105 virtual void ReceivedContentWasMalformed(int response_code) OVERRIDE; | 105 virtual void ReceivedContentWasMalformed(int response_code) override; |
| 106 | 106 |
| 107 protected: | 107 protected: |
| 108 virtual ~URLRequestThrottlerEntry(); | 108 virtual ~URLRequestThrottlerEntry(); |
| 109 | 109 |
| 110 void Initialize(); | 110 void Initialize(); |
| 111 | 111 |
| 112 // Returns true if the given response code is considered an error for | 112 // Returns true if the given response code is considered an error for |
| 113 // throttling purposes. | 113 // throttling purposes. |
| 114 bool IsConsideredError(int response_code); | 114 bool IsConsideredError(int response_code); |
| 115 | 115 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 std::string url_id_; | 169 std::string url_id_; |
| 170 | 170 |
| 171 BoundNetLog net_log_; | 171 BoundNetLog net_log_; |
| 172 | 172 |
| 173 DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerEntry); | 173 DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerEntry); |
| 174 }; | 174 }; |
| 175 | 175 |
| 176 } // namespace net | 176 } // namespace net |
| 177 | 177 |
| 178 #endif // NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_H_ | 178 #endif // NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_H_ |
| OLD | NEW |