Chromium Code Reviews| Index: mojo/edk/system/data_pipe_producer_dispatcher.cc |
| diff --git a/mojo/edk/system/data_pipe_producer_dispatcher.cc b/mojo/edk/system/data_pipe_producer_dispatcher.cc |
| index 5c7b75df76665e439a1d528136c593ce100d4578..8273c14d18fc144adf2255568922ffd1f0413565 100644 |
| --- a/mojo/edk/system/data_pipe_producer_dispatcher.cc |
| +++ b/mojo/edk/system/data_pipe_producer_dispatcher.cc |
| @@ -137,9 +137,8 @@ MojoResult DataPipeProducerDispatcher::WriteData(const void* elements, |
| if (*num_bytes == 0) |
| return MOJO_RESULT_OK; // Nothing to do. |
| - bool all_or_none = flags & MOJO_WRITE_DATA_FLAG_ALL_OR_NONE; |
| - uint32_t min_num_bytes_to_write = all_or_none ? *num_bytes : 0; |
| - if (min_num_bytes_to_write > options_.capacity_num_bytes) { |
| + if ((flags & MOJO_WRITE_DATA_FLAG_ALL_OR_NONE) && |
| + (*num_bytes > available_capacity_)) { |
| // Don't return "should wait" since you can't wait for a specified amount of |
| // data. |
| return MOJO_RESULT_OUT_OF_RANGE; |
|
miu
2016/09/14 22:40:23
Should this instead be:
1. MOJO_RESULT_SHOULD_WAI
jam
2016/09/15 17:08:34
the canonical documentation is in https://cs.chrom
|