OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_MESSAGE_LOOP_PROXY_IMPL_H_ | 5 #ifndef BASE_MESSAGE_LOOP_PROXY_IMPL_H_ |
6 #define BASE_MESSAGE_LOOP_PROXY_IMPL_H_ | 6 #define BASE_MESSAGE_LOOP_PROXY_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/base_export.h" | 9 #include "base/base_export.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/message_loop_proxy.h" | 11 #include "base/message_loop_proxy.h" |
12 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 | 15 |
16 // A stock implementation of MessageLoopProxy that is created and managed by a | 16 // A stock implementation of MessageLoopProxy that is created and managed by a |
17 // MessageLoop. For now a MessageLoopProxyImpl can only be created as part of a | 17 // MessageLoop. For now a MessageLoopProxyImpl can only be created as part of a |
18 // MessageLoop. | 18 // MessageLoop. |
19 class BASE_EXPORT MessageLoopProxyImpl : public MessageLoopProxy { | 19 class BASE_EXPORT MessageLoopProxyImpl : public MessageLoopProxy { |
20 public: | 20 public: |
21 // MessageLoopProxy implementation | 21 // MessageLoopProxy implementation |
22 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, | 22 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, |
23 const base::Closure& task, | 23 const base::Closure& task, |
| 24 int64 delay_ms) OVERRIDE; |
| 25 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, |
| 26 const base::Closure& task, |
24 base::TimeDelta delay) OVERRIDE; | 27 base::TimeDelta delay) OVERRIDE; |
25 virtual bool PostNonNestableDelayedTask( | 28 virtual bool PostNonNestableDelayedTask( |
26 const tracked_objects::Location& from_here, | 29 const tracked_objects::Location& from_here, |
27 const base::Closure& task, | 30 const base::Closure& task, |
| 31 int64 delay_ms) OVERRIDE; |
| 32 virtual bool PostNonNestableDelayedTask( |
| 33 const tracked_objects::Location& from_here, |
| 34 const base::Closure& task, |
28 base::TimeDelta delay) OVERRIDE; | 35 base::TimeDelta delay) OVERRIDE; |
29 virtual bool RunsTasksOnCurrentThread() const OVERRIDE; | 36 virtual bool RunsTasksOnCurrentThread() const OVERRIDE; |
30 | 37 |
31 protected: | 38 protected: |
32 virtual ~MessageLoopProxyImpl(); | 39 virtual ~MessageLoopProxyImpl(); |
33 | 40 |
34 // Override OnDestruct so that we can delete the object on the target message | 41 // Override OnDestruct so that we can delete the object on the target message |
35 // loop if it still exists. | 42 // loop if it still exists. |
36 virtual void OnDestruct() const OVERRIDE; | 43 virtual void OnDestruct() const OVERRIDE; |
37 | 44 |
(...skipping 16 matching lines...) Expand all Loading... |
54 // The lock that protects access to target_message_loop_. | 61 // The lock that protects access to target_message_loop_. |
55 mutable base::Lock message_loop_lock_; | 62 mutable base::Lock message_loop_lock_; |
56 MessageLoop* target_message_loop_; | 63 MessageLoop* target_message_loop_; |
57 | 64 |
58 DISALLOW_COPY_AND_ASSIGN(MessageLoopProxyImpl); | 65 DISALLOW_COPY_AND_ASSIGN(MessageLoopProxyImpl); |
59 }; | 66 }; |
60 | 67 |
61 } // namespace base | 68 } // namespace base |
62 | 69 |
63 #endif // BASE_MESSAGE_LOOP_PROXY_IMPL_H_ | 70 #endif // BASE_MESSAGE_LOOP_PROXY_IMPL_H_ |
OLD | NEW |