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

Unified Diff: media/remoting/demuxer_stream_adapter.cc

Issue 2750373002: Revert of Mojo: Armed Watchers (Closed)
Patch Set: Created 3 years, 9 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
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());
« no previous file with comments | « media/remoting/demuxer_stream_adapter.h ('k') | mojo/android/javatests/src/org/chromium/mojo/system/impl/WatcherImplTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698