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

Side by Side Diff: components/domain_reliability/util.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "components/domain_reliability/util.h" 5 #include "components/domain_reliability/util.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 ActualTime::ActualTime() {} 189 ActualTime::ActualTime() {}
190 ActualTime::~ActualTime() {} 190 ActualTime::~ActualTime() {}
191 191
192 base::Time ActualTime::Now() { return base::Time::Now(); } 192 base::Time ActualTime::Now() { return base::Time::Now(); }
193 base::TimeTicks ActualTime::NowTicks() { return base::TimeTicks::Now(); } 193 base::TimeTicks ActualTime::NowTicks() { return base::TimeTicks::Now(); }
194 194
195 scoped_ptr<MockableTime::Timer> ActualTime::CreateTimer() { 195 scoped_ptr<MockableTime::Timer> ActualTime::CreateTimer() {
196 return scoped_ptr<MockableTime::Timer>(new ActualTimer()); 196 return scoped_ptr<MockableTime::Timer>(new ActualTimer());
197 } 197 }
198 198
199 MockableTimeBackoffEntry::MockableTimeBackoffEntry(
200 const net::BackoffEntry::Policy* const policy,
201 MockableTime* time)
202 : net::BackoffEntry(policy),
203 time_(time) {
204 }
205
206 MockableTimeBackoffEntry::~MockableTimeBackoffEntry() {}
207
208 base::TimeTicks MockableTimeBackoffEntry::ImplGetTimeNow() const {
209 return time_->NowTicks();
210 }
211
212 } // namespace domain_reliability 199 } // namespace domain_reliability
OLDNEW
« no previous file with comments | « components/domain_reliability/util.h ('k') | components/password_manager/core/browser/affiliation_fetch_throttler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698