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 | |
18 // (typically they'll be ignored), not necessarily an error. | |
19 | |
20 // |MojoTimeTicks|: A time delta, in microseconds, the meaning of which is | 17 // |MojoTimeTicks|: A time delta, in microseconds, the meaning of which is |
21 // source-dependent. | 18 // source-dependent. |
22 | 19 |
23 typedef int64_t MojoTimeTicks; | 20 typedef int64_t MojoTimeTicks; |
24 | 21 |
25 // |MojoHandle|: Handles to Mojo objects. | 22 // |MojoHandle|: Handles to Mojo objects. |
26 // |MOJO_HANDLE_INVALID| - A value that is never a valid handle. | 23 // |MOJO_HANDLE_INVALID| - A value that is never a valid handle. |
27 | 24 |
28 typedef uint32_t MojoHandle; | 25 typedef uint32_t MojoHandle; |
29 | 26 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // |MOJO_RESULT_BUSY| - One of the resources involved is currently being used | 74 // |MOJO_RESULT_BUSY| - One of the resources involved is currently being used |
78 // (possibly on another thread) in a way that prevents the current | 75 // (possibly on another thread) in a way that prevents the current |
79 // operation from proceeding, e.g., if the other operation may result in | 76 // operation from proceeding, e.g., if the other operation may result in |
80 // the resource being invalidated. | 77 // the resource being invalidated. |
81 // |MOJO_RESULT_SHOULD_WAIT| - The request cannot currently be completed | 78 // |MOJO_RESULT_SHOULD_WAIT| - The request cannot currently be completed |
82 // (e.g., if the data requested is not yet available). The caller should | 79 // (e.g., if the data requested is not yet available). The caller should |
83 // wait for it to be feasible using a watcher. | 80 // wait for it to be feasible using a watcher. |
84 // | 81 // |
85 // The codes from |MOJO_RESULT_OK| to |MOJO_RESULT_DATA_LOSS| come from | 82 // The codes from |MOJO_RESULT_OK| to |MOJO_RESULT_DATA_LOSS| come from |
86 // Google3's canonical error codes. | 83 // Google3's canonical error codes. |
87 // | |
88 // TODO(vtl): Add a |MOJO_RESULT_UNSATISFIABLE|? | |
89 | 84 |
90 typedef uint32_t MojoResult; | 85 typedef uint32_t MojoResult; |
91 | 86 |
92 #ifdef __cplusplus | 87 #ifdef __cplusplus |
93 const MojoResult MOJO_RESULT_OK = 0; | 88 const MojoResult MOJO_RESULT_OK = 0; |
94 const MojoResult MOJO_RESULT_CANCELLED = 1; | 89 const MojoResult MOJO_RESULT_CANCELLED = 1; |
95 const MojoResult MOJO_RESULT_UNKNOWN = 2; | 90 const MojoResult MOJO_RESULT_UNKNOWN = 2; |
96 const MojoResult MOJO_RESULT_INVALID_ARGUMENT = 3; | 91 const MojoResult MOJO_RESULT_INVALID_ARGUMENT = 3; |
97 const MojoResult MOJO_RESULT_DEADLINE_EXCEEDED = 4; | 92 const MojoResult MOJO_RESULT_DEADLINE_EXCEEDED = 4; |
98 const MojoResult MOJO_RESULT_NOT_FOUND = 5; | 93 const MojoResult MOJO_RESULT_NOT_FOUND = 5; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 // users should refrain from making sync calls. | 214 // users should refrain from making sync calls. |
220 typedef uint32_t MojoPropertyType; | 215 typedef uint32_t MojoPropertyType; |
221 | 216 |
222 #ifdef __cplusplus | 217 #ifdef __cplusplus |
223 const MojoPropertyType MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED = 0; | 218 const MojoPropertyType MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED = 0; |
224 #else | 219 #else |
225 #define MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED ((MojoPropertyType)0) | 220 #define MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED ((MojoPropertyType)0) |
226 #endif | 221 #endif |
227 | 222 |
228 #endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_ | 223 #endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_ |
OLD | NEW |