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

Unified Diff: remoting/protocol/audio_reader.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 | « no previous file | remoting/protocol/audio_reader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/audio_reader.h
diff --git a/remoting/protocol/audio_reader.h b/remoting/protocol/audio_reader.h
index 2d708db939f1f89b4abcb4ea389629a6cd95f1f4..fe7b8064cfd252445d58f1bf662d0ff2cf2076bb 100644
--- a/remoting/protocol/audio_reader.h
+++ b/remoting/protocol/audio_reader.h
@@ -10,6 +10,7 @@
#include "remoting/proto/audio.pb.h"
#include "remoting/protocol/audio_stub.h"
#include "remoting/protocol/message_reader.h"
+#include "remoting/protocol/channel_dispatcher_base.h"
namespace net {
class StreamSocket;
@@ -21,38 +22,25 @@ namespace protocol {
class Session;
class SessionConfig;
-class AudioReader {
+class AudioReader : public ChannelDispatcherBase {
public:
- // The callback is called when initialization is finished. The
- // parameter is set to true on success.
- typedef base::Callback<void(bool)> InitializedCallback;
+ static scoped_ptr<AudioReader> Create(const SessionConfig& config);
virtual ~AudioReader();
- static scoped_ptr<AudioReader> Create(const SessionConfig& config);
+ void set_audio_stub(AudioStub* audio_stub) { audio_stub_ = audio_stub; }
- // Initializies the reader.
- void Init(Session* session,
- AudioStub* audio_stub,
- const InitializedCallback& callback);
- bool is_connected();
+ protected:
+ virtual void OnInitialized() OVERRIDE;
private:
explicit AudioReader(AudioPacket::Encoding encoding);
- void OnChannelReady(scoped_ptr<net::StreamSocket> socket);
void OnNewData(scoped_ptr<AudioPacket> packet,
const base::Closure& done_task);
- Session* session_;
-
- InitializedCallback initialized_callback_;
-
AudioPacket::Encoding encoding_;
- // TODO(sergeyu): Remove |channel_| and let |reader_| own it.
- scoped_ptr<net::StreamSocket> channel_;
-
ProtobufMessageReader<AudioPacket> reader_;
// The stub that processes all received packets.
« no previous file with comments | « no previous file | remoting/protocol/audio_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698