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

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

Issue 852113002: Remove RawChannel::Init() and Channel::Init() failure cases. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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') | mojo/edk/system/remote_message_pipe_unittest.cc » ('j') | 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 27b9ccfc3f0f337c1bbdc875bfa04b23b9030383..7ec7ad7415f9b0ca4d4ba6caa6f7d837c0d95b82 100644
--- a/mojo/edk/system/raw_channel_win.cc
+++ b/mojo/edk/system/raw_channel_win.cc
@@ -168,7 +168,7 @@ class RawChannelWin : public RawChannel {
IOResult WriteNoLock(size_t* platform_handles_written,
size_t* bytes_written) override;
IOResult ScheduleWriteNoLock() override;
- bool OnInit() override;
+ void OnInit() override;
void OnShutdownNoLock(scoped_ptr<ReadBuffer> read_buffer,
scoped_ptr<WriteBuffer> write_buffer) override;
@@ -521,20 +521,19 @@ RawChannel::IOResult RawChannelWin::ScheduleWriteNoLock() {
return io_result;
}
-bool RawChannelWin::OnInit() {
+void RawChannelWin::OnInit() {
DCHECK_EQ(base::MessageLoop::current(), message_loop_for_io());
DCHECK(handle_.is_valid());
- if (skip_completion_port_on_success_ &&
- !g_vista_or_higher_functions.Get().SetFileCompletionNotificationModes(
- handle_.get().handle, FILE_SKIP_COMPLETION_PORT_ON_SUCCESS)) {
- return false;
+ if (skip_completion_port_on_success_) {
+ // I don't know how this can fail (unless |handle_| is bad, in which case
+ // it's a bug in our code).
+ CHECK(g_vista_or_higher_functions.Get().SetFileCompletionNotificationModes(
+ handle_.get().handle, FILE_SKIP_COMPLETION_PORT_ON_SUCCESS));
}
DCHECK(!io_handler_);
io_handler_ = new RawChannelIOHandler(this, handle_.Pass());
-
- return true;
}
void RawChannelWin::OnShutdownNoLock(scoped_ptr<ReadBuffer> read_buffer,
« no previous file with comments | « mojo/edk/system/raw_channel_unittest.cc ('k') | mojo/edk/system/remote_message_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698