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

Unified Diff: mojo/edk/embedder/embedder.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 | « no previous file | mojo/edk/system/channel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/embedder/embedder.cc
diff --git a/mojo/edk/embedder/embedder.cc b/mojo/edk/embedder/embedder.cc
index 622b3b721d248f7852638a2154a61f7b67ad96bd..1d12c1e78032e22a6cc8eef5b7e86f55c54cce9f 100644
--- a/mojo/edk/embedder/embedder.cc
+++ b/mojo/edk/embedder/embedder.cc
@@ -36,14 +36,7 @@ system::ChannelId MakeChannel(
DCHECK(internal::g_core);
scoped_refptr<system::Channel> channel =
new system::Channel(internal::g_core->platform_support());
- if (!channel->Init(system::RawChannel::Create(platform_handle.Pass()))) {
- // This is very unusual (e.g., maybe |platform_handle| was invalid or we
- // reached some system resource limit).
- LOG(ERROR) << "Channel::Init() failed";
- // Return null, since |Shutdown()| shouldn't be called in this case.
- return 0;
- }
-
+ channel->Init(system::RawChannel::Create(platform_handle.Pass()));
channel->SetBootstrapEndpoint(channel_endpoint);
DCHECK(internal::g_channel_manager);
@@ -150,11 +143,7 @@ ScopedMessagePipeHandle CreateChannel(
// TODO(vtl): Write tests for this.
void DestroyChannel(ChannelInfo* channel_info) {
DCHECK(channel_info);
- if (!channel_info->channel_id) {
- // Presumably, |Init()| on the channel failed.
- return;
- }
-
+ DCHECK(channel_info->channel_id);
DCHECK(internal::g_channel_manager);
// This will destroy the channel synchronously if called from the channel
// thread.
« no previous file with comments | « no previous file | mojo/edk/system/channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698