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

Side by Side Diff: mojo/public/platform/native/platform_handle_private.h

Issue 1578423002: Added PlatformHandle thunks. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
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_PUBLIC_PLATFORM_NATIVE_PLATFORM_HANDLE_PRIVATE_H_
6 #define MOJO_PUBLIC_PLATFORM_NATIVE_PLATFORM_HANDLE_PRIVATE_H_
7
8 #include "mojo/public/c/system/types.h"
9
10 typedef int MojoPlatformHandle; // Unix file descriptor
11
12 #ifdef __cplusplus
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|. Never the less, it is still
26 // neccessary to MojoClose |wrapper|, but this will not affect the underlying
27 // descriptor after this call.
28 MojoResult MojoExtractPlatformHandle(MojoHandle wrapper,
29 MojoPlatformHandle* platform_handle);
30
31 #ifdef __cplusplus
32 } // extern "C"
33 #endif
34
35 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_PLATFORM_HANDLE_PRIVATE_H_
OLDNEW
« no previous file with comments | « mojo/public/platform/native/BUILD.gn ('k') | mojo/public/platform/native/platform_handle_private_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698