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

Side by Side Diff: runtime/vm/os_fuchsia.cc

Issue 2519133005: Enable SecureSocket on Fuchsia using BoringSSL (Closed)
Patch Set: . Created 4 years 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 (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_OS_FUCHSIA) 6 #if defined(TARGET_OS_FUCHSIA)
7 7
8 #include "vm/os.h" 8 #include "vm/os.h"
9 9
10 #include <errno.h> 10 #include <errno.h>
11 #include <magenta/syscalls.h> 11 #include <magenta/syscalls.h>
12 #include <magenta/types.h> 12 #include <magenta/types.h>
13 #include <sys/time.h>
13 14
14 #include "platform/assert.h" 15 #include "platform/assert.h"
15 #include "vm/zone.h" 16 #include "vm/zone.h"
16 17
17 namespace dart { 18 namespace dart {
18 19
19 #ifndef PRODUCT 20 #ifndef PRODUCT
20 21
21 DEFINE_FLAG(bool, 22 DEFINE_FLAG(bool,
22 generate_perf_events_symbols, 23 generate_perf_events_symbols,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 return static_cast<int>(-timezone); 71 return static_cast<int>(-timezone);
71 } 72 }
72 73
73 74
74 int64_t OS::GetCurrentTimeMillis() { 75 int64_t OS::GetCurrentTimeMillis() {
75 return GetCurrentTimeMicros() / 1000; 76 return GetCurrentTimeMicros() / 1000;
76 } 77 }
77 78
78 79
79 int64_t OS::GetCurrentTimeMicros() { 80 int64_t OS::GetCurrentTimeMicros() {
80 return mx_time_get(MX_CLOCK_MONOTONIC) / 1000; 81 struct timeval tv;
82 if (gettimeofday(&tv, NULL) < 0) {
83 UNREACHABLE();
84 return 0;
85 }
86 return (static_cast<int64_t>(tv.tv_sec) * 1000000) + tv.tv_usec;
81 } 87 }
82 88
83 89
84 int64_t OS::GetCurrentMonotonicTicks() { 90 int64_t OS::GetCurrentMonotonicTicks() {
85 return mx_time_get(MX_CLOCK_MONOTONIC); 91 return mx_time_get(MX_CLOCK_MONOTONIC);
86 } 92 }
87 93
88 94
89 int64_t OS::GetCurrentMonotonicFrequency() { 95 int64_t OS::GetCurrentMonotonicFrequency() {
90 return kNanosecondsPerSecond; 96 return kNanosecondsPerSecond;
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 } 312 }
307 313
308 314
309 void OS::Exit(int code) { 315 void OS::Exit(int code) {
310 UNIMPLEMENTED(); 316 UNIMPLEMENTED();
311 } 317 }
312 318
313 } // namespace dart 319 } // namespace dart
314 320
315 #endif // defined(TARGET_OS_FUCHSIA) 321 #endif // defined(TARGET_OS_FUCHSIA)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698