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

Unified Diff: components/password_manager/core/browser/affiliation_fetch_throttler.cc

Issue 1076853003: Refactor net::BackoffEntry to not require subclassing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address pneubeck's review 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 | « components/domain_reliability/util.cc ('k') | google_apis/gcm/engine/connection_factory_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/password_manager/core/browser/affiliation_fetch_throttler.cc
diff --git a/components/password_manager/core/browser/affiliation_fetch_throttler.cc b/components/password_manager/core/browser/affiliation_fetch_throttler.cc
index 50baaaf828d1c3a7821621228fe14c638feb3bf6..9a52deca4ce4bb5789eb5544ed30fec0e48d7c1f 100644
--- a/components/password_manager/core/browser/affiliation_fetch_throttler.cc
+++ b/components/password_manager/core/browser/affiliation_fetch_throttler.cc
@@ -15,30 +15,6 @@
namespace password_manager {
-namespace {
-
-// Implementation of net::BackoffEntry that allows mocking its tick source.
-class BackoffEntryImpl : public net::BackoffEntry {
- public:
- // |tick_clock| must outlive this instance.
- explicit BackoffEntryImpl(const net::BackoffEntry::Policy* const policy,
- base::TickClock* tick_clock)
- : BackoffEntry(policy), tick_clock_(tick_clock) {}
- ~BackoffEntryImpl() override {}
-
- private:
- // net::BackoffEntry:
- base::TimeTicks ImplGetTimeNow() const override {
- return tick_clock_->NowTicks();
- }
-
- base::TickClock* tick_clock_;
-
- DISALLOW_COPY_AND_ASSIGN(BackoffEntryImpl);
-};
-
-} // namespace
-
// static
const net::BackoffEntry::Policy AffiliationFetchThrottler::kBackoffPolicy = {
// Number of initial errors (in sequence) to ignore before going into
@@ -82,7 +58,7 @@ AffiliationFetchThrottler::AffiliationFetchThrottler(
state_(IDLE),
has_network_connectivity_(false),
is_fetch_scheduled_(false),
- exponential_backoff_(new BackoffEntryImpl(&kBackoffPolicy, tick_clock_)),
+ exponential_backoff_(new net::BackoffEntry(&kBackoffPolicy, tick_clock_)),
weak_ptr_factory_(this) {
DCHECK(delegate);
// Start observing before querying the current connectivity state, so that if
« no previous file with comments | « components/domain_reliability/util.cc ('k') | google_apis/gcm/engine/connection_factory_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698