Chromium Code Reviews| 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_ |