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

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: Fixes 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
5
6 #include "chrome/renderer/net/mockable_one_shot_timer.h"
7
8 MockableOneShotTimer::MockableOneShotTimer() {}
9 MockableOneShotTimer::~MockableOneShotTimer() {}
10
11 void MockableOneShotTimer::Fired() {
12 user_task_.Run();
13 }
14
15 void MockableOneShotTimer::Start(
16 const tracked_objects::Location& posted_from, base::TimeDelta delay,
17 const base::Closure& user_task) {
mmenke 2014/02/05 23:31:43 DCHECK(!user_task.is_empty())? (Or is_null, which
Elly Fong-Jones 2014/02/10 21:42:06 I don't think one can do that.
18 user_task_ = user_task;
19 timer_.Start(posted_from, delay,
20 base::Bind(&MockableOneShotTimer::Fired,
21 base::Unretained(this)));
22 }
23
24 void MockableOneShotTimer::Stop() {
25 timer_.Stop();
26 }
27
28 bool MockableOneShotTimer::IsRunning() const {
29 return timer_.IsRunning();
30 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698