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

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

Issue 2043713004: Mojo: Add NotifyBadMessage API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
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 // Note: This header should be compilable as C. 5 // Note: This header should be compilable as C.
6 6
7 #ifndef MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ 7 #ifndef MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_
8 #define MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ 8 #define MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_
9 9
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 MojoResult (*WrapPlatformSharedBufferHandle)( 145 MojoResult (*WrapPlatformSharedBufferHandle)(
146 const struct MojoPlatformHandle* platform_handle, 146 const struct MojoPlatformHandle* platform_handle,
147 size_t num_bytes, 147 size_t num_bytes,
148 MojoPlatformSharedBufferHandleFlags flags, 148 MojoPlatformSharedBufferHandleFlags flags,
149 MojoHandle* mojo_handle); 149 MojoHandle* mojo_handle);
150 MojoResult (*UnwrapPlatformSharedBufferHandle)( 150 MojoResult (*UnwrapPlatformSharedBufferHandle)(
151 MojoHandle mojo_handle, 151 MojoHandle mojo_handle,
152 struct MojoPlatformHandle* platform_handle, 152 struct MojoPlatformHandle* platform_handle,
153 size_t* num_bytes, 153 size_t* num_bytes,
154 MojoPlatformSharedBufferHandleFlags* flags); 154 MojoPlatformSharedBufferHandleFlags* flags);
155 MojoResult (*NotifyBadMessage)(MojoMessageHandle message);
155 }; 156 };
156 #pragma pack(pop) 157 #pragma pack(pop)
157 158
158 159
159 #ifdef __cplusplus 160 #ifdef __cplusplus
160 // Intended to be called from the embedder. Returns a |MojoCore| initialized 161 // Intended to be called from the embedder. Returns a |MojoCore| initialized
161 // to contain pointers to each of the embedder's MojoCore functions. 162 // to contain pointers to each of the embedder's MojoCore functions.
162 inline MojoSystemThunks MojoMakeSystemThunks() { 163 inline MojoSystemThunks MojoMakeSystemThunks() {
163 MojoSystemThunks system_thunks = {sizeof(MojoSystemThunks), 164 MojoSystemThunks system_thunks = {sizeof(MojoSystemThunks),
164 MojoGetTimeTicksNow, 165 MojoGetTimeTicksNow,
(...skipping 22 matching lines...) Expand all
187 MojoCancelWatch, 188 MojoCancelWatch,
188 MojoFuseMessagePipes, 189 MojoFuseMessagePipes,
189 MojoWriteMessageNew, 190 MojoWriteMessageNew,
190 MojoReadMessageNew, 191 MojoReadMessageNew,
191 MojoAllocMessage, 192 MojoAllocMessage,
192 MojoFreeMessage, 193 MojoFreeMessage,
193 MojoGetMessageBuffer, 194 MojoGetMessageBuffer,
194 MojoWrapPlatformHandle, 195 MojoWrapPlatformHandle,
195 MojoUnwrapPlatformHandle, 196 MojoUnwrapPlatformHandle,
196 MojoWrapPlatformSharedBufferHandle, 197 MojoWrapPlatformSharedBufferHandle,
197 MojoUnwrapPlatformSharedBufferHandle}; 198 MojoUnwrapPlatformSharedBufferHandle,
199 MojoNotifyBadMessage};
198 return system_thunks; 200 return system_thunks;
199 } 201 }
200 #endif 202 #endif
201 203
202 204
203 // Use this type for the function found by dynamically discovering it in 205 // Use this type for the function found by dynamically discovering it in
204 // a DSO linked with mojo_system. For example: 206 // a DSO linked with mojo_system. For example:
205 // MojoSetSystemThunksFn mojo_set_system_thunks_fn = 207 // MojoSetSystemThunksFn mojo_set_system_thunks_fn =
206 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer( 208 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer(
207 // "MojoSetSystemThunks")); 209 // "MojoSetSystemThunks"));
208 // The expected size of |system_thunks} is returned. 210 // The expected size of |system_thunks} is returned.
209 // The contents of |system_thunks| are copied. 211 // The contents of |system_thunks| are copied.
210 typedef size_t (*MojoSetSystemThunksFn)( 212 typedef size_t (*MojoSetSystemThunksFn)(
211 const struct MojoSystemThunks* system_thunks); 213 const struct MojoSystemThunks* system_thunks);
212 214
213 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ 215 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698