| 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 REMOTING_BASE_PLUGIN_MESSAGE_LOOP_H_ | 5 #ifndef REMOTING_BASE_PLUGIN_MESSAGE_LOOP_H_ |
| 6 #define REMOTING_BASE_PLUGIN_MESSAGE_LOOP_H_ | 6 #define REMOTING_BASE_PLUGIN_MESSAGE_LOOP_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 // Caller keeps ownership of delegate. | 28 // Caller keeps ownership of delegate. |
| 29 PluginMessageLoopProxy(Delegate* delegate); | 29 PluginMessageLoopProxy(Delegate* delegate); |
| 30 | 30 |
| 31 void Detach(); | 31 void Detach(); |
| 32 | 32 |
| 33 // base::MessageLoopProxy implementation. | 33 // base::MessageLoopProxy implementation. |
| 34 virtual bool PostDelayedTask( | 34 virtual bool PostDelayedTask( |
| 35 const tracked_objects::Location& from_here, | 35 const tracked_objects::Location& from_here, |
| 36 const base::Closure& task, | 36 const base::Closure& task, |
| 37 int64 delay_ms) OVERRIDE; | |
| 38 virtual bool PostDelayedTask( | |
| 39 const tracked_objects::Location& from_here, | |
| 40 const base::Closure& task, | |
| 41 base::TimeDelta delay) OVERRIDE; | 37 base::TimeDelta delay) OVERRIDE; |
| 42 virtual bool PostNonNestableDelayedTask( | 38 virtual bool PostNonNestableDelayedTask( |
| 43 const tracked_objects::Location& from_here, | 39 const tracked_objects::Location& from_here, |
| 44 const base::Closure& task, | 40 const base::Closure& task, |
| 45 int64 delay_ms) OVERRIDE; | |
| 46 virtual bool PostNonNestableDelayedTask( | |
| 47 const tracked_objects::Location& from_here, | |
| 48 const base::Closure& task, | |
| 49 base::TimeDelta delay) OVERRIDE; | 41 base::TimeDelta delay) OVERRIDE; |
| 50 | 42 |
| 51 virtual bool RunsTasksOnCurrentThread() const OVERRIDE; | 43 virtual bool RunsTasksOnCurrentThread() const OVERRIDE; |
| 52 | 44 |
| 53 protected: | 45 protected: |
| 54 virtual ~PluginMessageLoopProxy(); | 46 virtual ~PluginMessageLoopProxy(); |
| 55 | 47 |
| 56 private: | 48 private: |
| 57 static void TaskSpringboard(void* data); | 49 static void TaskSpringboard(void* data); |
| 58 | 50 |
| 59 void RunClosureIf(const base::Closure& task); | 51 void RunClosureIf(const base::Closure& task); |
| 60 | 52 |
| 61 base::PlatformThreadId plugin_thread_id_; | 53 base::PlatformThreadId plugin_thread_id_; |
| 62 | 54 |
| 63 // |lock_| must be acquired when accessing |delegate_|. | 55 // |lock_| must be acquired when accessing |delegate_|. |
| 64 base::Lock lock_; | 56 base::Lock lock_; |
| 65 Delegate* delegate_; | 57 Delegate* delegate_; |
| 66 | 58 |
| 67 DISALLOW_COPY_AND_ASSIGN(PluginMessageLoopProxy); | 59 DISALLOW_COPY_AND_ASSIGN(PluginMessageLoopProxy); |
| 68 }; | 60 }; |
| 69 | 61 |
| 70 } // namespace remoting | 62 } // namespace remoting |
| 71 | 63 |
| 72 #endif // REMOTING_BASE_PLUGIN_MESSAGE_LOOP_H_ | 64 #endif // REMOTING_BASE_PLUGIN_MESSAGE_LOOP_H_ |
| OLD | NEW |