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

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

Issue 2735113003: Changing SpawnChild to return a struct.
Patch Set: Created 3 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/pending_process_connection.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 4866e754fd1376579a06333d4d49d331cd9c33bc..59ae8c7614943bccecf1af58784de2befeb6785e 100644
--- a/mojo/edk/embedder/platform_handle.h
+++ b/mojo/edk/embedder/platform_handle.h
@@ -14,6 +14,9 @@
#include "base/process/process_handle.h"
#elif defined(OS_MACOSX) && !defined(OS_IOS)
#include <mach/mach.h>
+#elif defined(OS_ANDROID)
+#include <jni.h>
+#include "base/android/scoped_java_ref.h"
#endif
namespace mojo {
@@ -27,6 +30,11 @@ struct MOJO_SYSTEM_IMPL_EXPORT PlatformHandle {
explicit PlatformHandle(mach_port_t port)
: type(Type::MACH), port(port) {}
#endif
+#if defined(OS_ANDROID)
+ explicit PlatformHandle(
+ const base::android::ScopedJavaLocalRef<jobject>& parcelable_param)
+ : type(Type::PARCELABLE), parcelable(parcelable_param) {}
+#endif
void CloseIfNecessary();
@@ -35,6 +43,10 @@ struct MOJO_SYSTEM_IMPL_EXPORT PlatformHandle {
if (type == Type::MACH || type == Type::MACH_NAME)
return port != MACH_PORT_NULL;
#endif
+#if defined(OS_ANDROID)
+ if (type == Type::PARCELABLE) // || type == Type::PARCELABLE_ID)
+ return !parcelable.is_null();
+#endif
return handle != -1;
}
@@ -48,6 +60,10 @@ struct MOJO_SYSTEM_IMPL_EXPORT PlatformHandle {
// this also allows us to do checks in other places.
MACH_NAME,
#endif
+#if defined(OS_ANDROID)
+ PARCELABLE,
+// PARCELABLE_ID,
+#endif
};
Type type = Type::POSIX;
@@ -59,6 +75,9 @@ struct MOJO_SYSTEM_IMPL_EXPORT PlatformHandle {
#if defined(OS_MACOSX) && !defined(OS_IOS)
mach_port_t port = MACH_PORT_NULL;
#endif
+#if defined(OS_ANDROID)
+ base::android::ScopedJavaGlobalRef<jobject> parcelable;
+#endif
};
#elif defined(OS_WIN)
struct MOJO_SYSTEM_IMPL_EXPORT PlatformHandle {
« no previous file with comments | « mojo/edk/embedder/pending_process_connection.cc ('k') | mojo/edk/embedder/platform_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698