| 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 #ifndef REMOTING_HOST_LINUX_AUDIO_PIPE_READER_H_ | 5 #ifndef REMOTING_HOST_LINUX_AUDIO_PIPE_READER_H_ |
| 6 #define REMOTING_HOST_LINUX_AUDIO_PIPE_READER_H_ | 6 #define REMOTING_HOST_LINUX_AUDIO_PIPE_READER_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 // MessageLoopForIO::Watcher interface. | 44 // MessageLoopForIO::Watcher interface. |
| 45 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; | 45 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; |
| 46 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE; | 46 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE; |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 friend class base::DeleteHelper<AudioPipeReader>; | 49 friend class base::DeleteHelper<AudioPipeReader>; |
| 50 friend class base::RefCountedThreadSafe<AudioPipeReader>; | 50 friend class base::RefCountedThreadSafe<AudioPipeReader>; |
| 51 friend struct AudioPipeReaderTraits; | 51 friend struct AudioPipeReaderTraits; |
| 52 | 52 |
| 53 AudioPipeReader(scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 53 explicit AudioPipeReader( |
| 54 scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
| 54 virtual ~AudioPipeReader(); | 55 virtual ~AudioPipeReader(); |
| 55 | 56 |
| 56 void StartOnAudioThread(const FilePath& pipe_name); | 57 void StartOnAudioThread(const FilePath& pipe_name); |
| 57 void StartTimer(); | 58 void StartTimer(); |
| 58 void DoCapture(); | 59 void DoCapture(); |
| 59 void WaitForPipeReadable(); | 60 void WaitForPipeReadable(); |
| 60 | 61 |
| 61 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 62 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 62 | 63 |
| 63 int pipe_fd_; | 64 int pipe_fd_; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 81 }; | 82 }; |
| 82 | 83 |
| 83 // Destroys |audio_pipe_reader| on the audio thread. | 84 // Destroys |audio_pipe_reader| on the audio thread. |
| 84 struct AudioPipeReaderTraits { | 85 struct AudioPipeReaderTraits { |
| 85 static void Destruct(const AudioPipeReader* audio_pipe_reader); | 86 static void Destruct(const AudioPipeReader* audio_pipe_reader); |
| 86 }; | 87 }; |
| 87 | 88 |
| 88 } // namespace remoting | 89 } // namespace remoting |
| 89 | 90 |
| 90 #endif // REMOTING_HOST_LINUX_AUDIO_PIPE_READER_H_ | 91 #endif // REMOTING_HOST_LINUX_AUDIO_PIPE_READER_H_ |
| OLD | NEW |