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_ |
11 #define MOJO_PUBLIC_C_SYSTEM_TYPES_H_ | 11 #define MOJO_PUBLIC_C_SYSTEM_TYPES_H_ |
12 | 12 |
13 #include <stdint.h> | 13 #include <stdint.h> |
14 | 14 |
15 #include "mojo/public/c/system/macros.h" | 15 #include "mojo/public/c/system/macros.h" |
16 | 16 |
17 // TODO(vtl): Notes: Use of undefined flags will lead to undefined behavior | 17 // TODO(vtl): Notes: Use of undefined flags will lead to undefined behavior |
18 // (typically they'll be ignored), not necessarily an error. | 18 // (typically they'll be ignored), not necessarily an error. |
19 | 19 |
20 // |MojoTimeTicks|: Used to specify time ticks. Value is in microseconds. | 20 // |MojoTimeTicks|: Platform-dependent, monotonically increasing tick count |
viettrungluu
2015/01/16 17:32:26
This comment is strictly worse than the previous v
ggowan
2015/01/16 23:30:34
Thanks for the feedback. I was confused by the dif
| |
21 // representing time. The resolution of this clock is ~1-15ms. Resolution | |
22 // varies depending on hardware/operating system configuration. | |
21 | 23 |
22 typedef int64_t MojoTimeTicks; | 24 typedef int64_t MojoTimeTicks; |
23 | 25 |
24 // |MojoHandle|: Handles to Mojo objects. | 26 // |MojoHandle|: Handles to Mojo objects. |
25 // |MOJO_HANDLE_INVALID| - A value that is never a valid handle. | 27 // |MOJO_HANDLE_INVALID| - A value that is never a valid handle. |
26 | 28 |
27 typedef uint32_t MojoHandle; | 29 typedef uint32_t MojoHandle; |
28 | 30 |
29 #ifdef __cplusplus | 31 #ifdef __cplusplus |
30 const MojoHandle MOJO_HANDLE_INVALID = 0; | 32 const MojoHandle MOJO_HANDLE_INVALID = 0; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 // 32-bit-aligned. | 179 // 32-bit-aligned. |
178 MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int32_t) == 4, "int32_t has weird alignment"); | 180 MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int32_t) == 4, "int32_t has weird alignment"); |
179 struct MOJO_ALIGNAS(4) MojoHandleSignalsState { | 181 struct MOJO_ALIGNAS(4) MojoHandleSignalsState { |
180 MojoHandleSignals satisfied_signals; | 182 MojoHandleSignals satisfied_signals; |
181 MojoHandleSignals satisfiable_signals; | 183 MojoHandleSignals satisfiable_signals; |
182 }; | 184 }; |
183 MOJO_STATIC_ASSERT(sizeof(MojoHandleSignalsState) == 8, | 185 MOJO_STATIC_ASSERT(sizeof(MojoHandleSignalsState) == 8, |
184 "MojoHandleSignalsState has wrong size"); | 186 "MojoHandleSignalsState has wrong size"); |
185 | 187 |
186 #endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_ | 188 #endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_ |
OLD | NEW |