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

Side by Side Diff: mojo/platform_handle/platform_handle_private_thunks.cc

Issue 1995753002: [mojo-edk] Expose portable API for platform handle wrapping (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 7 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
« no previous file with comments | « mojo/platform_handle/platform_handle_private_thunks.h ('k') | mojo/public/c/system/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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 #include "mojo/platform_handle/platform_handle_private_thunks.h"
6
7 #include <assert.h>
8 #include <stddef.h>
9
10 #if defined(WIN32)
11 #define THUNK_EXPORT __declspec(dllexport)
12 #else
13 #define THUNK_EXPORT __attribute__((visibility("default")))
14 #endif
15
16 extern "C" {
17
18 static MojoPlatformHandlePrivateThunks g_thunks = {0};
19
20 MojoResult MojoCreatePlatformHandleWrapper(MojoPlatformHandle platform_handle,
21 MojoHandle* wrapper) {
22 assert(g_thunks.CreatePlatformHandleWrapper);
23 return g_thunks.CreatePlatformHandleWrapper(platform_handle, wrapper);
24 }
25
26 MojoResult MojoExtractPlatformHandle(MojoHandle wrapper,
27 MojoPlatformHandle* platform_handle) {
28 assert(g_thunks.ExtractPlatformHandle);
29 return g_thunks.ExtractPlatformHandle(wrapper, platform_handle);
30 }
31
32 extern "C" THUNK_EXPORT size_t MojoSetPlatformHandlePrivateThunks(
33 const MojoPlatformHandlePrivateThunks* thunks) {
34 if (thunks->size >= sizeof(g_thunks))
35 g_thunks = *thunks;
36 return sizeof(g_thunks);
37 }
38
39 } // extern "C"
OLDNEW
« no previous file with comments | « mojo/platform_handle/platform_handle_private_thunks.h ('k') | mojo/public/c/system/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698