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

Unified Diff: mojo/system/platform_channel.cc

Issue 103113002: Mojo: (POSIX) Pass channel handle to child. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years 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/mojo.gyp ('k') | mojo/system/platform_channel_handle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/platform_channel.cc
diff --git a/mojo/system/platform_channel.cc b/mojo/system/platform_channel.cc
index d5066b532397bcc8f94b5c98dd207e906c453802..46657e6067f4ffd5b238fd39feaf93fada1c9e85 100644
--- a/mojo/system/platform_channel.cc
+++ b/mojo/system/platform_channel.cc
@@ -10,9 +10,7 @@ namespace mojo {
namespace system {
PlatformChannel::~PlatformChannel() {
- // Implementations must close the handle if necessary (e.g., if no one else
- // has taken ownership).
- DCHECK(!is_valid());
+ handle_.CloseIfNecessary();
}
PlatformChannelHandle PlatformChannel::PassHandle() {
@@ -34,6 +32,7 @@ PlatformServerChannel::PlatformServerChannel(const std::string& name)
// static
scoped_ptr<PlatformClientChannel> PlatformClientChannel::CreateFromHandle(
const PlatformChannelHandle& handle) {
+ DCHECK(handle.is_valid());
scoped_ptr<PlatformClientChannel> rv(new PlatformClientChannel());
*rv->mutable_handle() = handle;
return rv.Pass();
« no previous file with comments | « mojo/mojo.gyp ('k') | mojo/system/platform_channel_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698