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

Side by Side Diff: base/message_loop/message_loop_proxy.h

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 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
« no previous file with comments | « base/message_loop/message_loop.cc ('k') | base/message_loop/message_loop_proxy.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_MESSAGE_LOOP_MESSAGE_LOOP_PROXY_H_
6 #define BASE_MESSAGE_LOOP_MESSAGE_LOOP_PROXY_H_
7
8 #include "base/base_export.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h"
11 #include "base/single_thread_task_runner.h"
12
13 // MessageLoopProxy is deprecated. Code should prefer to depend on TaskRunner
14 // (or the various specializations) for passing task runners around, and should
15 // use ThreadTaskRunnerHandle::Get() to get the thread's associated task runner.
16 //
17 // See http://crbug.com/391045 for more details.
18 // Example for these changes:
19 //
20 // base::MessageLoopProxy::current() -> base::ThreadTaskRunnerHandle::Get()
21 // scoped_refptr<base::MessageLoopProxy> ->
22 // scoped_refptr<base::SingleThreadTaskRunner>
23 // base::MessageLoopProxy -> base::SingleThreadTaskRunner
24
25 namespace base {
26
27 // This class provides a thread-safe refcounted interface to the Post* methods
28 // of a message loop. This class can outlive the target message loop.
29 // MessageLoopProxy objects are constructed automatically for all MessageLoops.
30 // So, to access them, you can use any of the following:
31 // Thread::message_loop_proxy()
32 // MessageLoop::current()->message_loop_proxy()
33 // MessageLoopProxy::current()
34 //
35 // TODO(akalin): Now that we have the *TaskRunner interfaces, we can
36 // merge this with MessageLoopProxyImpl.
37 class BASE_EXPORT MessageLoopProxy : public SingleThreadTaskRunner {
38 public:
39 // Gets the MessageLoopProxy for the current message loop, creating one if
40 // needed.
41 static scoped_refptr<MessageLoopProxy> current();
42
43 protected:
44 MessageLoopProxy();
45 ~MessageLoopProxy() override;
46 };
47
48 } // namespace base
49
50 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_PROXY_H_
OLDNEW
« no previous file with comments | « base/message_loop/message_loop.cc ('k') | base/message_loop/message_loop_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698