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

Side by Side Diff: net/url_request/url_request_throttler_entry_interface.h

Issue 6966038: Anti-DDoS enhancements: Log to net log, UMA stats, improved policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head. Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // Returns the time after which requests are allowed. 42 // Returns the time after which requests are allowed.
43 virtual base::TimeTicks GetExponentialBackoffReleaseTime() const = 0; 43 virtual base::TimeTicks GetExponentialBackoffReleaseTime() const = 0;
44 44
45 // This method needs to be called each time a response is received. 45 // This method needs to be called each time a response is received.
46 virtual void UpdateWithResponse( 46 virtual void UpdateWithResponse(
47 const std::string& host, 47 const std::string& host,
48 const URLRequestThrottlerHeaderInterface* response) = 0; 48 const URLRequestThrottlerHeaderInterface* response) = 0;
49 49
50 // Lets higher-level modules, that know how to parse particular response 50 // Lets higher-level modules, that know how to parse particular response
51 // bodies, notify of receiving malformed content for the given URL. This will 51 // bodies, notify of receiving malformed content for the given URL. This will
52 // be handled by the throttler as if an HTTP 5xx response had been received to 52 // be handled by the throttler as if an HTTP 503 response had been received to
53 // the request, i.e. it will count as a failure. 53 // the request, i.e. it will count as a failure, unless the HTTP response code
54 virtual void ReceivedContentWasMalformed() = 0; 54 // indicated is already one of those that will be counted as an error.
55 virtual void ReceivedContentWasMalformed(int response_code) = 0;
55 56
56 protected: 57 protected:
57 friend class base::RefCountedThreadSafe<URLRequestThrottlerEntryInterface>; 58 friend class base::RefCountedThreadSafe<URLRequestThrottlerEntryInterface>;
58 virtual ~URLRequestThrottlerEntryInterface() {} 59 virtual ~URLRequestThrottlerEntryInterface() {}
59 60
60 private: 61 private:
61 friend class base::RefCounted<URLRequestThrottlerEntryInterface>; 62 friend class base::RefCounted<URLRequestThrottlerEntryInterface>;
62 DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerEntryInterface); 63 DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerEntryInterface);
63 }; 64 };
64 65
65 } // namespace net 66 } // namespace net
66 67
67 #endif // NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_INTERFACE_H_ 68 #endif // NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_INTERFACE_H_
OLDNEW
« no previous file with comments | « net/url_request/url_request_throttler_entry.cc ('k') | net/url_request/url_request_throttler_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698