diff options
author | ttuttle <ttuttle@chromium.org> | 2014-11-07 13:34:23 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-07 21:34:46 +0000 |
commit | dd6819b1522473ae11b98cb60b8b613af01f4b56 (patch) | |
tree | 03f2118f154726254a2caf1d0b18f9d2e9b01a2d /components/domain_reliability/util.h | |
parent | b239b09167bc7b53f4c0ff46bd10b3c057d569c4 (diff) | |
download | chromium_src-dd6819b1522473ae11b98cb60b8b613af01f4b56.zip chromium_src-dd6819b1522473ae11b98cb60b8b613af01f4b56.tar.gz chromium_src-dd6819b1522473ae11b98cb60b8b613af01f4b56.tar.bz2 |
Domain Reliability: Switch to BackoffEntry in Scheduler
Previously, Domain Reliability was using homegrown backoff handling code.
Switch to using the existing BackoffEntry.
BUG=
Review URL: https://codereview.chromium.org/704893002
Cr-Commit-Position: refs/heads/master@{#303296}
Diffstat (limited to 'components/domain_reliability/util.h')
-rw-r--r-- | components/domain_reliability/util.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/components/domain_reliability/util.h b/components/domain_reliability/util.h index 80699d4..56ca229 100644 --- a/components/domain_reliability/util.h +++ b/components/domain_reliability/util.h @@ -13,6 +13,7 @@ #include "base/time/time.h" #include "base/tracked_objects.h" #include "components/domain_reliability/domain_reliability_export.h" +#include "net/base/backoff_entry.h" #include "net/http/http_response_info.h" namespace domain_reliability { @@ -82,6 +83,21 @@ class DOMAIN_RELIABILITY_EXPORT ActualTime : public MockableTime { scoped_ptr<MockableTime::Timer> CreateTimer() override; }; +// A subclass of BackoffEntry that uses a MockableTime to keep track of time. +class MockableTimeBackoffEntry : public net::BackoffEntry { + public: + MockableTimeBackoffEntry(const net::BackoffEntry::Policy* const policy, + MockableTime* time); + + virtual ~MockableTimeBackoffEntry(); + + protected: + virtual base::TimeTicks ImplGetTimeNow() const override; + + private: + MockableTime* time_; +}; + } // namespace domain_reliability #endif // COMPONENTS_DOMAIN_RELIABILITY_UTIL_H_ |