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

Unified Diff: net/base/backoff_entry.h

Issue 1023473003: Allow BackoffEntry to be serialized and deserialized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweak comments Created 5 years, 8 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
« no previous file with comments | « no previous file | net/base/backoff_entry.cc » ('j') | net/base/backoff_entry_serializer.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/backoff_entry.h
diff --git a/net/base/backoff_entry.h b/net/base/backoff_entry.h
index dbc7488b7a4bd8005b5d699da8158d3a5459685c..5511d041a70e987b36fa69408b0a8470ee7de44e 100644
--- a/net/base/backoff_entry.h
+++ b/net/base/backoff_entry.h
@@ -22,7 +22,8 @@ namespace net {
// intended for reuse in various networking scenarios.
class NET_EXPORT BackoffEntry : NON_EXPORTED_BASE(public base::NonThreadSafe) {
public:
- // The set of parameters that define a back-off policy.
+ // The set of parameters that define a back-off policy. If you change this,
+ // increment SERIALIZATION_VERSION_NUMBER in backoff_entry_serializer.cc.
struct Policy {
// Number of initial errors (in sequence) to ignore before applying
// exponential back-off rules.
@@ -99,9 +100,15 @@ class NET_EXPORT BackoffEntry : NON_EXPORTED_BASE(public base::NonThreadSafe) {
int failure_count() const { return failure_count_; }
private:
+ friend class BackoffEntrySerializer;
+
// Calculates when requests should again be allowed through.
base::TimeTicks CalculateReleaseTime() const;
+ // Converts time_until_release to a release time, obeying maximum_backoff_ms.
+ base::TimeTicks TimeUntilReleaseToReleaseTime(
+ base::TimeDelta time_until_release) const;
mmenke 2015/05/05 15:47:51 nit: Maybe time_until_release -> backoff (or back
johnme 2015/05/06 12:46:46 Ok, renamed time_until_release to backoff_duration
+
// Equivalent to TimeTicks::Now(), using clock_ if provided.
base::TimeTicks GetTimeTicksNow() const;
« no previous file with comments | « no previous file | net/base/backoff_entry.cc » ('j') | net/base/backoff_entry_serializer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698