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

Unified Diff: chrome/browser/net/predictor_unittest.cc

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 3 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: chrome/browser/net/predictor_unittest.cc
diff --git a/chrome/browser/net/predictor_unittest.cc b/chrome/browser/net/predictor_unittest.cc
index 8a2d9d095ced4e1d1a408eb06540607d2aa58ae5..132f95c7677753880da562ba6f357fcce596bde1 100644
--- a/chrome/browser/net/predictor_unittest.cc
+++ b/chrome/browser/net/predictor_unittest.cc
@@ -39,17 +39,16 @@ namespace chrome_browser_net {
class WaitForResolutionHelper;
-typedef base::RepeatingTimer<WaitForResolutionHelper> HelperTimer;
-
class WaitForResolutionHelper {
public:
- WaitForResolutionHelper(Predictor* predictor, const UrlList& hosts,
- HelperTimer* timer, int checks_until_quit)
+ WaitForResolutionHelper(Predictor* predictor,
+ const UrlList& hosts,
+ base::RepeatingTimer* timer,
+ int checks_until_quit)
: predictor_(predictor),
hosts_(hosts),
timer_(timer),
- checks_until_quit_(checks_until_quit) {
- }
+ checks_until_quit_(checks_until_quit) {}
void CheckIfResolutionsDone() {
if (--checks_until_quit_ > 0) {
@@ -70,7 +69,7 @@ class WaitForResolutionHelper {
private:
Predictor* predictor_;
const UrlList hosts_;
- HelperTimer* timer_;
+ base::RepeatingTimer* timer_;
int checks_until_quit_;
};
@@ -102,7 +101,7 @@ class PredictorTest : public testing::Test {
}
void WaitForResolution(Predictor* predictor, const UrlList& hosts) {
- HelperTimer* timer = new HelperTimer();
+ base::RepeatingTimer* timer = new base::RepeatingTimer();
// By default allow the loop to run for a minute -- 600 iterations.
timer->Start(FROM_HERE, TimeDelta::FromMilliseconds(100),
new WaitForResolutionHelper(predictor, hosts, timer, 600),
@@ -112,7 +111,7 @@ class PredictorTest : public testing::Test {
void WaitForResolutionWithLimit(
Predictor* predictor, const UrlList& hosts, int limit) {
- HelperTimer* timer = new HelperTimer();
+ base::RepeatingTimer* timer = new base::RepeatingTimer();
timer->Start(FROM_HERE, TimeDelta::FromMilliseconds(100),
new WaitForResolutionHelper(predictor, hosts, timer, limit),
&WaitForResolutionHelper::CheckIfResolutionsDone);

Powered by Google App Engine
This is Rietveld 408576698