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 EXTENSIONS_BROWSER_EXTENSION_THROTTLE_ENTRY_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_THROTTLE_ENTRY_H_ |
6 #define EXTENSIONS_BROWSER_EXTENSION_THROTTLE_ENTRY_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_THROTTLE_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 "extensions/browser/extension_throttle_entry_interface.h" | 15 #include "extensions/browser/extension_throttle_entry_interface.h" |
14 #include "net/base/backoff_entry.h" | 16 #include "net/base/backoff_entry.h" |
15 #include "net/log/net_log.h" | 17 #include "net/log/net_log.h" |
16 | 18 |
17 namespace extensions { | 19 namespace extensions { |
18 | 20 |
19 class ExtensionThrottleManager; | 21 class ExtensionThrottleManager; |
20 | 22 |
21 // ExtensionThrottleEntry represents an entry of ExtensionThrottleManager. | 23 // ExtensionThrottleEntry represents an entry of ExtensionThrottleManager. |
(...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 ExtensionThrottleEntryInterface. | 89 // Implementation of ExtensionThrottleEntryInterface. |
88 bool ShouldRejectRequest(const net::URLRequest& request) const override; | 90 bool ShouldRejectRequest(const net::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 const std::string& GetURLIdForDebugging() const override; | 96 const std::string& GetURLIdForDebugging() const override; |
95 | 97 |
96 protected: | 98 protected: |
97 ~ExtensionThrottleEntry() override; | 99 ~ExtensionThrottleEntry() override; |
98 | 100 |
99 void Initialize(); | 101 void Initialize(); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 157 |
156 net::BoundNetLog net_log_; | 158 net::BoundNetLog net_log_; |
157 bool ignore_user_gesture_load_flag_for_tests_; | 159 bool ignore_user_gesture_load_flag_for_tests_; |
158 | 160 |
159 DISALLOW_COPY_AND_ASSIGN(ExtensionThrottleEntry); | 161 DISALLOW_COPY_AND_ASSIGN(ExtensionThrottleEntry); |
160 }; | 162 }; |
161 | 163 |
162 } // namespace extensions | 164 } // namespace extensions |
163 | 165 |
164 #endif // EXTENSIONS_BROWSER_EXTENSION_THROTTLE_ENTRY_H_ | 166 #endif // EXTENSIONS_BROWSER_EXTENSION_THROTTLE_ENTRY_H_ |
OLD | NEW |