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

Unified Diff: remoting/protocol/audio_reader.cc

Issue 841773005: Cleanup channel dispatchers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 c4f036d2a88ea74cacbc6dee137a4cc6968aa652..02f8eb1c3e7e1bc64f43f37c322ddb990ad90c60 100644
--- a/remoting/protocol/audio_reader.cc
+++ b/remoting/protocol/audio_reader.cc
@@ -13,31 +13,15 @@
namespace remoting {
namespace protocol {
-AudioReader::AudioReader(AudioPacket::Encoding encoding)
+AudioReader::AudioReader(AudioStub* audio_stub)
: ChannelDispatcherBase(kAudioChannelName),
- encoding_(encoding),
- audio_stub_(nullptr) {
+ parser_(base::Bind(&AudioStub::ProcessAudioPacket,
+ base::Unretained(audio_stub)),
+ reader()) {
}
AudioReader::~AudioReader() {
}
-// static
-scoped_ptr<AudioReader> AudioReader::Create(const SessionConfig& config) {
- if (!config.is_audio_enabled())
- return nullptr;
- return make_scoped_ptr(new AudioReader(AudioPacket::ENCODING_RAW));
-}
-
-void AudioReader::OnInitialized() {
- reader_.Init(channel(), base::Bind(&AudioReader::OnNewData,
- base::Unretained(this)));
-}
-
-void AudioReader::OnNewData(scoped_ptr<AudioPacket> packet,
- const base::Closure& done_task) {
- audio_stub_->ProcessAudioPacket(packet.Pass(), done_task);
-}
-
} // namespace protocol
} // namespace remoting
« 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