Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 // |MojoWatchNotificationFlags|: Passed to a callback invoked by an armed |
|
yzshen1
2017/03/03 00:03:50
nit: strictly speaking the callback may be called
Ken Rockot(use gerrit already)
2017/03/03 00:37:05
done
| |
| 186 // signals being raised on a handle watched by |MojoWatch()|. May take the | 186 // watcher when its observed signals are raised. May take the following values: |
| 187 // following values: | 187 // |
| 188 // |MOJO_WATCH_NOTIFICATION_FLAG_FROM_SYSTEM| - The callback is being invoked | 188 // |MOJO_WATCH_NOTIFICATION_FLAG_FROM_SYSTEM| - The callback is being invoked |
| 189 // as a result of a system-level event rather than a direct API call from | 189 // as a result of a system-level event rather than a direct API call from |
| 190 // user code. This may be used as an indication that user code is safe to | 190 // user code. This may be used as an indication that user code is safe to |
| 191 // call without fear of reentry. | 191 // call without fear of reentry. |
| 192 | 192 |
| 193 typedef uint32_t MojoWatchNotificationFlags; | 193 typedef uint32_t MojoWatchNotificationFlags; |
| 194 | 194 |
| 195 #ifdef __cplusplus | 195 #ifdef __cplusplus |
| 196 const MojoWatchNotificationFlags MOJO_WATCH_NOTIFICATION_FLAG_NONE = 0; | 196 const MojoWatchNotificationFlags MOJO_WATCH_NOTIFICATION_FLAG_NONE = 0; |
| 197 const MojoWatchNotificationFlags MOJO_WATCH_NOTIFICATION_FLAG_FROM_SYSTEM = | 197 const MojoWatchNotificationFlags MOJO_WATCH_NOTIFICATION_FLAG_FROM_SYSTEM = |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 210 // users should refrain from making sync calls. | 210 // users should refrain from making sync calls. |
| 211 typedef uint32_t MojoPropertyType; | 211 typedef uint32_t MojoPropertyType; |
| 212 | 212 |
| 213 #ifdef __cplusplus | 213 #ifdef __cplusplus |
| 214 const MojoPropertyType MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED = 0; | 214 const MojoPropertyType MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED = 0; |
| 215 #else | 215 #else |
| 216 #define MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED ((MojoPropertyType)0) | 216 #define MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED ((MojoPropertyType)0) |
| 217 #endif | 217 #endif |
| 218 | 218 |
| 219 #endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_ | 219 #endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_ |
| OLD | NEW |