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

Unified Diff: remoting/protocol/buffered_socket_writer.h

Issue 8116021: Switch remoting/protocol to new callbacks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 2 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 | « remoting/host/screen_recorder_unittest.cc ('k') | remoting/protocol/buffered_socket_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/buffered_socket_writer.h
diff --git a/remoting/protocol/buffered_socket_writer.h b/remoting/protocol/buffered_socket_writer.h
index ebdc200a1c16019af88d57b81de1de477dc46779..4fd7f792d0232722eb4fd8e9b84b76dc430e61b9 100644
--- a/remoting/protocol/buffered_socket_writer.h
+++ b/remoting/protocol/buffered_socket_writer.h
@@ -7,6 +7,7 @@
#include <list>
+#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/synchronization/lock.h"
#include "net/base/io_buffer.h"
@@ -37,7 +38,7 @@ namespace protocol {
class BufferedSocketWriterBase
: public base::RefCountedThreadSafe<BufferedSocketWriterBase> {
public:
- typedef Callback1<int>::Type WriteFailedCallback;
+ typedef base::Callback<void(int)> WriteFailedCallback;
explicit BufferedSocketWriterBase(base::MessageLoopProxy* message_loop);
virtual ~BufferedSocketWriterBase();
@@ -46,11 +47,12 @@ class BufferedSocketWriterBase
// to access the socket in the future. |callback| will be called after each
// failed write. Caller retains ownership of |socket|.
// TODO(sergeyu): Change it so that it take ownership of |socket|.
- void Init(net::Socket* socket, WriteFailedCallback* callback);
+ void Init(net::Socket* socket, const WriteFailedCallback& callback);
// Puts a new data chunk in the buffer. Returns false and doesn't enqueue
// the data if called before Init(). Can be called on any thread.
- bool Write(scoped_refptr<net::IOBufferWithSize> buffer, Task* done_task);
+ bool Write(scoped_refptr<net::IOBufferWithSize> buffer,
+ const base::Closure& done_task);
// Returns current size of the buffer. Can be called on any thread.
int GetBufferSize();
@@ -95,7 +97,7 @@ class BufferedSocketWriterBase
net::Socket* socket_;
scoped_refptr<base::MessageLoopProxy> message_loop_;
- scoped_ptr<WriteFailedCallback> write_failed_callback_;
+ WriteFailedCallback write_failed_callback_;
bool write_pending_;
« no previous file with comments | « remoting/host/screen_recorder_unittest.cc ('k') | remoting/protocol/buffered_socket_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698