| 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_SCOPED_THREAD_PROXY_H_ | 5 #ifndef REMOTING_BASE_SCOPED_THREAD_PROXY_H_ |
| 6 #define REMOTING_BASE_SCOPED_THREAD_PROXY_H_ | 6 #define REMOTING_BASE_SCOPED_THREAD_PROXY_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // }; | 47 // }; |
| 48 class ScopedThreadProxy { | 48 class ScopedThreadProxy { |
| 49 public: | 49 public: |
| 50 ScopedThreadProxy(base::MessageLoopProxy* message_loop); | 50 ScopedThreadProxy(base::MessageLoopProxy* message_loop); |
| 51 ~ScopedThreadProxy(); | 51 ~ScopedThreadProxy(); |
| 52 | 52 |
| 53 void PostTask(const tracked_objects::Location& from_here, | 53 void PostTask(const tracked_objects::Location& from_here, |
| 54 const base::Closure& closure); | 54 const base::Closure& closure); |
| 55 void PostDelayedTask(const tracked_objects::Location& from_here, | 55 void PostDelayedTask(const tracked_objects::Location& from_here, |
| 56 const base::Closure& closure, | 56 const base::Closure& closure, |
| 57 int64 delay_ms); | 57 base::TimeDelta delay); |
| 58 | 58 |
| 59 // Cancels all tasks posted via this proxy. Must be called on the | 59 // Cancels all tasks posted via this proxy. Must be called on the |
| 60 // thread this object belongs to. | 60 // thread this object belongs to. |
| 61 void Detach(); | 61 void Detach(); |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 class Core; | 64 class Core; |
| 65 | 65 |
| 66 scoped_refptr<Core> core_; | 66 scoped_refptr<Core> core_; |
| 67 | 67 |
| 68 DISALLOW_COPY_AND_ASSIGN(ScopedThreadProxy); | 68 DISALLOW_COPY_AND_ASSIGN(ScopedThreadProxy); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 } // namespace remoting | 71 } // namespace remoting |
| 72 | 72 |
| 73 #endif // REMOTING_BASE_SCOPED_THREAD_PROXY_H_ | 73 #endif // REMOTING_BASE_SCOPED_THREAD_PROXY_H_ |
| OLD | NEW |