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

Unified Diff: mojo/public/c/system/thunks.h

Issue 2044023004: Mojo: Eliminate duplicate C API symbols (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 6 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
« no previous file with comments | « mojo/public/c/system/system_export.h ('k') | mojo/public/c/system/thunks.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/system/thunks.h
diff --git a/mojo/public/platform/native/system_thunks.h b/mojo/public/c/system/thunks.h
similarity index 76%
rename from mojo/public/platform/native/system_thunks.h
rename to mojo/public/c/system/thunks.h
index f3b5e8a9d4fc9a4577c8f353300d2c64105efabc..7935fa8403fc592934e647ae3e4c9704ed7a48b0 100644
--- a/mojo/public/platform/native/system_thunks.h
+++ b/mojo/public/c/system/thunks.h
@@ -4,13 +4,14 @@
// Note: This header should be compilable as C.
-#ifndef MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_
-#define MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_
+#ifndef MOJO_PUBLIC_C_SYSTEM_THUNKS_H_
+#define MOJO_PUBLIC_C_SYSTEM_THUNKS_H_
#include <stddef.h>
#include <stdint.h>
#include "mojo/public/c/system/core.h"
+#include "mojo/public/c/system/system_export.h"
// The embedder needs to bind the basic Mojo Core functions of a DSO to those of
// the embedder when loading a DSO that is dependent on mojo_system.
@@ -155,59 +156,19 @@ struct MojoSystemThunks {
};
#pragma pack(pop)
-
-#ifdef __cplusplus
-// Intended to be called from the embedder. Returns a |MojoCore| initialized
-// to contain pointers to each of the embedder's MojoCore functions.
-inline MojoSystemThunks MojoMakeSystemThunks() {
- MojoSystemThunks system_thunks = {sizeof(MojoSystemThunks),
- MojoGetTimeTicksNow,
- MojoClose,
- MojoWait,
- MojoWaitMany,
- MojoCreateMessagePipe,
- MojoWriteMessage,
- MojoReadMessage,
- MojoCreateDataPipe,
- MojoWriteData,
- MojoBeginWriteData,
- MojoEndWriteData,
- MojoReadData,
- MojoBeginReadData,
- MojoEndReadData,
- MojoCreateSharedBuffer,
- MojoDuplicateBufferHandle,
- MojoMapBuffer,
- MojoUnmapBuffer,
- MojoCreateWaitSet,
- MojoAddHandle,
- MojoRemoveHandle,
- MojoGetReadyHandles,
- MojoWatch,
- MojoCancelWatch,
- MojoFuseMessagePipes,
- MojoWriteMessageNew,
- MojoReadMessageNew,
- MojoAllocMessage,
- MojoFreeMessage,
- MojoGetMessageBuffer,
- MojoWrapPlatformHandle,
- MojoUnwrapPlatformHandle,
- MojoWrapPlatformSharedBufferHandle,
- MojoUnwrapPlatformSharedBufferHandle};
- return system_thunks;
-}
-#endif
-
-
// Use this type for the function found by dynamically discovering it in
// a DSO linked with mojo_system. For example:
// MojoSetSystemThunksFn mojo_set_system_thunks_fn =
// reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer(
// "MojoSetSystemThunks"));
-// The expected size of |system_thunks} is returned.
+// The expected size of |system_thunks| is returned.
// The contents of |system_thunks| are copied.
typedef size_t (*MojoSetSystemThunksFn)(
const struct MojoSystemThunks* system_thunks);
-#endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_
+// A function for setting up the embedder's own system thunks. This should only
+// be called by Mojo embedder code.
+MOJO_SYSTEM_EXPORT size_t MojoEmbedderSetSystemThunks(
+ const struct MojoSystemThunks* system_thunks);
+
+#endif // MOJO_PUBLIC_C_SYSTEM_THUNKS_H_
« no previous file with comments | « mojo/public/c/system/system_export.h ('k') | mojo/public/c/system/thunks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698