Chromium Code Reviews| Index: mojo/platform_handle/platform_handle_thunks.h |
| diff --git a/mojo/platform_handle/platform_handle_thunks.h b/mojo/platform_handle/platform_handle_thunks.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..71d598c822ca7555d8f266b93db5ef2525595658 |
| --- /dev/null |
| +++ b/mojo/platform_handle/platform_handle_thunks.h |
| @@ -0,0 +1,30 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MOJO_PLATFORM_HANDLE_PLATFORM_HANDLE_THUNKS_H_ |
| +#define MOJO_PLATFORM_HANDLE_PLATFORM_HANDLE_THUNKS_H_ |
| + |
| +#include <stddef.h> |
| + |
| +#include "mojo/platform_handle/platform_handle_functions.h" |
| + |
| +#pragma pack(push, 8) |
| +struct MojoPlatformHandleThunks { |
|
viettrungluu
2015/05/01 17:05:51
You might want to call this "MojoPlatformHandlePri
sky
2015/05/01 17:18:45
Done.
|
| + size_t size; // Should be set to sizeof(PlatformHandleThunks). |
| + bool (*CreatePlatformHandleWrapper)(MojoPlatformHandle, MojoHandle*); |
| + bool (*ExtractPlatformHandle)(MojoHandle, MojoPlatformHandle*); |
| +}; |
| +#pragma pack(pop) |
| + |
| +inline MojoPlatformHandleThunks MojoMakePlatformHandleThunks() { |
| + MojoPlatformHandleThunks system_thunks = {sizeof(MojoPlatformHandleThunks), |
| + MojoCreatePlatformHandleWrapper, |
| + MojoExtractPlatformHandle}; |
| + return system_thunks; |
| +} |
| + |
| +typedef size_t (*MojoSetPlatformHandleThunksFn)( |
| + const struct MojoPlatformHandleThunks* thunks); |
| + |
| +#endif // MOJO_PLATFORM_HANDLE_PLATFORM_HANDLE_THUNKS_H_ |