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

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

Issue 1880823005: [mojo-edk] Add explicit message object APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « mojo/public/platform/native/system_thunks.h ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "mojo/public/platform/native/system_thunks.h" 5 #include "mojo/public/platform/native/system_thunks.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 MojoResult MojoCancelWatch(MojoHandle handle, uintptr_t context) { 198 MojoResult MojoCancelWatch(MojoHandle handle, uintptr_t context) {
199 assert(g_thunks.CancelWatch); 199 assert(g_thunks.CancelWatch);
200 return g_thunks.CancelWatch(handle, context); 200 return g_thunks.CancelWatch(handle, context);
201 } 201 }
202 202
203 MojoResult MojoFuseMessagePipes(MojoHandle handle0, MojoHandle handle1) { 203 MojoResult MojoFuseMessagePipes(MojoHandle handle0, MojoHandle handle1) {
204 assert(g_thunks.FuseMessagePipes); 204 assert(g_thunks.FuseMessagePipes);
205 return g_thunks.FuseMessagePipes(handle0, handle1); 205 return g_thunks.FuseMessagePipes(handle0, handle1);
206 } 206 }
207 207
208 MojoResult MojoWriteMessageNew(MojoHandle message_pipe_handle,
209 MojoMessageHandle message,
210 MojoWriteMessageFlags flags) {
211 assert(g_thunks.WriteMessageNew);
212 return g_thunks.WriteMessageNew(message_pipe_handle, message, flags);
213 }
214
215 MojoResult MojoReadMessageNew(MojoHandle message_pipe_handle,
216 MojoMessageHandle* message,
217 uint32_t* num_bytes,
218 MojoHandle* handles,
219 uint32_t* num_handles,
220 MojoReadMessageFlags flags) {
221 assert(g_thunks.ReadMessageNew);
222 return g_thunks.ReadMessageNew(message_pipe_handle, message, num_bytes,
223 handles, num_handles, flags);
224 }
225
226 MojoResult MojoAllocMessage(uint32_t num_bytes,
227 const MojoHandle* handles,
228 uint32_t num_handles,
229 MojoAllocMessageFlags flags,
230 MojoMessageHandle* message) {
231 assert(g_thunks.AllocMessage);
232 return g_thunks.AllocMessage(
233 num_bytes, handles, num_handles, flags, message);
234 }
235
236 MojoResult MojoFreeMessage(MojoMessageHandle message) {
237 assert(g_thunks.FreeMessage);
238 return g_thunks.FreeMessage(message);
239 }
240
241 MojoResult MojoGetMessageBuffer(MojoMessageHandle message, void** buffer) {
242 assert(g_thunks.GetMessageBuffer);
243 return g_thunks.GetMessageBuffer(message, buffer);
244 }
245
208 extern "C" THUNK_EXPORT size_t MojoSetSystemThunks( 246 extern "C" THUNK_EXPORT size_t MojoSetSystemThunks(
209 const MojoSystemThunks* system_thunks) { 247 const MojoSystemThunks* system_thunks) {
210 if (system_thunks->size >= sizeof(g_thunks)) 248 if (system_thunks->size >= sizeof(g_thunks))
211 g_thunks = *system_thunks; 249 g_thunks = *system_thunks;
212 return sizeof(g_thunks); 250 return sizeof(g_thunks);
213 } 251 }
214 252
215 } // extern "C" 253 } // extern "C"
OLDNEW
« no previous file with comments | « mojo/public/platform/native/system_thunks.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698