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

Unified Diff: mojo/platform_handle/platform_handle_thunks.h

Issue 1113393002: Adds thunks for getting platform handles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698