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

Unified Diff: remoting/protocol/audio_writer.h

Issue 10823323: Add support for multiplexed channels in remoting::protocol::Session interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/protocol/audio_reader.cc ('k') | remoting/protocol/audio_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « remoting/protocol/audio_reader.cc ('k') | remoting/protocol/audio_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698