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

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

Issue 847703006: Minor tweaks to API documentation and code comments. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Clarifies comments on MojoTimeTicks and getter function Created 5 years, 11 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_
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|: The amount of time, in units of microseconds, that has
viettrungluu 2015/01/30 22:34:17 How about, simply: "A time delta, in microseconds,
ggowan 2015/01/30 23:17:12 I think that somebody who is coming here to look a
21 // passed since some undefined point in the past. The values are only meaningful
22 // relative to other values obtained from the same device without an intervening
23 // system restart. Such values are guaranteed to be weakly
24 // monotonically-increasing with the passage of real time, meaning they will not
25 // always advance, but they will never go backwards (unlike time values with a
26 // well-defined epoch). Although the units are microseconds, the values should
27 // not be assumed to be at that level of precision. The actual precision varies
28 // depending on hardware and platform, and is typically in the range of ~1-15
29 // ms.
21 30
22 typedef int64_t MojoTimeTicks; 31 typedef int64_t MojoTimeTicks;
23 32
24 // |MojoHandle|: Handles to Mojo objects. 33 // |MojoHandle|: Handles to Mojo objects.
25 // |MOJO_HANDLE_INVALID| - A value that is never a valid handle. 34 // |MOJO_HANDLE_INVALID| - A value that is never a valid handle.
26 35
27 typedef uint32_t MojoHandle; 36 typedef uint32_t MojoHandle;
28 37
29 #ifdef __cplusplus 38 #ifdef __cplusplus
30 const MojoHandle MOJO_HANDLE_INVALID = 0; 39 const MojoHandle MOJO_HANDLE_INVALID = 0;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 // 32-bit-aligned. 186 // 32-bit-aligned.
178 MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int32_t) == 4, "int32_t has weird alignment"); 187 MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int32_t) == 4, "int32_t has weird alignment");
179 struct MOJO_ALIGNAS(4) MojoHandleSignalsState { 188 struct MOJO_ALIGNAS(4) MojoHandleSignalsState {
180 MojoHandleSignals satisfied_signals; 189 MojoHandleSignals satisfied_signals;
181 MojoHandleSignals satisfiable_signals; 190 MojoHandleSignals satisfiable_signals;
182 }; 191 };
183 MOJO_STATIC_ASSERT(sizeof(MojoHandleSignalsState) == 8, 192 MOJO_STATIC_ASSERT(sizeof(MojoHandleSignalsState) == 8,
184 "MojoHandleSignalsState has wrong size"); 193 "MojoHandleSignalsState has wrong size");
185 194
186 #endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_ 195 #endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698