Chromium Code Reviews| Index: content/child/web_data_consumer_handle_impl.cc |
| diff --git a/content/child/web_data_consumer_handle_impl.cc b/content/child/web_data_consumer_handle_impl.cc |
| index 50433a3a3b957ce672f4e91e47ce96e48288b51d..3fcc5aa3bc7f74f843576feed7ee522ff1468bb1 100644 |
| --- a/content/child/web_data_consumer_handle_impl.cc |
| +++ b/content/child/web_data_consumer_handle_impl.cc |
| @@ -61,8 +61,18 @@ Result WebDataConsumerHandleImpl::ReaderImpl::read(void* data, |
| // FAILED_PRECONDITION when |size| is 0 and the producer handle was closed. |
| // But in this case, WebDataConsumerHandle::Reader::read() must return Ok. |
| // So we use mojo::Wait() with 0 deadline to check whether readable or not. |
| - return HandleReadResult(mojo::Wait( |
| - context_->handle().get(), MOJO_HANDLE_SIGNAL_READABLE, 0, nullptr)); |
| + MojoResult wait_result = mojo::Wait( |
| + context_->handle().get(), MOJO_HANDLE_SIGNAL_READABLE, 0, nullptr); |
| + switch (wait_result) { |
| + case MOJO_RESULT_OK: |
| + return Ok; |
| + case MOJO_RESULT_FAILED_PRECONDITION: |
| + return Done; |
| + case MOJO_RESULT_DEADLINE_EXCEEDED: |
| + return ShouldWait; |
| + default: |
| + return UnexpectedError; |
|
yhirano
2017/01/18 08:34:21
NOTREACHED() according to https://cs.chromium.org/
horo
2017/01/18 09:37:08
Done.
|
| + } |
| } |
| uint32_t size_to_pass = size; |