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

Unified Diff: mojo/edk/embedder/platform_handle.h

Issue 1712143002: [mojo-edk] Add support for transferring mach ports. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build Created 4 years, 9 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/embedder/embedder_unittest.cc ('k') | mojo/edk/embedder/platform_handle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/embedder/platform_handle.h
diff --git a/mojo/edk/embedder/platform_handle.h b/mojo/edk/embedder/platform_handle.h
index 1c0c75220b0625b0200ffa84f67f3fb6ea4d27a5..3c945c69dffe17c62515184b7b5307bb11597c70 100644
--- a/mojo/edk/embedder/platform_handle.h
+++ b/mojo/edk/embedder/platform_handle.h
@@ -30,7 +30,7 @@ struct MOJO_SYSTEM_IMPL_EXPORT PlatformHandle {
bool is_valid() const {
#if defined(OS_MACOSX) && !defined(OS_IOS)
- if (type == Type::MACH)
+ if (type == Type::MACH || type == Type::MACH_NAME)
return port != MACH_PORT_NULL;
#endif
return handle != -1;
@@ -40,6 +40,11 @@ struct MOJO_SYSTEM_IMPL_EXPORT PlatformHandle {
POSIX,
#if defined(OS_MACOSX) && !defined(OS_IOS)
MACH,
+ // MACH_NAME isn't a real Mach port. But rather the "name" of one that can
+ // be resolved to a real port later. This distinction is needed so that the
+ // "port" doesn't try to be closed if CloseIfNecessary() is called. Having
+ // this also allows us to do checks in other places.
+ MACH_NAME,
#endif
};
Type type = Type::POSIX;
« no previous file with comments | « mojo/edk/embedder/embedder_unittest.cc ('k') | mojo/edk/embedder/platform_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698