Index: media/remoting/demuxer_stream_adapter.cc |
diff --git a/media/remoting/demuxer_stream_adapter.cc b/media/remoting/demuxer_stream_adapter.cc |
index de8bfd0024d5ced496a58e89da63e9be02d792c5..c12ee005f6a702ea8f9d6dec3aee3c0c22e8287b 100644 |
--- a/media/remoting/demuxer_stream_adapter.cc |
+++ b/media/remoting/demuxer_stream_adapter.cc |
@@ -57,7 +57,7 @@ |
pending_flush_(false), |
current_pending_frame_offset_(0), |
pending_frame_is_eos_(false), |
- write_watcher_(FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::MANUAL), |
+ write_watcher_(FROM_HERE), |
media_status_(DemuxerStream::kOk), |
producer_handle_(std::move(producer_handle)), |
bytes_written_to_pipe_(0), |
@@ -202,10 +202,9 @@ |
// Starts Mojo watcher. |
if (!write_watcher_.IsWatching()) { |
DEMUXER_VLOG(2) << "Start Mojo data pipe watcher"; |
- write_watcher_.Watch(producer_handle_.get(), MOJO_HANDLE_SIGNAL_WRITABLE, |
+ write_watcher_.Start(producer_handle_.get(), MOJO_HANDLE_SIGNAL_WRITABLE, |
base::Bind(&DemuxerStreamAdapter::TryWriteData, |
weak_factory_.GetWeakPtr())); |
- write_watcher_.ArmOrNotify(); |
} |
} |
@@ -327,16 +326,14 @@ |
WriteDataRaw(producer_handle_.get(), |
pending_frame_.data() + current_pending_frame_offset_, |
&num_bytes, MOJO_WRITE_DATA_FLAG_NONE); |
- if (mojo_result != MOJO_RESULT_OK && mojo_result != MOJO_RESULT_SHOULD_WAIT) { |
- DEMUXER_VLOG(1) << "Pipe was closed unexpectedly (or a bug). result:" |
- << mojo_result; |
- OnFatalError(MOJO_PIPE_ERROR); |
- return; |
- } |
- |
- write_watcher_.ArmOrNotify(); |
- if (mojo_result != MOJO_RESULT_OK) |
- return; |
+ if (mojo_result != MOJO_RESULT_OK) { |
+ if (mojo_result != MOJO_RESULT_SHOULD_WAIT) { |
+ DEMUXER_VLOG(1) << "Pipe was closed unexpectedly (or a bug). result:" |
+ << mojo_result; |
+ OnFatalError(MOJO_PIPE_ERROR); |
+ } |
+ return; |
+ } |
stream_sender_->ConsumeDataChunk(current_pending_frame_offset_, num_bytes, |
pending_frame_.size()); |