Extensions: Store disable reasons in Sync
[chromium-blink-merge.git] / remoting / base / auto_thread_task_runner.cc
blobf155cbc34607e6f2add5a27180704004af2fcae2
1 // Copyright (c) 2012 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.
5 #include "remoting/base/auto_thread_task_runner.h"
7 #include "base/logging.h"
9 namespace remoting {
11 AutoThreadTaskRunner::AutoThreadTaskRunner(
12 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
13 const base::Closure& stop_task)
14 : stop_task_(stop_task),
15 task_runner_(task_runner) {
16 DCHECK(!stop_task_.is_null());
19 bool AutoThreadTaskRunner::PostDelayedTask(
20 const tracked_objects::Location& from_here,
21 const base::Closure& task,
22 base::TimeDelta delay) {
23 CHECK(task_runner_->PostDelayedTask(from_here, task, delay));
24 return true;
27 bool AutoThreadTaskRunner::PostNonNestableDelayedTask(
28 const tracked_objects::Location& from_here,
29 const base::Closure& task,
30 base::TimeDelta delay) {
31 CHECK(task_runner_->PostNonNestableDelayedTask(from_here, task, delay));
32 return true;
35 bool AutoThreadTaskRunner::RunsTasksOnCurrentThread() const {
36 return task_runner_->RunsTasksOnCurrentThread();
39 AutoThreadTaskRunner::~AutoThreadTaskRunner() {
40 CHECK(task_runner_->PostTask(FROM_HERE, stop_task_));
43 } // namespace remoting