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

Side by Side Diff: base/message_loop_proxy_impl.h

Issue 13333003: Create a new base/message_loop directory and move the message_loop_proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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_proxy.cc ('k') | base/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_PROXY_IMPL_H_
6 #define BASE_MESSAGE_LOOP_PROXY_IMPL_H_
7
8 #include "base/base_export.h"
9 #include "base/message_loop.h"
10 #include "base/message_loop_proxy.h"
11 #include "base/synchronization/lock.h"
12
13 namespace base {
14
15 // A stock implementation of MessageLoopProxy that is created and managed by a
16 // MessageLoop. For now a MessageLoopProxyImpl can only be created as part of a
17 // MessageLoop.
18 class BASE_EXPORT MessageLoopProxyImpl : public MessageLoopProxy {
19 public:
20 // MessageLoopProxy implementation
21 virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
22 const base::Closure& task,
23 base::TimeDelta delay) OVERRIDE;
24 virtual bool PostNonNestableDelayedTask(
25 const tracked_objects::Location& from_here,
26 const base::Closure& task,
27 base::TimeDelta delay) OVERRIDE;
28 virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
29
30 protected:
31 virtual ~MessageLoopProxyImpl();
32
33 // Override OnDestruct so that we can delete the object on the target message
34 // loop if it still exists.
35 virtual void OnDestruct() const OVERRIDE;
36
37 private:
38 // Allow the MessageLoop to create a MessageLoopProxyImpl.
39 friend class ::MessageLoop;
40 friend class DeleteHelper<MessageLoopProxyImpl>;
41
42 MessageLoopProxyImpl();
43
44 // Called directly by MessageLoop::~MessageLoop.
45 virtual void WillDestroyCurrentMessageLoop();
46
47
48 bool PostTaskHelper(const tracked_objects::Location& from_here,
49 const base::Closure& task,
50 base::TimeDelta delay,
51 bool nestable);
52
53 // The lock that protects access to target_message_loop_.
54 mutable base::Lock message_loop_lock_;
55 MessageLoop* target_message_loop_;
56
57 DISALLOW_COPY_AND_ASSIGN(MessageLoopProxyImpl);
58 };
59
60 } // namespace base
61
62 #endif // BASE_MESSAGE_LOOP_PROXY_IMPL_H_
OLDNEW
« no previous file with comments | « base/message_loop_proxy.cc ('k') | base/message_loop_proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698