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