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

Unified Diff: mojo/edk/system/raw_channel_win.cc

Issue 859333004: Allow mojo::system::RawChannel::Delegate methods to destroy the RawChannel. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: review comments Created 5 years, 11 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 | « mojo/edk/system/raw_channel_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/raw_channel_win.cc
diff --git a/mojo/edk/system/raw_channel_win.cc b/mojo/edk/system/raw_channel_win.cc
index 7ec7ad7415f9b0ca4d4ba6caa6f7d837c0d95b82..4417937392d81ca1478c1ed900fcc530999f81fa 100644
--- a/mojo/edk/system/raw_channel_win.cc
+++ b/mojo/edk/system/raw_channel_win.cc
@@ -303,6 +303,7 @@ void RawChannelWin::RawChannelIOHandler::OnReadCompleted(DWORD bytes_read,
if (!owner_)
return;
+ // Note: |OnReadCompleted()| may detach us from |owner_|.
if (error == ERROR_SUCCESS) {
DCHECK_GT(bytes_read, 0u);
owner_->OnReadCompleted(IO_SUCCEEDED, bytes_read);
@@ -335,6 +336,7 @@ void RawChannelWin::RawChannelIOHandler::OnWriteCompleted(DWORD bytes_written,
pending_write_ = false;
}
+ // Note: |OnWriteCompleted()| may detach us from |owner_|.
if (error == ERROR_SUCCESS) {
owner_->OnWriteCompleted(IO_SUCCEEDED, 0, bytes_written);
} else if (error == ERROR_BROKEN_PIPE) {
« no previous file with comments | « mojo/edk/system/raw_channel_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698