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

Side by Side Diff: base/thread_main_task_runner.h

Issue 10210008: Make MessageLoopProxy::current() usable on threads that don't have MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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/message_loop_unittest.cc ('k') | base/thread_main_task_runner.cc » ('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_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 SingleThreadTaskRunner 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 interface
18 // that corresponds to the current thread.
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 ThreadMainTaskRunner();
25
26 protected:
27 virtual ~ThreadMainTaskRunner();
28
29 // This method must be called on the thread this object belongs to
30 // before the thread and this object are destroyed.
31 void Detach();
32
33 private:
34 bool detached_;
35 };
36
37 } // namespace base
38
39 #endif // BASE_THREAD_MAIN_TASK_RUNNER_H_
OLDNEW
« no previous file with comments | « base/message_loop_unittest.cc ('k') | base/thread_main_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698