Chromium Code Reviews

Unified Diff: mojo/edk/embedder/connection_param.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.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « mojo/edk/embedder/BUILD.gn ('k') | mojo/edk/embedder/connection_param.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/embedder/connection_param.h
diff --git a/mojo/edk/embedder/connection_param.h b/mojo/edk/embedder/connection_param.h
new file mode 100644
index 0000000000000000000000000000000000000000..100ef579f2c24e9e9862fd6468b1487e0a063761
--- /dev/null
+++ b/mojo/edk/embedder/connection_param.h
@@ -0,0 +1,66 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_EDK_EMBEDDER_CONNECTION_PARAM_H_
+#define MOJO_EDK_EMBEDDER_CONNECTION_PARAM_H_
+
+#include "base/macros.h"
+#include "build/build_config.h"
+#include "mojo/edk/embedder/scoped_platform_handle.h"
+#include "mojo/edk/system/system_impl_export.h"
+
+#if defined(OS_ANDROID)
+#include "base/android/parcelable_channel_client.h"
+#include "base/android/parcelable_channel_server.h"
+#include "base/android/scoped_java_ref.h"
+#endif
+
+namespace mojo {
+namespace edk {
+
+class MOJO_SYSTEM_IMPL_EXPORT ConnectionParam {
+ public:
+#if defined(OS_ANDROID)
+ explicit ConnectionParam(ScopedPlatformHandle channel);
+ ConnectionParam(
+ ScopedPlatformHandle channel,
+ base::android::ParcelableChannelClient parcelable_channel_client,
+ base::android::ParcelableChannelServer parcelable_channel_server);
+#else
+ explicit ConnectionParam(ScopedPlatformHandle channel);
+#endif
+ ConnectionParam(ConnectionParam&& param);
+
+ ConnectionParam& operator=(ConnectionParam&& param);
+
+ ScopedPlatformHandle TakeChannelHandle();
+
+#if defined(OS_ANDROID)
+ base::android::ParcelableChannelClient TakeParcelableChannelClient();
+ base::android::ParcelableChannelServer TakeParcelableChannelServer();
+
+ bool is_valid_parcelable_channel_client() const {
+ return parcelable_channel_client_.is_valid();
+ }
+
+ bool is_valid_parcelable_channel_server() const {
+ return parcelable_channel_server_.is_valid();
+ }
+#endif
+
+ private:
+ ScopedPlatformHandle channel_;
+
+#if defined(OS_ANDROID)
+ base::android::ParcelableChannelClient parcelable_channel_client_;
+ base::android::ParcelableChannelServer parcelable_channel_server_;
+#endif
+
+ DISALLOW_COPY_AND_ASSIGN(ConnectionParam);
+};
+
+} // namespace edk
+} // namespace mojo
+
+#endif // MOJO_EDK_EMBEDDER_CONNECTION_PARAM_H_
« no previous file with comments | « mojo/edk/embedder/BUILD.gn ('k') | mojo/edk/embedder/connection_param.cc » ('j') | no next file with comments »

Powered by Google App Engine