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

Unified Diff: remoting/protocol/audio_reader.cc

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.h ('k') | remoting/protocol/audio_writer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/audio_reader.cc
diff --git a/remoting/protocol/audio_reader.cc b/remoting/protocol/audio_reader.cc
index 4269176f1db9baa0a83dcd598928abe7cf197995..9723201ec72afb8e1775d57a271107ee7eaf98f2 100644
--- a/remoting/protocol/audio_reader.cc
+++ b/remoting/protocol/audio_reader.cc
@@ -14,14 +14,12 @@ namespace remoting {
namespace protocol {
AudioReader::AudioReader(AudioPacket::Encoding encoding)
- : session_(NULL),
+ : ChannelDispatcherBase(kAudioChannelName),
encoding_(encoding),
audio_stub_(NULL) {
}
AudioReader::~AudioReader() {
- if (session_)
- session_->CancelChannelCreation(kAudioChannelName);
}
// static
@@ -32,33 +30,9 @@ scoped_ptr<AudioReader> AudioReader::Create(const SessionConfig& config) {
return scoped_ptr<AudioReader>(new AudioReader(AudioPacket::ENCODING_RAW));
}
-void AudioReader::Init(protocol::Session* session,
- AudioStub* audio_stub,
- const InitializedCallback& callback) {
- session_ = session;
- initialized_callback_ = callback;
- audio_stub_ = audio_stub;
-
- session_->CreateStreamChannel(
- kAudioChannelName,
- base::Bind(&AudioReader::OnChannelReady, base::Unretained(this)));
-}
-
-bool AudioReader::is_connected() {
- return channel_.get() != NULL;
-}
-
-void AudioReader::OnChannelReady(scoped_ptr<net::StreamSocket> socket) {
- if (!socket.get()) {
- initialized_callback_.Run(false);
- return;
- }
-
- DCHECK(!channel_.get());
- channel_ = socket.Pass();
- reader_.Init(channel_.get(), base::Bind(&AudioReader::OnNewData,
- base::Unretained(this)));
- initialized_callback_.Run(true);
+void AudioReader::OnInitialized() {
+ reader_.Init(channel(), base::Bind(&AudioReader::OnNewData,
+ base::Unretained(this)));
}
void AudioReader::OnNewData(scoped_ptr<AudioPacket> packet,
« no previous file with comments | « remoting/protocol/audio_reader.h ('k') | remoting/protocol/audio_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698