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

Unified Diff: runtime/vm/os_fuchsia.cc

Issue 2519133005: Enable SecureSocket on Fuchsia using BoringSSL (Closed)
Patch Set: . Created 4 years, 1 month 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
Index: runtime/vm/os_fuchsia.cc
diff --git a/runtime/vm/os_fuchsia.cc b/runtime/vm/os_fuchsia.cc
index d6b96711ecefe0f88524d577b8b5892adc291ed5..6c13dde3a4e243f2373027fcf5d1f5f230a6fe8c 100644
--- a/runtime/vm/os_fuchsia.cc
+++ b/runtime/vm/os_fuchsia.cc
@@ -10,6 +10,7 @@
#include <errno.h>
#include <magenta/syscalls.h>
#include <magenta/types.h>
+#include <sys/time.h>
#include "platform/assert.h"
#include "vm/zone.h"
@@ -77,7 +78,12 @@ int64_t OS::GetCurrentTimeMillis() {
int64_t OS::GetCurrentTimeMicros() {
- return mx_time_get(MX_CLOCK_MONOTONIC) / 1000;
+ struct timeval tv;
+ if (gettimeofday(&tv, NULL) < 0) {
+ UNREACHABLE();
+ return 0;
+ }
+ return (static_cast<int64_t>(tv.tv_sec) * 1000000) + tv.tv_usec;
}

Powered by Google App Engine
This is Rietveld 408576698