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

Unified Diff: mojo/system/raw_channel_win.cc

Issue 616043003: mojo::RawChannelWin: Use GetOverlappedResult() to retrive read bytes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Landing Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/raw_channel_win.cc
diff --git a/mojo/system/raw_channel_win.cc b/mojo/system/raw_channel_win.cc
index 1090038782d8a4142ef028035b475d511bfdced9..72cec161d955c2d35558788ea80266a0ffccc97c 100644
--- a/mojo/system/raw_channel_win.cc
+++ b/mojo/system/raw_channel_win.cc
@@ -371,14 +371,12 @@ RawChannel::IOResult RawChannelWin::Read(size_t* bytes_read) {
size_t bytes_to_read = 0;
read_buffer()->GetBuffer(&buffer, &bytes_to_read);
- DWORD bytes_read_dword = 0;
BOOL result = ReadFile(io_handler_->handle(),
buffer,
static_cast<DWORD>(bytes_to_read),
- &bytes_read_dword,
+ nullptr,
&io_handler_->read_context()->overlapped);
if (!result) {
- DCHECK_EQ(bytes_read_dword, 0u);
DWORD error = GetLastError();
if (error == ERROR_BROKEN_PIPE)
return IO_FAILED_SHUTDOWN;
@@ -389,6 +387,13 @@ RawChannel::IOResult RawChannelWin::Read(size_t* bytes_read) {
}
if (result && skip_completion_port_on_success_) {
+ DWORD bytes_read_dword = 0;
+ BOOL get_size_result =
+ GetOverlappedResult(io_handler_->handle(),
+ &io_handler_->read_context()->overlapped,
+ &bytes_read_dword,
+ FALSE);
+ DPCHECK(get_size_result);
*bytes_read = bytes_read_dword;
return IO_SUCCEEDED;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698