Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
|
viettrungluu
2016/02/18 01:10:07
2016?
Forrest Reiling
2016/02/23 23:48:45
Done.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MOJO_PLATFORM_HANDLE_PLATFORM_HANDLE_FUNCTIONS_H_ | |
|
viettrungluu
2016/02/18 01:10:07
Update this header guard.
Forrest Reiling
2016/02/23 23:48:45
Done.
| |
| 6 #define MOJO_PLATFORM_HANDLE_PLATFORM_HANDLE_FUNCTIONS_H_ | |
| 7 | |
| 8 #include "mojo/public/c/system/types.h" | |
| 9 | |
| 10 typedef int MojoPlatformHandle; // Unix file descriptor | |
| 11 | |
| 12 #if defined(__cplusplus) | |
|
viettrungluu
2016/02/18 01:10:07
I think we conventionally/mostly use #ifdef when c
Forrest Reiling
2016/02/23 23:48:45
Wait what? So we use '#if defined()' everywhere ex
| |
| 13 extern "C" { | |
| 14 #endif | |
| 15 | |
| 16 // Wraps |platform_handle| in a MojoHandle so that it can transported. Returns | |
| 17 // MOJO_RESULT_OK on success, all other results indicate failure. This takes | |
| 18 // ownership of |platform_handle|, regardless of whether this succeeds. | |
| 19 MojoResult MojoCreatePlatformHandleWrapper(MojoPlatformHandle platform_handle, | |
| 20 MojoHandle* wrapper); | |
| 21 | |
| 22 // Extracts |platform_handle| from |wrapper|. Returns MOJO_RESULT_OK on success, | |
| 23 // all other results indicate failure. If this succeeds, it causes |wrapper| to | |
| 24 // relinquish ownership of |platform_handle|, so MojoClose'ing |wrapper| will no | |
| 25 // longer close the underlying |platform_handle| | |
|
viettrungluu
2016/02/18 01:10:07
Probably mention that |wrapper| nonetheless should
Forrest Reiling
2016/02/23 23:48:45
Along the lines of my other comment on the matter,
| |
| 26 MojoResult MojoExtractPlatformHandle(MojoHandle wrapper, | |
| 27 MojoPlatformHandle* platform_handle); | |
| 28 | |
| 29 #if defined(__cplusplus) | |
|
viettrungluu
2016/02/18 01:10:07
...
Forrest Reiling
2016/02/23 23:48:45
Done.
| |
| 30 } // extern "C" | |
| 31 #endif | |
| 32 | |
| 33 #endif // MOJO_PLATFORM_HANDLE_PLATFORM_HANDLE_FUNCTIONS_H_ | |
| OLD | NEW |