|
|
DescriptionMake WebDataConsumerHandleImpl return OK while zero-length reading of closed pipe.
Even if there is unread data available, mojo::ReadDataRaw() returns
FAILED_PRECONDITION when |size| is 0 and the producer handle was closed. But in
this case, WebDataConsumerHandle::Reader::read() must return OK.
BytesConsumerForDataConsumerHandle::didGetReadable() calls zero-length read to
check the handle's status. If ReaderImpl::read() returns Done, the consumer
handle will be closed even if there is unread data available.
BUG=649558
Committed: https://crrev.com/21cb200fb6ef1ea455ac5a2e820a1ed4fcdea5e5
Cr-Commit-Position: refs/heads/master@{#421706}
Patch Set 1 #
Total comments: 4
Patch Set 2 : use constexpr #Patch Set 3 : use mojo::Wait() with 0 deadline to check whether readable or not #
Messages
Total messages: 45 (27 generated)
Description was changed from ========== Make ReaderImpl::read() return Ok when the size is 0 and the producer handle was closed. BUG=649558 ========== to ========== Make WebDataConsumerHandleImpl return OK while zero-length reading of closed pipe. Even if there is unread data available, mojo::ReadDataRaw() returns FAILED_PRECONDITION when |size| is 0 and the producer handle was closed. But in this case, WebDataConsumerHandle::Reader::read() must return OK. BytesConsumerForDataConsumerHandle::didGetReadable() calls zero-length read to check the handle's status. If ReaderImpl::read() returns Done, the consumer handle will be closed even if there is unread data available. BUG=649558 ==========
The CQ bit was checked by horo@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
horo@chromium.org changed reviewers: + yhirano@chromium.org
yhirano@ Could you please review this?
lgtm https://codereview.chromium.org/2363963002/diff/1/content/child/web_data_cons... File content/child/web_data_consumer_handle_impl_unittest.cc (right): https://codereview.chromium.org/2363963002/diff/1/content/child/web_data_cons... content/child/web_data_consumer_handle_impl_unittest.cc:203: static int kDataPipeCapacity; + constexpr https://codereview.chromium.org/2363963002/diff/1/content/child/web_data_cons... content/child/web_data_consumer_handle_impl_unittest.cc:285: const size_t data_size = kDataPipeCapacity - 1; constexpr
The CQ bit was checked by horo@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Thank you. https://codereview.chromium.org/2363963002/diff/1/content/child/web_data_cons... File content/child/web_data_consumer_handle_impl_unittest.cc (right): https://codereview.chromium.org/2363963002/diff/1/content/child/web_data_cons... content/child/web_data_consumer_handle_impl_unittest.cc:203: static int kDataPipeCapacity; On 2016/09/23 06:55:55, yhirano wrote: > + constexpr Done. https://codereview.chromium.org/2363963002/diff/1/content/child/web_data_cons... content/child/web_data_consumer_handle_impl_unittest.cc:285: const size_t data_size = kDataPipeCapacity - 1; On 2016/09/23 06:55:55, yhirano wrote: > constexpr Done.
horo@chromium.org changed reviewers: + esprehn@chromium.org
esprehn@ Could you please review this?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2016/09/23 07:40:54, horo wrote: > esprehn@ > > Could you please review this? Ping?
esprehn@chromium.org changed reviewers: + rockot@chromium.org - esprehn@chromium.org
rockot@ might be a better reviewer? I'm happy to stamp after.
If you want to test for peer closure without it feeling like a hack, you can call: MojoWait(handle, MOJO_HANDLE_SIGNAL_PEER_CLOSED, 0, nullptr); This will never actually "wait" on anything because the deadline is 0, so it's always safe to call. If the peer is known to be closed, this will return MOJO_RESULT_OK. Otherwise it'll return MOJO_RESULT_SHOULD_WAIT.
The CQ bit was checked by horo@chromium.org to run a CQ dry run
On 2016/09/28 05:34:12, Ken Rockot wrote: > If you want to test for peer closure without it feeling like a hack, you can > call: > > MojoWait(handle, MOJO_HANDLE_SIGNAL_PEER_CLOSED, > 0, nullptr); > > This will never actually "wait" on anything because the deadline is 0, so it's > always safe to call. > > If the peer is known to be closed, this will return MOJO_RESULT_OK. Otherwise > it'll return MOJO_RESULT_SHOULD_WAIT. Uploaded Patch Set 3. We want to test whether the handle is readable or not even if the peer was closed. So Patch Set 3 is using mojo::Wait(handle, MOJO_HANDLE_SIGNAL_READABLE, 0, nullptr)
lgtm
On 2016/09/28 13:18:29, Ken Rockot wrote: > lgtm Thank you.
The CQ bit was checked by horo@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by horo@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by horo@chromium.org
The CQ bit was checked by horo@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from yhirano@chromium.org Link to the patchset: https://codereview.chromium.org/2363963002/#ps40001 (title: "use mojo::Wait() with 0 deadline to check whether readable or not")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
horo@chromium.org changed reviewers: + esprehn@chromium.org
+esprehn@ Please :)
lgtm
On 2016/09/29 01:17:30, esprehn wrote: > lgtm thank you!
The CQ bit was checked by horo@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Make WebDataConsumerHandleImpl return OK while zero-length reading of closed pipe. Even if there is unread data available, mojo::ReadDataRaw() returns FAILED_PRECONDITION when |size| is 0 and the producer handle was closed. But in this case, WebDataConsumerHandle::Reader::read() must return OK. BytesConsumerForDataConsumerHandle::didGetReadable() calls zero-length read to check the handle's status. If ReaderImpl::read() returns Done, the consumer handle will be closed even if there is unread data available. BUG=649558 ========== to ========== Make WebDataConsumerHandleImpl return OK while zero-length reading of closed pipe. Even if there is unread data available, mojo::ReadDataRaw() returns FAILED_PRECONDITION when |size| is 0 and the producer handle was closed. But in this case, WebDataConsumerHandle::Reader::read() must return OK. BytesConsumerForDataConsumerHandle::didGetReadable() calls zero-length read to check the handle's status. If ReaderImpl::read() returns Done, the consumer handle will be closed even if there is unread data available. BUG=649558 ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Description was changed from ========== Make WebDataConsumerHandleImpl return OK while zero-length reading of closed pipe. Even if there is unread data available, mojo::ReadDataRaw() returns FAILED_PRECONDITION when |size| is 0 and the producer handle was closed. But in this case, WebDataConsumerHandle::Reader::read() must return OK. BytesConsumerForDataConsumerHandle::didGetReadable() calls zero-length read to check the handle's status. If ReaderImpl::read() returns Done, the consumer handle will be closed even if there is unread data available. BUG=649558 ========== to ========== Make WebDataConsumerHandleImpl return OK while zero-length reading of closed pipe. Even if there is unread data available, mojo::ReadDataRaw() returns FAILED_PRECONDITION when |size| is 0 and the producer handle was closed. But in this case, WebDataConsumerHandle::Reader::read() must return OK. BytesConsumerForDataConsumerHandle::didGetReadable() calls zero-length read to check the handle's status. If ReaderImpl::read() returns Done, the consumer handle will be closed even if there is unread data available. BUG=649558 Committed: https://crrev.com/21cb200fb6ef1ea455ac5a2e820a1ed4fcdea5e5 Cr-Commit-Position: refs/heads/master@{#421706} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/21cb200fb6ef1ea455ac5a2e820a1ed4fcdea5e5 Cr-Commit-Position: refs/heads/master@{#421706} |