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_INTERFACE_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_INTERFACE_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_INTERFACE_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_INTERFACE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/time.h" | 11 #include "base/time.h" |
| 12 #include "net/base/net_api.h" |
12 | 13 |
13 namespace net { | 14 namespace net { |
14 | 15 |
15 class URLRequestThrottlerHeaderInterface; | 16 class URLRequestThrottlerHeaderInterface; |
16 | 17 |
17 // Interface provided on entries of the URL request throttler manager. | 18 // Interface provided on entries of the URL request throttler manager. |
18 class URLRequestThrottlerEntryInterface | 19 class NET_API URLRequestThrottlerEntryInterface |
19 : public base::RefCountedThreadSafe<URLRequestThrottlerEntryInterface> { | 20 : public base::RefCountedThreadSafe<URLRequestThrottlerEntryInterface> { |
20 public: | 21 public: |
21 URLRequestThrottlerEntryInterface() {} | 22 URLRequestThrottlerEntryInterface() {} |
22 | 23 |
23 // Returns true when we have encountered server errors and are doing | 24 // Returns true when we have encountered server errors and are doing |
24 // exponential back-off. | 25 // exponential back-off. |
25 // URLRequestHttpJob checks this method prior to every request; it | 26 // URLRequestHttpJob checks this method prior to every request; it |
26 // cancels requests if this method returns true. | 27 // cancels requests if this method returns true. |
27 virtual bool IsDuringExponentialBackoff() const = 0; | 28 virtual bool IsDuringExponentialBackoff() const = 0; |
28 | 29 |
(...skipping 28 matching lines...) Expand all Loading... |
57 virtual ~URLRequestThrottlerEntryInterface() {} | 58 virtual ~URLRequestThrottlerEntryInterface() {} |
58 | 59 |
59 private: | 60 private: |
60 friend class base::RefCounted<URLRequestThrottlerEntryInterface>; | 61 friend class base::RefCounted<URLRequestThrottlerEntryInterface>; |
61 DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerEntryInterface); | 62 DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerEntryInterface); |
62 }; | 63 }; |
63 | 64 |
64 } // namespace net | 65 } // namespace net |
65 | 66 |
66 #endif // NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_INTERFACE_H_ | 67 #endif // NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_INTERFACE_H_ |
OLD | NEW |