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

Unified Diff: remoting/host/linux/audio_pipe_reader.h

Issue 2394883003: Use FileDescriptorWatcher in AudioPipeReader. (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | remoting/host/linux/audio_pipe_reader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/linux/audio_pipe_reader.h
diff --git a/remoting/host/linux/audio_pipe_reader.h b/remoting/host/linux/audio_pipe_reader.h
index 465c24663f5025c6b44cb21c990859d3f68ee218..64a459bd1668dc95bc2bde98ce3389bfcadb1c51 100644
--- a/remoting/host/linux/audio_pipe_reader.h
+++ b/remoting/host/linux/audio_pipe_reader.h
@@ -7,7 +7,10 @@
#include <stdint.h>
+#include <memory>
+
#include "base/files/file.h"
+#include "base/files/file_descriptor_watcher_posix.h"
#include "base/files/file_path.h"
#include "base/files/file_path_watcher.h"
#include "base/macros.h"
@@ -27,8 +30,8 @@ struct AudioPipeReaderTraits;
// pulseaudio) writes the sound that's being played back and then sends data to
// all registered observers.
class AudioPipeReader
- : public base::RefCountedThreadSafe<AudioPipeReader, AudioPipeReaderTraits>,
- public base::MessageLoopForIO::Watcher {
+ : public base::RefCountedThreadSafe<AudioPipeReader,
+ AudioPipeReaderTraits> {
public:
// PulseAudio's module-pipe-sink must be configured to use the following
// parameters for the sink we read from.
@@ -54,10 +57,6 @@ class AudioPipeReader
void AddObserver(StreamObserver* observer);
void RemoveObserver(StreamObserver* observer);
- // MessageLoopForIO::Watcher interface.
- void OnFileCanReadWithoutBlocking(int fd) override;
- void OnFileCanWriteWithoutBlocking(int fd) override;
-
private:
friend class base::DeleteHelper<AudioPipeReader>;
friend class base::RefCountedThreadSafe<AudioPipeReader>;
@@ -65,7 +64,7 @@ class AudioPipeReader
AudioPipeReader(scoped_refptr<base::SingleThreadTaskRunner> task_runner,
const base::FilePath& pipe_path);
- ~AudioPipeReader() override;
+ ~AudioPipeReader();
void StartOnAudioThread();
void OnDirectoryChanged(const base::FilePath& path, bool error);
@@ -102,7 +101,8 @@ class AudioPipeReader
// Bytes left from the previous read.
std::string left_over_bytes_;
- base::MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_;
+ std::unique_ptr<base::FileDescriptorWatcher::Controller>
+ pipe_watch_controller_;
DISALLOW_COPY_AND_ASSIGN(AudioPipeReader);
};
« no previous file with comments | « no previous file | remoting/host/linux/audio_pipe_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698