| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_MACOS) | 6 #if defined(TARGET_OS_MACOS) |
| 7 | 7 |
| 8 #include "bin/eventhandler.h" | 8 #include "bin/eventhandler.h" |
| 9 #include "bin/eventhandler_macos.h" | 9 #include "bin/eventhandler_macos.h" |
| 10 | 10 |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 HandleInterruptFd(); | 387 HandleInterruptFd(); |
| 388 } | 388 } |
| 389 } | 389 } |
| 390 | 390 |
| 391 | 391 |
| 392 int64_t EventHandlerImplementation::GetTimeout() { | 392 int64_t EventHandlerImplementation::GetTimeout() { |
| 393 if (!timeout_queue_.HasTimeout()) { | 393 if (!timeout_queue_.HasTimeout()) { |
| 394 return kInfinityTimeout; | 394 return kInfinityTimeout; |
| 395 } | 395 } |
| 396 int64_t millis = timeout_queue_.CurrentTimeout() - | 396 int64_t millis = timeout_queue_.CurrentTimeout() - |
| 397 TimerUtils::GetCurrentTimeMilliseconds(); | 397 TimerUtils::GetCurrentMonotonicMillis(); |
| 398 return (millis < 0) ? 0 : millis; | 398 return (millis < 0) ? 0 : millis; |
| 399 } | 399 } |
| 400 | 400 |
| 401 | 401 |
| 402 void EventHandlerImplementation::HandleTimeout() { | 402 void EventHandlerImplementation::HandleTimeout() { |
| 403 if (timeout_queue_.HasTimeout()) { | 403 if (timeout_queue_.HasTimeout()) { |
| 404 int64_t millis = timeout_queue_.CurrentTimeout() - | 404 int64_t millis = timeout_queue_.CurrentTimeout() - |
| 405 TimerUtils::GetCurrentTimeMilliseconds(); | 405 TimerUtils::GetCurrentMonotonicMillis(); |
| 406 if (millis <= 0) { | 406 if (millis <= 0) { |
| 407 DartUtils::PostNull(timeout_queue_.CurrentPort()); | 407 DartUtils::PostNull(timeout_queue_.CurrentPort()); |
| 408 timeout_queue_.RemoveCurrent(); | 408 timeout_queue_.RemoveCurrent(); |
| 409 } | 409 } |
| 410 } | 410 } |
| 411 } | 411 } |
| 412 | 412 |
| 413 | 413 |
| 414 void EventHandlerImplementation::EventHandlerEntry(uword args) { | 414 void EventHandlerImplementation::EventHandlerEntry(uword args) { |
| 415 static const intptr_t kMaxEvents = 16; | 415 static const intptr_t kMaxEvents = 16; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 | 481 |
| 482 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { | 482 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { |
| 483 // The hashmap does not support keys with value 0. | 483 // The hashmap does not support keys with value 0. |
| 484 return dart::Utils::WordHash(fd + 1); | 484 return dart::Utils::WordHash(fd + 1); |
| 485 } | 485 } |
| 486 | 486 |
| 487 } // namespace bin | 487 } // namespace bin |
| 488 } // namespace dart | 488 } // namespace dart |
| 489 | 489 |
| 490 #endif // defined(TARGET_OS_MACOS) | 490 #endif // defined(TARGET_OS_MACOS) |
| OLD | NEW |