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

Unified Diff: net/request_throttler/request_throttler_entry_interface.h

Issue 2487001: Request Throttler : Exponential back-off (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Corrected a flaky test due to having 2 implementation of request throttling Created 10 years, 5 months 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 side-by-side diff with in-line comments
Download patch
Index: net/request_throttler/request_throttler_entry_interface.h
===================================================================
--- net/request_throttler/request_throttler_entry_interface.h (revision 0)
+++ net/request_throttler/request_throttler_entry_interface.h (revision 0)
@@ -0,0 +1,33 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_REQUEST_THROTTLER_REQUEST_THROTTLER_ENTRY_INTERFACE_H_
+#define NET_REQUEST_THROTTLER_REQUEST_THROTTLER_ENTRY_INTERFACE_H_
+
+#include "base/basictypes.h"
+#include "base/ref_counted.h"
+
+class RequestThrottlerHeaderInterface;
+
+// Represents an entry of the request throttler manager.
+class RequestThrottlerEntryInterface
+ : public base::RefCounted<RequestThrottlerEntryInterface> {
+ public:
+ RequestThrottlerEntryInterface() {}
+
+ // This method needs to be called prior to every requests; if it returns
+ // false, the calling module must cancel its current request.
+ virtual bool IsRequestAllowed() const = 0;
+
+ // This method needs to be called each time a response is received.
+ virtual void UpdateWithResponse(
+ const RequestThrottlerHeaderInterface* response) = 0;
+ protected:
+ virtual ~RequestThrottlerEntryInterface() {}
+ private:
+ friend class base::RefCounted<RequestThrottlerEntryInterface>;
+ DISALLOW_COPY_AND_ASSIGN(RequestThrottlerEntryInterface);
+};
+
+#endif // NET_REQUEST_THROTTLER_REQUEST_THROTTLER_ENTRY_INTERFACE_H_
« no previous file with comments | « net/request_throttler/request_throttler_entry.cc ('k') | net/request_throttler/request_throttler_header_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698