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

Unified Diff: net/base/backoff_entry.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: Respond to review comments. Created 9 years, 7 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/base/backoff_entry.h
diff --git a/net/base/backoff_entry.h b/net/base/backoff_entry.h
index 1a7d2dcde0b743cc2a35e37b50036c3eafb7f1f5..f08564b65be072aaa6710ffe2d902ac418a54e5b 100644
--- a/net/base/backoff_entry.h
+++ b/net/base/backoff_entry.h
@@ -69,10 +69,15 @@ class NET_TEST BackoffEntry : NON_EXPORTED_BASE(public base::NonThreadSafe) {
// had for Policy::entry_lifetime_ms_.
bool CanDiscard() const;
+ // Resets this entry to a fresh (as if just constructed) state.
+ void Reset();
+
+ // Returns the failure count for this entry.
+ int failure_count() const;
wtc 2011/05/25 23:12:06 Nit: define this getter inline?
Jói 2011/05/26 14:53:42 Done.
+
protected:
// Equivalent to TimeTicks::Now(), virtual so unit tests can override.
- // TODO(joi): Switch to constructor-time dependency injection?
- virtual base::TimeTicks GetTimeNow() const;
+ virtual base::TimeTicks ImplGetTimeNow() const;
wtc 2011/05/25 23:12:06 Nit: we usually put "Impl" at the end, so "GetTime
Jói 2011/05/26 14:53:42 I've been using Impl at the front for methods inte
private:
// Calculates when requests should again be allowed through.

Powered by Google App Engine
This is Rietveld 408576698