Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: net/request_throttler/request_throttler_entry_interface.h

Issue 4194001: Implement exponential back-off mechanism and enforce it at the URLRequestHttpJob level. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(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/ref_counted.h"
9 #include "base/time.h"
10
11 class RequestThrottlerHeaderInterface;
12
13 // Represents an entry of the request throttler manager.
14 class RequestThrottlerEntryInterface
15 : public base::RefCountedThreadSafe<RequestThrottlerEntryInterface> {
16 public:
17 RequestThrottlerEntryInterface() {}
18
19 // This method needs to be called prior to every request; 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
27 // This method needs to be called each time when a request is actually sent.
28 virtual void NotifyRequestStart() = 0;
29
30 protected:
31 virtual ~RequestThrottlerEntryInterface() {}
32 private:
33 friend class base::RefCountedThreadSafe<RequestThrottlerEntryInterface>;
34 DISALLOW_COPY_AND_ASSIGN(RequestThrottlerEntryInterface);
35 };
36
37 #endif // NET_REQUEST_THROTTLER_REQUEST_THROTTLER_ENTRY_INTERFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698