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; |