OLD | NEW |
---|---|
(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_THREAD_MAIN_TASK_RUNNER_H_ | |
6 #define BASE_THREAD_MAIN_TASK_RUNNER_H_ | |
7 #pragma once | |
8 | |
9 #include "base/base_export.h" | |
10 #include "base/single_thread_task_runner.h" | |
11 | |
12 namespace base { | |
13 | |
14 // ThreadMainTaskRunner is a SignleThreadTaskRunner that is used for | |
15 // the main task runner of a thread. There should never be more than | |
16 // one object implementing this interface per thread. It provides | |
17 // static current() method that returns the instance of this | |
18 // insterface that corresponds to the current thread. | |
Ami GONE FROM CHROMIUM
2012/04/30 23:34:05
typo: "insterface"
Sergey Ulanov
2012/05/01 00:34:54
Done.
| |
19 class BASE_EXPORT ThreadMainTaskRunner : public SingleThreadTaskRunner { | |
20 public: | |
21 // Gets the ThreadMainTaskRunner for the current thread. | |
22 static scoped_refptr<ThreadMainTaskRunner> current(); | |
23 | |
24 // Sets ThreadMainTaskRunner for the current thread. The caller | |
25 // must keep a reference to the task runner and call this method | |
26 // again with new_current=NULL before dropping that reference. | |
27 static void SetCurrent(ThreadMainTaskRunner* new_current); | |
28 | |
29 protected: | |
30 virtual ~ThreadMainTaskRunner() {} | |
31 }; | |
32 | |
33 } // namespace base | |
34 | |
35 #endif // BASE_THREAD_MAIN_TASK_RUNNER_H_ | |
OLD | NEW |