Chromium Code Reviews| Index: mojo/public/platform/dart/dart_handle_watcher.cc |
| diff --git a/mojo/public/platform/dart/dart_handle_watcher.cc b/mojo/public/platform/dart/dart_handle_watcher.cc |
| index 772f292ea9015144c6a99f6b35dcfe62e10e0520..b0b80d304488c6b88c0b07bc9ea2a7f896aa2639 100644 |
| --- a/mojo/public/platform/dart/dart_handle_watcher.cc |
| +++ b/mojo/public/platform/dart/dart_handle_watcher.cc |
| @@ -39,10 +39,7 @@ static void PostSignal(Dart_Port port, int32_t signalled) { |
| if (port == ILLEGAL_PORT) { |
| return; |
| } |
| - Dart_CObject message; |
| - message.type = Dart_CObject_kInt32; |
| - message.value.as_int32 = signalled; |
| - Dart_PostCObject(port, &message); |
| + Dart_PostInteger(port, signalled); |
| } |
| // The internal state of the handle watcher thread. |
| @@ -306,16 +303,11 @@ void HandleWatcherThreadState::ProcessControlMessage() { |
| } |
| } |
| -// Dart's DateTime class calls gettimeofday to get the time. |
| -// TODO(johnmccutchan): Expose an API in |dart_api.h| that returns the same |
| -// value that DateTime uses. |
| +// Dart's DateTime class uses MojoCoreNatives.timerMillisecondClock(), which |
|
Cutch
2015/12/14 19:07:15
Is this comment correct? DateTime should still cal
zra
2015/12/14 19:21:59
DateTime -> Timer
|
| +// calls MojoGetTimeTicksNow() and divides by 1000; |
| static int64_t GetDartTimeInMillis() { |
| - struct timeval tv; |
| - if (gettimeofday(&tv, nullptr) < 0) { |
| - MOJO_CHECK(false); |
| - return 0; |
| - } |
| - return ((static_cast<int64_t>(tv.tv_sec) * 1000000) + tv.tv_usec) / 1000; |
| + MojoTimeTicks ticks = MojoGetTimeTicksNow(); |
| + return static_cast<int64_t>(ticks) / 1000; |
| } |
| void HandleWatcherThreadState::ProcessTimers() { |