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

Unified Diff: mojo/common/data_pipe_utils.cc

Issue 2744943002: Mojo: Move waiting APIs to public library (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
« no previous file with comments | « ipc/ipc_channel_mojo_unittest.cc ('k') | mojo/edk/embedder/configuration.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/common/data_pipe_utils.cc
diff --git a/mojo/common/data_pipe_utils.cc b/mojo/common/data_pipe_utils.cc
index bed5e858fc04e831232c15f2e15cd0cbd0b43d57..9b069b80c5832c44e2ac18acfb969539f53e2bcf 100644
--- a/mojo/common/data_pipe_utils.cc
+++ b/mojo/common/data_pipe_utils.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "base/bind.h"
+#include "mojo/public/cpp/system/wait.h"
namespace mojo {
namespace common {
@@ -25,10 +26,7 @@ bool BlockingCopyHelper(ScopedDataPipeConsumerHandle source,
if (bytes_written < num_bytes || result != MOJO_RESULT_OK)
return false;
} else if (result == MOJO_RESULT_SHOULD_WAIT) {
- result = Wait(source.get(),
- MOJO_HANDLE_SIGNAL_READABLE,
- MOJO_DEADLINE_INDEFINITE,
- nullptr);
+ result = Wait(source.get(), MOJO_HANDLE_SIGNAL_READABLE);
if (result != MOJO_RESULT_OK) {
// If the producer handle was closed, then treat as EOF.
return result == MOJO_RESULT_FAILED_PRECONDITION;
@@ -82,8 +80,7 @@ bool MOJO_COMMON_EXPORT BlockingCopyFromString(
if (it == source.end())
return true;
} else if (result == MOJO_RESULT_SHOULD_WAIT) {
- result = Wait(destination.get(), MOJO_HANDLE_SIGNAL_WRITABLE,
- MOJO_DEADLINE_INDEFINITE, nullptr);
+ result = Wait(destination.get(), MOJO_HANDLE_SIGNAL_WRITABLE);
if (result != MOJO_RESULT_OK) {
// If the consumer handle was closed, then treat as EOF.
return result == MOJO_RESULT_FAILED_PRECONDITION;
« no previous file with comments | « ipc/ipc_channel_mojo_unittest.cc ('k') | mojo/edk/embedder/configuration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698