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

Side by Side Diff: mojo/public/c/system/types.h

Issue 2725133002: Mojo: Armed Watchers (Closed)
Patch Set: . Created 3 years, 9 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 // This file contains types and constants/macros common to different Mojo system 5 // This file contains types and constants/macros common to different Mojo system
6 // APIs. 6 // APIs.
7 // 7 //
8 // Note: This header should be compilable as C. 8 // Note: This header should be compilable as C.
9 9
10 #ifndef MOJO_PUBLIC_C_SYSTEM_TYPES_H_ 10 #ifndef MOJO_PUBLIC_C_SYSTEM_TYPES_H_
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // Note: This struct is not extensible (and only has 32-bit quantities), so it's 175 // Note: This struct is not extensible (and only has 32-bit quantities), so it's
176 // 32-bit-aligned. 176 // 32-bit-aligned.
177 MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int32_t) == 4, "int32_t has weird alignment"); 177 MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int32_t) == 4, "int32_t has weird alignment");
178 struct MOJO_ALIGNAS(4) MojoHandleSignalsState { 178 struct MOJO_ALIGNAS(4) MojoHandleSignalsState {
179 MojoHandleSignals satisfied_signals; 179 MojoHandleSignals satisfied_signals;
180 MojoHandleSignals satisfiable_signals; 180 MojoHandleSignals satisfiable_signals;
181 }; 181 };
182 MOJO_STATIC_ASSERT(sizeof(MojoHandleSignalsState) == 8, 182 MOJO_STATIC_ASSERT(sizeof(MojoHandleSignalsState) == 8,
183 "MojoHandleSignalsState has wrong size"); 183 "MojoHandleSignalsState has wrong size");
184 184
185 // |MojoWatchNotificationFlags|: Passed to a callback invoked as a result of 185 // |MojoWatcherNotificationFlags|: Passed to a callback invoked by a watcher
186 // signals being raised on a handle watched by |MojoWatch()|. May take the 186 // when some observed signals are raised or a watched handle is closed. May take
187 // following values: 187 // on any combination of the following values:
188 // |MOJO_WATCH_NOTIFICATION_FLAG_FROM_SYSTEM| - The callback is being invoked 188 //
189 // as a result of a system-level event rather than a direct API call from 189 // |MOJO_WATCHER_NOTIFICATION_FLAG_FROM_SYSTEM| - The callback is being
190 // user code. This may be used as an indication that user code is safe to 190 // invoked as a result of a system-level event rather than a direct API
191 // call without fear of reentry. 191 // call from user code. This may be used as an indication that user code
192 // is safe to call without fear of reentry.
192 193
193 typedef uint32_t MojoWatchNotificationFlags; 194 typedef uint32_t MojoWatcherNotificationFlags;
194 195
195 #ifdef __cplusplus 196 #ifdef __cplusplus
196 const MojoWatchNotificationFlags MOJO_WATCH_NOTIFICATION_FLAG_NONE = 0; 197 const MojoWatcherNotificationFlags MOJO_WATCHER_NOTIFICATION_FLAG_NONE = 0;
197 const MojoWatchNotificationFlags MOJO_WATCH_NOTIFICATION_FLAG_FROM_SYSTEM = 198 const MojoWatcherNotificationFlags MOJO_WATCHER_NOTIFICATION_FLAG_FROM_SYSTEM =
198 1 << 0; 199 1 << 0;
199 #else 200 #else
200 #define MOJO_WATCH_NOTIFICATION_FLAG_NONE ((MojoWatchNotificationFlags)0) 201 #define MOJO_WATCHER_NOTIFICATION_FLAG_NONE ((MojoWatcherNotificationFlags)0)
201 #define MOJO_WATCH_NOTIFICATION_FLAG_FROM_SYSTEM \ 202 #define MOJO_WATCHER_NOTIFICATION_FLAG_FROM_SYSTEM \
202 ((MojoWatchNotificationFlags)1 << 0); 203 ((MojoWatcherNotificationFlags)1 << 0);
203 #endif 204 #endif
204 205
205 // |MojoPropertyType|: Property types that can be passed to |MojoGetProperty()| 206 // |MojoPropertyType|: Property types that can be passed to |MojoGetProperty()|
206 // to retrieve system properties. May take the following values: 207 // to retrieve system properties. May take the following values:
207 // |MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED| - Whether making synchronous calls 208 // |MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED| - Whether making synchronous calls
208 // (i.e., blocking to wait for a response to an outbound message) is 209 // (i.e., blocking to wait for a response to an outbound message) is
209 // allowed. The property value is of boolean type. If the value is true, 210 // allowed. The property value is of boolean type. If the value is true,
210 // users should refrain from making sync calls. 211 // users should refrain from making sync calls.
211 typedef uint32_t MojoPropertyType; 212 typedef uint32_t MojoPropertyType;
212 213
213 #ifdef __cplusplus 214 #ifdef __cplusplus
214 const MojoPropertyType MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED = 0; 215 const MojoPropertyType MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED = 0;
215 #else 216 #else
216 #define MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED ((MojoPropertyType)0) 217 #define MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED ((MojoPropertyType)0)
217 #endif 218 #endif
218 219
219 #endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_ 220 #endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698