Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Unified Diff: remoting/base/scoped_thread_proxy.h

Issue 10454018: MessageLoopProxy cleanups in remoting client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/base/scoped_thread_proxy.cc » ('j') | remoting/client/chromoting_client.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « no previous file | remoting/base/scoped_thread_proxy.cc » ('j') | remoting/client/chromoting_client.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698