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

Side by Side Diff: base/message_loop/message_loop_proxy_impl.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_proxy.cc ('k') | base/message_loop/message_loop_proxy_impl.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_IMPL_H_
6 #define BASE_MESSAGE_LOOP_MESSAGE_LOOP_PROXY_IMPL_H_
7
8 #include "base/base_export.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/message_loop/message_loop_proxy.h"
11 #include "base/pending_task.h"
12 #include "base/synchronization/lock.h"
13 #include "base/threading/platform_thread.h"
14
15 namespace base {
16 namespace internal {
17
18 class IncomingTaskQueue;
19
20 // A stock implementation of MessageLoopProxy that is created and managed by a
21 // MessageLoop. For now a MessageLoopProxyImpl can only be created as part of a
22 // MessageLoop.
23 class BASE_EXPORT MessageLoopProxyImpl : public MessageLoopProxy {
24 public:
25 explicit MessageLoopProxyImpl(
26 scoped_refptr<IncomingTaskQueue> incoming_queue);
27
28 // Initialize this message loop proxy on the current thread.
29 void BindToCurrentThread();
30
31 // MessageLoopProxy implementation
32 bool PostDelayedTask(const tracked_objects::Location& from_here,
33 const base::Closure& task,
34 base::TimeDelta delay) override;
35 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
36 const base::Closure& task,
37 base::TimeDelta delay) override;
38 bool RunsTasksOnCurrentThread() const override;
39
40 private:
41 friend class RefCountedThreadSafe<MessageLoopProxyImpl>;
42 ~MessageLoopProxyImpl() override;
43
44 // THe incoming queue receiving all posted tasks.
45 scoped_refptr<IncomingTaskQueue> incoming_queue_;
46
47 // ID of the thread |this| was created on. Could be accessed on multiple
48 // threads, protected by |valid_thread_id_lock_|.
49 PlatformThreadId valid_thread_id_;
50 mutable Lock valid_thread_id_lock_;
51
52 DISALLOW_COPY_AND_ASSIGN(MessageLoopProxyImpl);
53 };
54
55 } // namespace internal
56 } // namespace base
57
58 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_PROXY_IMPL_H_
OLDNEW
« no previous file with comments | « base/message_loop/message_loop_proxy.cc ('k') | base/message_loop/message_loop_proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698