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.
5 #include "mojo/platform_handle/platform_handle_private_thunks.h"
10 #define THUNK_EXPORT __declspec(dllexport)
12 #define THUNK_EXPORT __attribute__((visibility("default")))
17 static MojoPlatformHandlePrivateThunks g_thunks
= {0};
19 MojoResult
MojoCreatePlatformHandleWrapper(MojoPlatformHandle platform_handle
,
20 MojoHandle
* wrapper
) {
21 assert(g_thunks
.CreatePlatformHandleWrapper
);
22 return g_thunks
.CreatePlatformHandleWrapper(platform_handle
, wrapper
);
25 MojoResult
MojoExtractPlatformHandle(MojoHandle wrapper
,
26 MojoPlatformHandle
* platform_handle
) {
27 assert(g_thunks
.ExtractPlatformHandle
);
28 return g_thunks
.ExtractPlatformHandle(wrapper
, platform_handle
);
31 extern "C" THUNK_EXPORT
size_t MojoSetPlatformHandlePrivateThunks(
32 const MojoPlatformHandlePrivateThunks
* thunks
) {
33 if (thunks
->size
>= sizeof(g_thunks
))
35 return sizeof(g_thunks
);