summaryrefslogtreecommitdiffstats
path: root/components/scheduler/child/scheduler_message_loop_delegate.cc
blob: ba0d6b404e3dd3d5f7555e22b559e71046a7e658 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/scheduler/child/scheduler_message_loop_delegate.h"

namespace scheduler {

// static
scoped_refptr<SchedulerMessageLoopDelegate>
SchedulerMessageLoopDelegate::Create(base::MessageLoop* message_loop) {
  return make_scoped_refptr(new SchedulerMessageLoopDelegate(message_loop));
}

SchedulerMessageLoopDelegate::SchedulerMessageLoopDelegate(
    base::MessageLoop* message_loop)
    : message_loop_(message_loop) {
}

SchedulerMessageLoopDelegate::~SchedulerMessageLoopDelegate() {
}

bool SchedulerMessageLoopDelegate::PostDelayedTask(
    const tracked_objects::Location& from_here,
    const base::Closure& task,
    base::TimeDelta delay) {
  return message_loop_->task_runner()->PostDelayedTask(from_here, task, delay);
}

bool SchedulerMessageLoopDelegate::PostNonNestableDelayedTask(
    const tracked_objects::Location& from_here,
    const base::Closure& task,
    base::TimeDelta delay) {
  return message_loop_->task_runner()->PostNonNestableDelayedTask(from_here,
                                                                  task, delay);
}

bool SchedulerMessageLoopDelegate::RunsTasksOnCurrentThread() const {
  return message_loop_->task_runner()->RunsTasksOnCurrentThread();
}

bool SchedulerMessageLoopDelegate::IsNested() const {
  return message_loop_->IsNested();
}

void SchedulerMessageLoopDelegate::AddTaskObserver(
    base::MessageLoop::TaskObserver* task_observer) {
  return message_loop_->AddTaskObserver(task_observer);
}

void SchedulerMessageLoopDelegate::RemoveTaskObserver(
    base::MessageLoop::TaskObserver* task_observer) {
  return message_loop_->RemoveTaskObserver(task_observer);
}

}  // namespace scheduler