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

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: 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
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();

Powered by Google App Engine
This is Rietveld 408576698