Chromium Code Reviews| Index: remoting/base/scoped_thread_proxy.h |
| diff --git a/remoting/base/scoped_thread_proxy.h b/remoting/base/scoped_thread_proxy.h |
| index 9e43a15428b1c68ba3ced315bd233e8f233dda49..a955728b7dd107d662c6e42f7e10ac139ee927cb 100644 |
| --- a/remoting/base/scoped_thread_proxy.h |
| +++ b/remoting/base/scoped_thread_proxy.h |
| @@ -5,16 +5,23 @@ |
| #ifndef REMOTING_BASE_SCOPED_THREAD_PROXY_H_ |
| #define REMOTING_BASE_SCOPED_THREAD_PROXY_H_ |
| +#include "base/basictypes.h" |
| #include "base/callback_forward.h" |
| -#include "base/message_loop_proxy.h" |
| +#include "base/memory/ref_counted.h" |
| + |
| +namespace base { |
| +class SingleThreadTaskRunner; |
| +} // namespace base |
| + |
| +namespace tracked_objects { |
| +class Location; |
| +} // namespace tracked_objects |
| namespace remoting { |
| -// ScopedThreadProxy is proxy for message loops that cancels all |
| -// pending tasks when it is destroyed. It can be used to post tasks |
| -// for a non-refcounted object. Must be deleted on the thread it |
| -// belongs to. |
| -// |
| +// ScopedThreadProxy is a task runner proxy that cancels all pending |
|
Wez
2012/05/26 00:18:40
nit: We should consider renaming this ScopedTaskRu
Sergey Ulanov
2012/05/30 01:07:07
Ok, I will hold this CL until you land yours.
Wez
2012/05/30 20:56:45
CL 10454018 has landed; let me know when you're re
|
| +// tasks when it is destroyed. It can be used to post tasks for a |
| +// non-refcounted object. Must be deleted on the thread it belongs to. |
| // |
| // The main difference from WeakPtr<> is that this class can be used safely to |
| // post tasks from different threads. |
| @@ -31,7 +38,7 @@ namespace remoting { |
| // class MyClass { |
| // public: |
| // MyClass() |
| -// : thread_proxy_(base::MessageLoopProxy::current()) {} |
| +// : thread_proxy_(base::ThreadTaskRunnerHandle::Get()) {} |
|
Wez
2012/05/26 00:18:40
Where are you getting ThreadTaskRunnerHandle from?
Sergey Ulanov
2012/05/30 01:07:07
This is a comment, so I don't need an include for
|
| // |
| // // Always called on the thread on which this object was created. |
| // void NonThreadSafeMethod() {} |
| @@ -47,7 +54,7 @@ namespace remoting { |
| // }; |
| class ScopedThreadProxy { |
| public: |
| - ScopedThreadProxy(base::MessageLoopProxy* message_loop); |
| + ScopedThreadProxy(base::SingleThreadTaskRunner* task_runner); |
| ~ScopedThreadProxy(); |
| void PostTask(const tracked_objects::Location& from_here, |