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

Unified Diff: net/url_request/url_request_throttler_entry_interface.h

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/url_request/url_request_throttler_entry_interface.h
diff --git a/net/url_request/url_request_throttler_entry_interface.h b/net/url_request/url_request_throttler_entry_interface.h
deleted file mode 100644
index 47f5ea16921bdade9bf0d2f6e6d36e3d3829c9e6..0000000000000000000000000000000000000000
--- a/net/url_request/url_request_throttler_entry_interface.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (c) 2012 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_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_INTERFACE_H_
-#define NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_INTERFACE_H_
-
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/memory/ref_counted.h"
-#include "base/time/time.h"
-#include "net/base/net_export.h"
-
-namespace net {
-
-class NetworkDelegate;
-class URLRequest;
-class URLRequestThrottlerHeaderInterface;
-
-// Interface provided on entries of the URL request throttler manager.
-class NET_EXPORT URLRequestThrottlerEntryInterface
- : public base::RefCountedThreadSafe<URLRequestThrottlerEntryInterface> {
- public:
- URLRequestThrottlerEntryInterface() {}
-
- // Returns true when we have encountered server errors and are doing
- // exponential back-off, unless the request has load flags that mean
- // it is likely to be user-initiated, or the NetworkDelegate returns
- // false for |CanThrottleRequest(request)|.
- //
- // URLRequestHttpJob checks this method prior to every request; it
- // cancels requests if this method returns true.
- virtual bool ShouldRejectRequest(
- const URLRequest& request,
- NetworkDelegate* network_delegate) const = 0;
-
- // Calculates a recommended sending time for the next request and reserves it.
- // The sending time is not earlier than the current exponential back-off
- // release time or |earliest_time|. Moreover, the previous results of
- // the method are taken into account, in order to make sure they are spread
- // properly over time.
- // Returns the recommended delay before sending the next request, in
- // milliseconds. The return value is always positive or 0.
- // Although it is not mandatory, respecting the value returned by this method
- // is helpful to avoid traffic overload.
- virtual int64 ReserveSendingTimeForNextRequest(
- const base::TimeTicks& earliest_time) = 0;
-
- // Returns the time after which requests are allowed.
- virtual base::TimeTicks GetExponentialBackoffReleaseTime() const = 0;
-
- // This method needs to be called each time a response is received.
- virtual void UpdateWithResponse(
- const std::string& host,
- const URLRequestThrottlerHeaderInterface* response) = 0;
-
- // Lets higher-level modules, that know how to parse particular response
- // bodies, notify of receiving malformed content for the given URL. This will
- // be handled by the throttler as if an HTTP 503 response had been received to
- // the request, i.e. it will count as a failure, unless the HTTP response code
- // indicated is already one of those that will be counted as an error.
- virtual void ReceivedContentWasMalformed(int response_code) = 0;
-
- protected:
- friend class base::RefCountedThreadSafe<URLRequestThrottlerEntryInterface>;
- virtual ~URLRequestThrottlerEntryInterface() {}
-
- private:
- friend class base::RefCounted<URLRequestThrottlerEntryInterface>;
- DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerEntryInterface);
-};
-
-} // namespace net
-
-#endif // NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_INTERFACE_H_
« no previous file with comments | « net/url_request/url_request_throttler_entry.cc ('k') | net/url_request/url_request_throttler_header_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698