Move functions for controlling Caps Lock to CapsLockDelegate from SystemTrayDelegate.
[chromium-blink-merge.git] / base / single_thread_task_runner.h
blob993d82933dc398f50998652d00b6b2f92b2e73b4
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 #ifndef BASE_SINGLE_THREAD_TASK_RUNNER_H_
6 #define BASE_SINGLE_THREAD_TASK_RUNNER_H_
8 #include "base/base_export.h"
9 #include "base/sequenced_task_runner.h"
11 namespace base {
13 // A SingleThreadTaskRunner is a SequencedTaskRunner with one more
14 // guarantee; namely, that all tasks are run on a single dedicated
15 // thread. Most use cases require only a SequencedTaskRunner, unless
16 // there is a specific need to run tasks on only a single dedicated.
18 // Some theoretical implementations of SingleThreadTaskRunner:
20 // - A SingleThreadTaskRunner that uses a single worker thread to
21 // run posted tasks (i.e., a message loop).
23 // - A SingleThreadTaskRunner that stores the list of posted tasks
24 // and has a method Run() that runs each runnable task in FIFO
25 // order that must be run only from the thread the
26 // SingleThreadTaskRunner was created on.
27 class BASE_EXPORT SingleThreadTaskRunner : public SequencedTaskRunner {
28 public:
29 // A more explicit alias to RunsTasksOnCurrentThread().
30 bool BelongsToCurrentThread() const {
31 return RunsTasksOnCurrentThread();
34 protected:
35 virtual ~SingleThreadTaskRunner() {}
38 } // namespace base
40 #endif // BASE_SERIAL_TASK_RUNNER_H_