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

Unified Diff: mojo/edk/embedder/platform_support.h

Issue 1345583002: Add GetTimeTicksNow() to PlatformSupport. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: clarify Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/embedder/BUILD.gn ('k') | mojo/edk/embedder/simple_platform_support.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/embedder/platform_support.h
diff --git a/mojo/edk/embedder/platform_support.h b/mojo/edk/embedder/platform_support.h
index 02186161082252032a601d863a074d0f1294bae1..5b4f0ac23381bb1e9b63db81c213992c48908277 100644
--- a/mojo/edk/embedder/platform_support.h
+++ b/mojo/edk/embedder/platform_support.h
@@ -9,6 +9,7 @@
#include "mojo/edk/embedder/scoped_platform_handle.h"
#include "mojo/edk/system/system_impl_export.h"
+#include "mojo/public/c/system/types.h"
#include "mojo/public/cpp/system/macros.h"
namespace mojo {
@@ -23,6 +24,23 @@ class MOJO_SYSTEM_IMPL_EXPORT PlatformSupport {
public:
virtual ~PlatformSupport() {}
+ // Gets a "time-ticks" value:
+ // - The value should be nondecreasing with respect to time/causality.
+ // - The value should be in microseconds (i.e., if a caller runs
+ // continuously, getting the value twice, their difference should be
+ // approximately the real time elapsed between the samples, in
+ // microseconds).
+ // - The value should be nonnegative.
+ // - The behaviour of the value if execution is suspended (i.e., the
+ // computer "sleeps") is undefined (i.e., this is not a real-time clock),
+ // except that it must remain monotonic.
+ // - As observable, monotonicity should hold across threads.
+ // If multiple |PlatformSupport| implementations/instances are used in a
+ // single system, all implementations must agree (i.e., respect the above as
+ // if there were only a single |PlatformSupport|).
+ virtual MojoTimeTicks GetTimeTicksNow() = 0;
+
+ // Gets cryptographically-secure (pseudo)random bytes.
virtual void GetCryptoRandomBytes(void* bytes, size_t num_bytes) = 0;
virtual PlatformSharedBuffer* CreateSharedBuffer(size_t num_bytes) = 0;
« no previous file with comments | « mojo/edk/embedder/BUILD.gn ('k') | mojo/edk/embedder/simple_platform_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698