OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/host/linux/audio_pipe_reader.h" | 5 #include "remoting/host/linux/audio_pipe_reader.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 #include <unistd.h> | 10 #include <unistd.h> |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 DCHECK_LE(last_capture_position_, stream_position_bytes); | 163 DCHECK_LE(last_capture_position_, stream_position_bytes); |
164 | 164 |
165 // Dispatch asynchronous notification to the stream observers. | 165 // Dispatch asynchronous notification to the stream observers. |
166 scoped_refptr<base::RefCountedString> data_ref = | 166 scoped_refptr<base::RefCountedString> data_ref = |
167 base::RefCountedString::TakeString(&data); | 167 base::RefCountedString::TakeString(&data); |
168 observers_->Notify(&StreamObserver::OnDataRead, data_ref); | 168 observers_->Notify(&StreamObserver::OnDataRead, data_ref); |
169 } | 169 } |
170 | 170 |
171 void AudioPipeReader::WaitForPipeReadable() { | 171 void AudioPipeReader::WaitForPipeReadable() { |
172 timer_.Stop(); | 172 timer_.Stop(); |
173 MessageLoopForIO::current()->WatchFileDescriptor( | 173 base::MessageLoopForIO::current()->WatchFileDescriptor( |
174 pipe_fd_, false, MessageLoopForIO::WATCH_READ, | 174 pipe_fd_, |
175 &file_descriptor_watcher_, this); | 175 false, |
| 176 base::MessageLoopForIO::WATCH_READ, |
| 177 &file_descriptor_watcher_, |
| 178 this); |
176 } | 179 } |
177 | 180 |
178 // static | 181 // static |
179 void AudioPipeReaderTraits::Destruct(const AudioPipeReader* audio_pipe_reader) { | 182 void AudioPipeReaderTraits::Destruct(const AudioPipeReader* audio_pipe_reader) { |
180 audio_pipe_reader->task_runner_->DeleteSoon(FROM_HERE, audio_pipe_reader); | 183 audio_pipe_reader->task_runner_->DeleteSoon(FROM_HERE, audio_pipe_reader); |
181 } | 184 } |
182 | 185 |
183 } // namespace remoting | 186 } // namespace remoting |
OLD | NEW |