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

Side by Side Diff: chrome/renderer/net/mockable_one_shot_timer.cc

Issue 136203009: Support auto-reload on errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Add UMA Created 6 years, 10 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
(Empty)
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
3 // found in the LICENSE file.
4 // MockableOneShotTimer implementation in terms of base::OneShotTimer
mmenke 2014/02/14 17:56:10 nit: Comments like this should generally go above
Elly Fong-Jones 2014/02/25 19:19:52 Done.
5
6 #include "chrome/renderer/net/mockable_one_shot_timer.h"
7
8 MockableOneShotTimer::MockableOneShotTimer() {}
9 MockableOneShotTimer::~MockableOneShotTimer() {}
10
11 void MockableOneShotTimer::Fired() {
12 task_.Run();
13 }
14
15 void MockableOneShotTimer::Start(
16 const tracked_objects::Location& posted_from, base::TimeDelta delay,
17 const base::Closure& task) {
18 DCHECK(!task.is_null());
19 task_ = task;
20 timer_.Start(posted_from, delay,
21 base::Bind(&MockableOneShotTimer::Fired,
22 base::Unretained(this)));
mmenke 2014/02/14 17:56:10 nit: Think you can merge these two lines.
Elly Fong-Jones 2014/02/25 19:19:52 Done.
23 }
24
25 void MockableOneShotTimer::Stop() {
26 timer_.Stop();
27 }
28
29 bool MockableOneShotTimer::IsRunning() const {
30 return timer_.IsRunning();
31 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698