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/platform_handle/platform_handle_functions.h

Issue 1578423002: Added PlatformHandle thunks. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 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
Index: mojo/platform_handle/platform_handle_functions.h
diff --git a/mojo/platform_handle/platform_handle_functions.h b/mojo/platform_handle/platform_handle_functions.h
new file mode 100644
index 0000000000000000000000000000000000000000..ddcf239e2bc394fba789f684df4429bf5c6e04dd
--- /dev/null
+++ b/mojo/platform_handle/platform_handle_functions.h
@@ -0,0 +1,25 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
viettrungluu 2016/02/02 00:07:36 This file should also live under //mojo/public/pla
Forrest Reiling 2016/02/10 20:16:08 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_PLATFORM_HANDLE_PLATFORM_HANDLE_FUNCTIONS_H_
+#define MOJO_PLATFORM_HANDLE_PLATFORM_HANDLE_FUNCTIONS_H_
+
+#include "mojo/public/c/system/types.h"
+
+using MojoPlatformHandle = int; // Unix file descriptor
viettrungluu 2016/02/02 00:07:36 This header should be compilable as C, so you shou
Forrest Reiling 2016/02/10 20:16:08 Done.
+
+extern "C" {
viettrungluu 2016/02/02 00:07:36 And wrap this line in #ifdef __cplusplus (and ditt
Forrest Reiling 2016/02/10 20:16:09 Done.
+
+// Wraps |platform_handle| in a MojoHandle so that it can transported, returns
+// true on success. This takes ownership of |platform_handle|, regardless of
viettrungluu 2016/02/02 00:07:36 It so doesn't return "true".
Forrest Reiling 2016/02/10 20:16:09 Done.
+// whether this succeeds.
+MojoResult MojoCreatePlatformHandleWrapper(MojoPlatformHandle platform_handle,
+ MojoHandle* wrapper);
+
+MojoResult MojoExtractPlatformHandle(MojoHandle wrapper,
viettrungluu 2016/02/02 00:07:36 This could use a comment too.
Forrest Reiling 2016/02/10 20:16:08 Done.
+ MojoPlatformHandle* platform_handle);
+
+} // extern "C"
+
+#endif // MOJO_PLATFORM_HANDLE_PLATFORM_HANDLE_FUNCTIONS_H_

Powered by Google App Engine
This is Rietveld 408576698