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

Unified Diff: runtime/bin/utils_macos.cc

Issue 1800863002: Cleanup in //runtime/bin (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 | « runtime/bin/utils_linux.cc ('k') | runtime/bin/utils_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/utils_macos.cc
diff --git a/runtime/bin/utils_macos.cc b/runtime/bin/utils_macos.cc
index eea4cb750b077503736bc228d18a32d445e5163c..136881d37f580d5af238492ecdcb9f6e891673c5 100644
--- a/runtime/bin/utils_macos.cc
+++ b/runtime/bin/utils_macos.cc
@@ -6,22 +6,20 @@
#if defined(TARGET_OS_MACOS)
#include <errno.h> // NOLINT
-#include <netdb.h> // NOLINT
-#include <mach/mach.h> // NOLINT
#include <mach/clock.h> // NOLINT
+#include <mach/mach.h> // NOLINT
#include <mach/mach_time.h> // NOLINT
-#include <sys/time.h> // NOLINT
-#include <time.h> // NOLINT
-
+#include <netdb.h> // NOLINT
#if TARGET_OS_IOS
#include <sys/sysctl.h> // NOLINT
#endif
+#include <sys/time.h> // NOLINT
+#include <time.h> // NOLINT
#include "bin/utils.h"
#include "platform/assert.h"
#include "platform/utils.h"
-
namespace dart {
namespace bin {
@@ -50,47 +48,55 @@ void OSError::SetCodeAndMessage(SubSystem sub_system, int code) {
}
}
+
const char* StringUtils::ConsoleStringToUtf8(
const char* str, intptr_t len, intptr_t* result_len) {
UNIMPLEMENTED();
return NULL;
}
+
const char* StringUtils::Utf8ToConsoleString(
const char* utf8, intptr_t len, intptr_t* result_len) {
UNIMPLEMENTED();
return NULL;
}
+
char* StringUtils::ConsoleStringToUtf8(
char* str, intptr_t len, intptr_t* result_len) {
UNIMPLEMENTED();
return NULL;
}
+
char* StringUtils::Utf8ToConsoleString(
char* utf8, intptr_t len, intptr_t* result_len) {
UNIMPLEMENTED();
return NULL;
}
+
bool ShellUtils::GetUtf8Argv(int argc, char** argv) {
return false;
}
+
static mach_timebase_info_data_t timebase_info;
+
void TimerUtils::InitOnce() {
kern_return_t kr = mach_timebase_info(&timebase_info);
ASSERT(KERN_SUCCESS == kr);
}
+
int64_t TimerUtils::GetCurrentMonotonicMillis() {
return GetCurrentMonotonicMicros() / 1000;
}
-#if TARGET_OS_IOS
+#if TARGET_OS_IOS
static int64_t GetCurrentTimeMicros() {
// gettimeofday has microsecond resolution.
struct timeval tv;
@@ -100,9 +106,9 @@ static int64_t GetCurrentTimeMicros() {
}
return (static_cast<int64_t>(tv.tv_sec) * 1000000) + tv.tv_usec;
}
-
#endif // TARGET_OS_IOS
+
int64_t TimerUtils::GetCurrentMonotonicMicros() {
#if TARGET_OS_IOS
// On iOS mach_absolute_time stops while the device is sleeping. Instead use
@@ -129,6 +135,7 @@ int64_t TimerUtils::GetCurrentMonotonicMicros() {
#endif // TARGET_OS_IOS
}
+
void TimerUtils::Sleep(int64_t millis) {
struct timespec req; // requested.
struct timespec rem; // remainder.
« no previous file with comments | « runtime/bin/utils_linux.cc ('k') | runtime/bin/utils_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698