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

Side by Side Diff: remoting/host/linux/audio_pipe_reader.cc

Issue 14314026: remoting: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/linux/audio_pipe_reader.h ('k') | remoting/host/local_input_monitor_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « remoting/host/linux/audio_pipe_reader.h ('k') | remoting/host/local_input_monitor_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698