diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 05:07:40 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 05:07:40 +0000 |
commit | 9e2a3137641bc104980e13388b6088d3f4a9b52f (patch) | |
tree | 353e7915a047c43b466f2d4de514605a71691b45 /remoting/protocol/buffered_socket_writer.h | |
parent | 7feba7ed4d88f95d041abd6bea7a2ba93d9a9f3a (diff) | |
download | chromium_src-9e2a3137641bc104980e13388b6088d3f4a9b52f.zip chromium_src-9e2a3137641bc104980e13388b6088d3f4a9b52f.tar.gz chromium_src-9e2a3137641bc104980e13388b6088d3f4a9b52f.tar.bz2 |
Switch remoting/protocol to new callbacks
There is still some code that uses old callbacks (particularly unittests) - I will convert them in a separate CL.
BUG=None
TEST=Unittests
Review URL: http://codereview.chromium.org/8116021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104440 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/protocol/buffered_socket_writer.h')
-rw-r--r-- | remoting/protocol/buffered_socket_writer.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/remoting/protocol/buffered_socket_writer.h b/remoting/protocol/buffered_socket_writer.h index ebdc200..4fd7f79 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_; |