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

Side by Side Diff: mojo/public/platform/native/system_thunks.h

Issue 556813003: Add Go build support for GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: qsr feedback Created 6 years, 3 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
« build/go/go.py ('K') | « mojo/public/go/mojo/system/core.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ 5 #ifndef MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_
6 #define MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ 6 #define MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "mojo/public/c/system/core.h" 10 #include "mojo/public/c/system/core.h"
(...skipping 25 matching lines...) Expand all
36 size_t size; // Should be set to sizeof(MojoSystemThunks). 36 size_t size; // Should be set to sizeof(MojoSystemThunks).
37 MojoTimeTicks (*GetTimeTicksNow)(); 37 MojoTimeTicks (*GetTimeTicksNow)();
38 MojoResult (*Close)(MojoHandle handle); 38 MojoResult (*Close)(MojoHandle handle);
39 MojoResult (*Wait)(MojoHandle handle, 39 MojoResult (*Wait)(MojoHandle handle,
40 MojoHandleSignals signals, 40 MojoHandleSignals signals,
41 MojoDeadline deadline); 41 MojoDeadline deadline);
42 MojoResult (*WaitMany)(const MojoHandle* handles, 42 MojoResult (*WaitMany)(const MojoHandle* handles,
43 const MojoHandleSignals* signals, 43 const MojoHandleSignals* signals,
44 uint32_t num_handles, 44 uint32_t num_handles,
45 MojoDeadline deadline); 45 MojoDeadline deadline);
46 MojoResult (*CreateMessagePipe)(const MojoCreateMessagePipeOptions* options, 46 MojoResult (*CreateMessagePipe)(
47 MojoHandle* message_pipe_handle0, 47 const struct MojoCreateMessagePipeOptions* options,
qsr 2014/09/22 14:35:07 Please add Trung as a reviewer for those changes.
tburkard 2014/09/22 14:45:07 Done.
48 MojoHandle* message_pipe_handle1); 48 MojoHandle* message_pipe_handle0,
49 MojoHandle* message_pipe_handle1);
49 MojoResult (*WriteMessage)(MojoHandle message_pipe_handle, 50 MojoResult (*WriteMessage)(MojoHandle message_pipe_handle,
50 const void* bytes, 51 const void* bytes,
51 uint32_t num_bytes, 52 uint32_t num_bytes,
52 const MojoHandle* handles, 53 const MojoHandle* handles,
53 uint32_t num_handles, 54 uint32_t num_handles,
54 MojoWriteMessageFlags flags); 55 MojoWriteMessageFlags flags);
55 MojoResult (*ReadMessage)(MojoHandle message_pipe_handle, 56 MojoResult (*ReadMessage)(MojoHandle message_pipe_handle,
56 void* bytes, 57 void* bytes,
57 uint32_t* num_bytes, 58 uint32_t* num_bytes,
58 MojoHandle* handles, 59 MojoHandle* handles,
59 uint32_t* num_handles, 60 uint32_t* num_handles,
60 MojoReadMessageFlags flags); 61 MojoReadMessageFlags flags);
61 MojoResult (*CreateDataPipe)(const MojoCreateDataPipeOptions* options, 62 MojoResult (*CreateDataPipe)(const struct MojoCreateDataPipeOptions* options,
62 MojoHandle* data_pipe_producer_handle, 63 MojoHandle* data_pipe_producer_handle,
63 MojoHandle* data_pipe_consumer_handle); 64 MojoHandle* data_pipe_consumer_handle);
64 MojoResult (*WriteData)(MojoHandle data_pipe_producer_handle, 65 MojoResult (*WriteData)(MojoHandle data_pipe_producer_handle,
65 const void* elements, 66 const void* elements,
66 uint32_t* num_elements, 67 uint32_t* num_elements,
67 MojoWriteDataFlags flags); 68 MojoWriteDataFlags flags);
68 MojoResult (*BeginWriteData)(MojoHandle data_pipe_producer_handle, 69 MojoResult (*BeginWriteData)(MojoHandle data_pipe_producer_handle,
69 void** buffer, 70 void** buffer,
70 uint32_t* buffer_num_elements, 71 uint32_t* buffer_num_elements,
71 MojoWriteDataFlags flags); 72 MojoWriteDataFlags flags);
72 MojoResult (*EndWriteData)(MojoHandle data_pipe_producer_handle, 73 MojoResult (*EndWriteData)(MojoHandle data_pipe_producer_handle,
73 uint32_t num_elements_written); 74 uint32_t num_elements_written);
74 MojoResult (*ReadData)(MojoHandle data_pipe_consumer_handle, 75 MojoResult (*ReadData)(MojoHandle data_pipe_consumer_handle,
75 void* elements, 76 void* elements,
76 uint32_t* num_elements, 77 uint32_t* num_elements,
77 MojoReadDataFlags flags); 78 MojoReadDataFlags flags);
78 MojoResult (*BeginReadData)(MojoHandle data_pipe_consumer_handle, 79 MojoResult (*BeginReadData)(MojoHandle data_pipe_consumer_handle,
79 const void** buffer, 80 const void** buffer,
80 uint32_t* buffer_num_elements, 81 uint32_t* buffer_num_elements,
81 MojoReadDataFlags flags); 82 MojoReadDataFlags flags);
82 MojoResult (*EndReadData)(MojoHandle data_pipe_consumer_handle, 83 MojoResult (*EndReadData)(MojoHandle data_pipe_consumer_handle,
83 uint32_t num_elements_read); 84 uint32_t num_elements_read);
84 MojoResult (*CreateSharedBuffer)( 85 MojoResult (*CreateSharedBuffer)(
85 const MojoCreateSharedBufferOptions* options, 86 const struct MojoCreateSharedBufferOptions* options,
86 uint64_t num_bytes, 87 uint64_t num_bytes,
87 MojoHandle* shared_buffer_handle); 88 MojoHandle* shared_buffer_handle);
88 MojoResult (*DuplicateBufferHandle)( 89 MojoResult (*DuplicateBufferHandle)(
89 MojoHandle buffer_handle, 90 MojoHandle buffer_handle,
90 const MojoDuplicateBufferHandleOptions* options, 91 const struct MojoDuplicateBufferHandleOptions* options,
91 MojoHandle* new_buffer_handle); 92 MojoHandle* new_buffer_handle);
92 MojoResult (*MapBuffer)(MojoHandle buffer_handle, 93 MojoResult (*MapBuffer)(MojoHandle buffer_handle,
93 uint64_t offset, 94 uint64_t offset,
94 uint64_t num_bytes, 95 uint64_t num_bytes,
95 void** buffer, 96 void** buffer,
96 MojoMapBufferFlags flags); 97 MojoMapBufferFlags flags);
97 MojoResult (*UnmapBuffer)(void* buffer); 98 MojoResult (*UnmapBuffer)(void* buffer);
98 }; 99 };
99 #pragma pack(pop) 100 #pragma pack(pop)
100 101
101 // Intended to be called from the embedder. Returns a |MojoCore| initialized 102 // Intended to be called from the embedder. Returns a |MojoCore| initialized
102 // to contain pointers to each of the embedder's MojoCore functions. 103 // to contain pointers to each of the embedder's MojoCore functions.
103 inline MojoSystemThunks MojoMakeSystemThunks() { 104 inline struct MojoSystemThunks MojoMakeSystemThunks() {
104 MojoSystemThunks system_thunks = { 105 struct MojoSystemThunks system_thunks = {
105 sizeof(MojoSystemThunks), 106 sizeof(struct MojoSystemThunks),
106 MojoGetTimeTicksNow, 107 MojoGetTimeTicksNow,
107 MojoClose, 108 MojoClose,
108 MojoWait, 109 MojoWait,
109 MojoWaitMany, 110 MojoWaitMany,
110 MojoCreateMessagePipe, 111 MojoCreateMessagePipe,
111 MojoWriteMessage, 112 MojoWriteMessage,
112 MojoReadMessage, 113 MojoReadMessage,
113 MojoCreateDataPipe, 114 MojoCreateDataPipe,
114 MojoWriteData, 115 MojoWriteData,
115 MojoBeginWriteData, 116 MojoBeginWriteData,
116 MojoEndWriteData, 117 MojoEndWriteData,
117 MojoReadData, 118 MojoReadData,
118 MojoBeginReadData, 119 MojoBeginReadData,
119 MojoEndReadData, 120 MojoEndReadData,
120 MojoCreateSharedBuffer, 121 MojoCreateSharedBuffer,
121 MojoDuplicateBufferHandle, 122 MojoDuplicateBufferHandle,
122 MojoMapBuffer, 123 MojoMapBuffer,
123 MojoUnmapBuffer 124 MojoUnmapBuffer
124 }; 125 };
125 return system_thunks; 126 return system_thunks;
126 } 127 }
127 128
128 // Use this type for the function found by dynamically discovering it in 129 // Use this type for the function found by dynamically discovering it in
129 // a DSO linked with mojo_system. For example: 130 // a DSO linked with mojo_system. For example:
130 // MojoSetSystemThunksFn mojo_set_system_thunks_fn = 131 // MojoSetSystemThunksFn mojo_set_system_thunks_fn =
131 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer( 132 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer(
132 // "MojoSetSystemThunks")); 133 // "MojoSetSystemThunks"));
133 // The expected size of |system_thunks} is returned. 134 // The expected size of |system_thunks} is returned.
134 // The contents of |system_thunks| are copied. 135 // The contents of |system_thunks| are copied.
135 typedef size_t (*MojoSetSystemThunksFn)(const MojoSystemThunks* system_thunks); 136 typedef size_t (*MojoSetSystemThunksFn)(
137 const struct MojoSystemThunks* system_thunks);
136 138
137 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ 139 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_
OLDNEW
« build/go/go.py ('K') | « mojo/public/go/mojo/system/core.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698