| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_REQUEST_THROTTLER_REQUEST_THROTTLER_ENTRY_INTERFACE_H_ |
| 6 #define NET_REQUEST_THROTTLER_REQUEST_THROTTLER_ENTRY_INTERFACE_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/ref_counted.h" |
| 10 |
| 11 class RequestThrottlerHeaderInterface; |
| 12 |
| 13 // Represents an entry of the request throttler manager. |
| 14 class RequestThrottlerEntryInterface |
| 15 : public base::RefCounted<RequestThrottlerEntryInterface> { |
| 16 public: |
| 17 RequestThrottlerEntryInterface() {} |
| 18 |
| 19 // This method needs to be called prior to every requests; if it returns |
| 20 // false, the calling module must cancel its current request. |
| 21 virtual bool IsRequestAllowed() const = 0; |
| 22 |
| 23 // This method needs to be called each time a response is received. |
| 24 virtual void UpdateWithResponse( |
| 25 const RequestThrottlerHeaderInterface* response) = 0; |
| 26 protected: |
| 27 virtual ~RequestThrottlerEntryInterface() {} |
| 28 private: |
| 29 friend class base::RefCounted<RequestThrottlerEntryInterface>; |
| 30 DISALLOW_COPY_AND_ASSIGN(RequestThrottlerEntryInterface); |
| 31 }; |
| 32 |
| 33 #endif // NET_REQUEST_THROTTLER_REQUEST_THROTTLER_ENTRY_INTERFACE_H_ |
| OLD | NEW |