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

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

Issue 1113393002: Adds thunks for getting platform handles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review feedback Created 5 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
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_thunks.h"
6
7 #include <assert.h>
8
9 #if defined(WIN32)
10 #define THUNK_EXPORT __declspec(dllexport)
11 #else
12 #define THUNK_EXPORT __attribute__((visibility("default")))
13 #endif
14
15 extern "C" {
16
17 static MojoPlatformHandlePrivateThunks g_thunks = {0};
18
19 MojoResult MojoCreatePlatformHandleWrapper(MojoPlatformHandle platform_handle,
20 MojoHandle* wrapper) {
21 assert(g_thunks.CreatePlatformHandleWrapper);
22 return g_thunks.CreatePlatformHandleWrapper(platform_handle, wrapper);
23 }
24
25 MojoResult MojoExtractPlatformHandle(MojoHandle wrapper,
26 MojoPlatformHandle* platform_handle) {
27 assert(g_thunks.ExtractPlatformHandle);
28 return g_thunks.ExtractPlatformHandle(wrapper, platform_handle);
29 }
30
31 extern "C" THUNK_EXPORT size_t MojoSetPlatformHandlePrivateThunks(
32 const MojoPlatformHandlePrivateThunks* thunks) {
33 if (thunks->size >= sizeof(g_thunks))
34 g_thunks = *thunks;
35 return sizeof(g_thunks);
36 }
37
38 } // extern "C"
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698