| 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 | 9 |
| 10 #include <errno.h> // NOLINT | 10 #include <errno.h> // NOLINT |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 if (timeout_ == kInfinityTimeout) { | 354 if (timeout_ == kInfinityTimeout) { |
| 355 return kInfinityTimeout; | 355 return kInfinityTimeout; |
| 356 } | 356 } |
| 357 int64_t millis = timeout_ - TimerUtils::GetCurrentTimeMilliseconds(); | 357 int64_t millis = timeout_ - TimerUtils::GetCurrentTimeMilliseconds(); |
| 358 return (millis < 0) ? 0 : millis; | 358 return (millis < 0) ? 0 : millis; |
| 359 } | 359 } |
| 360 | 360 |
| 361 | 361 |
| 362 void EventHandlerImplementation::HandleTimeout() { | 362 void EventHandlerImplementation::HandleTimeout() { |
| 363 if (timeout_ != kInfinityTimeout) { | 363 if (timeout_ != kInfinityTimeout) { |
| 364 intptr_t millis = timeout_ - TimerUtils::GetCurrentTimeMilliseconds(); | 364 int64_t millis = timeout_ - TimerUtils::GetCurrentTimeMilliseconds(); |
| 365 if (millis <= 0) { | 365 if (millis <= 0) { |
| 366 DartUtils::PostNull(timeout_port_); | 366 DartUtils::PostNull(timeout_port_); |
| 367 timeout_ = kInfinityTimeout; | 367 timeout_ = kInfinityTimeout; |
| 368 timeout_port_ = 0; | 368 timeout_port_ = 0; |
| 369 } | 369 } |
| 370 } | 370 } |
| 371 } | 371 } |
| 372 | 372 |
| 373 | 373 |
| 374 void EventHandlerImplementation::EventHandlerEntry(uword args) { | 374 void EventHandlerImplementation::EventHandlerEntry(uword args) { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 | 437 |
| 438 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { | 438 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { |
| 439 // The hashmap does not support keys with value 0. | 439 // The hashmap does not support keys with value 0. |
| 440 return dart::Utils::WordHash(fd + 1); | 440 return dart::Utils::WordHash(fd + 1); |
| 441 } | 441 } |
| 442 | 442 |
| 443 } // namespace bin | 443 } // namespace bin |
| 444 } // namespace dart | 444 } // namespace dart |
| 445 | 445 |
| 446 #endif // defined(TARGET_OS_MACOS) | 446 #endif // defined(TARGET_OS_MACOS) |
| OLD | NEW |