Index: remoting/protocol/audio_writer.h |
diff --git a/remoting/protocol/audio_writer.h b/remoting/protocol/audio_writer.h |
index 34bd8f9ac993986079e5372e751e1f10d188fa78..0ec008e443ab36050494d20552a7e0e84aeadf53 100644 |
--- a/remoting/protocol/audio_writer.h |
+++ b/remoting/protocol/audio_writer.h |
@@ -13,6 +13,7 @@ |
#include "base/memory/scoped_ptr.h" |
#include "remoting/protocol/audio_stub.h" |
#include "remoting/protocol/buffered_socket_writer.h" |
+#include "remoting/protocol/channel_dispatcher_base.h" |
namespace net { |
class StreamSocket; |
@@ -24,42 +25,25 @@ namespace protocol { |
class Session; |
class SessionConfig; |
-class AudioWriter : public AudioStub { |
+class AudioWriter : public ChannelDispatcherBase, |
+ public AudioStub { |
public: |
- virtual ~AudioWriter(); |
- |
- // The callback is called when initialization is finished. The |
- // parameter is set to true on success. |
- typedef base::Callback<void(bool)> InitializedCallback; |
- |
+ // Once AudioWriter is created, the Init() method of ChannelDispatcherBase |
+ // should be used to initialize it for the session. |
static scoped_ptr<AudioWriter> Create(const SessionConfig& config); |
- // Initializes the writer. |
- void Init(Session* session, const InitializedCallback& callback); |
- |
- // Stops writing. Must be called on the network thread before this |
- // object is destroyed. |
- void Close(); |
- |
- // Returns true if the channel is connected. |
- bool is_connected(); |
+ virtual ~AudioWriter(); |
// AudioStub interface. |
virtual void ProcessAudioPacket(scoped_ptr<AudioPacket> packet, |
const base::Closure& done) OVERRIDE; |
+ protected: |
+ virtual void OnInitialized() OVERRIDE; |
+ |
private: |
AudioWriter(); |
- void OnChannelReady(scoped_ptr<net::StreamSocket> socket); |
- |
- Session* session_; |
- |
- InitializedCallback initialized_callback_; |
- |
- // TODO(sergeyu): Remove |channel_| and let |buffered_writer_| own it. |
- scoped_ptr<net::StreamSocket> channel_; |
- |
BufferedSocketWriter buffered_writer_; |
DISALLOW_COPY_AND_ASSIGN(AudioWriter); |