OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/lock.h" | 9 #include "base/lock.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, | 26 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, |
27 Task* task, int64 delay_ms); | 27 Task* task, int64 delay_ms); |
28 virtual bool PostNonNestableTask(const tracked_objects::Location& from_here, | 28 virtual bool PostNonNestableTask(const tracked_objects::Location& from_here, |
29 Task* task); | 29 Task* task); |
30 virtual bool PostNonNestableDelayedTask( | 30 virtual bool PostNonNestableDelayedTask( |
31 const tracked_objects::Location& from_here, | 31 const tracked_objects::Location& from_here, |
32 Task* task, | 32 Task* task, |
33 int64 delay_ms); | 33 int64 delay_ms); |
34 virtual bool BelongsToCurrentThread(); | 34 virtual bool BelongsToCurrentThread(); |
35 | 35 |
36 // MessageLoop::DestructionObserver implementation | 36 // MessageLoop::DestructionObserver implementation |
37 void WillDestroyCurrentMessageLoop(); | 37 virtual void WillDestroyCurrentMessageLoop(); |
38 | 38 |
39 protected: | 39 protected: |
40 // Override OnDestruct so that we can delete the object on the target message | 40 // Override OnDestruct so that we can delete the object on the target message |
41 // loop if it still exists. | 41 // loop if it still exists. |
42 virtual void OnDestruct() const; | 42 virtual void OnDestruct() const; |
43 | 43 |
44 private: | 44 private: |
45 MessageLoopProxyImpl(); | 45 MessageLoopProxyImpl(); |
46 bool PostTaskHelper(const tracked_objects::Location& from_here, | 46 bool PostTaskHelper(const tracked_objects::Location& from_here, |
47 Task* task, int64 delay_ms, bool nestable); | 47 Task* task, int64 delay_ms, bool nestable); |
48 | 48 |
49 // For the factory method to work | 49 // For the factory method to work |
50 friend class MessageLoopProxy; | 50 friend class MessageLoopProxy; |
51 | 51 |
52 // The lock that protects access to target_message_loop_. | 52 // The lock that protects access to target_message_loop_. |
53 mutable Lock message_loop_lock_; | 53 mutable Lock message_loop_lock_; |
54 MessageLoop* target_message_loop_; | 54 MessageLoop* target_message_loop_; |
55 | 55 |
56 DISALLOW_COPY_AND_ASSIGN(MessageLoopProxyImpl); | 56 DISALLOW_COPY_AND_ASSIGN(MessageLoopProxyImpl); |
57 }; | 57 }; |
58 | 58 |
59 } // namespace base | 59 } // namespace base |
60 | 60 |
61 #endif // BASE_MESSAGE_LOOP_PROXY_IMPL_H_ | 61 #endif // BASE_MESSAGE_LOOP_PROXY_IMPL_H_ |
62 | 62 |
OLD | NEW |