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

Side by Side Diff: base/single_thread_task_runner.h

Issue 9169037: Make new TaskRunner, SequencedTaskRunner, and SingleThreadTaskRunner interfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to head Created 8 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 | Annotate | Revision Log
« no previous file with comments | « base/sequenced_task_runner_helpers.h ('k') | base/task_runner.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef BASE_SINGLE_THREAD_TASK_RUNNER_H_
6 #define BASE_SINGLE_THREAD_TASK_RUNNER_H_
7 #pragma once
8
9 #include "base/base_export.h"
10 #include "base/sequenced_task_runner.h"
11
12 namespace base {
13
14 // A SingleThreadTaskRunner is a SequencedTaskRunner with one more
15 // guarantee; namely, that all tasks are run on a single dedicated
16 // thread. Most use cases require only a SequencedTaskRunner, unless
17 // there is a specific need to run tasks on only a single dedicated.
18 //
19 // Some theoretical implementations of SingleThreadTaskRunner:
20 //
21 // - A SingleThreadTaskRunner that uses a single worker thread to
22 // run posted tasks (i.e., a message loop).
23 //
24 // - A SingleThreadTaskRunner that stores the list of posted tasks
25 // and has a method Run() that runs each runnable task in FIFO
26 // order that must be run only from the thread the
27 // SingleThreadTaskRunner was created on.
28 class BASE_EXPORT SingleThreadTaskRunner : public SequencedTaskRunner {
29 public:
30 // A more explicit alias to RunsTasksOnCurrentThread().
31 bool BelongsToCurrentThread() const {
32 return RunsTasksOnCurrentThread();
33 }
34 };
35
36 } // namespace base
37
38 #endif // BASE_SERIAL_TASK_RUNNER_H_
OLDNEW
« no previous file with comments | « base/sequenced_task_runner_helpers.h ('k') | base/task_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698