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_ANDROID) | 6 #if defined(TARGET_OS_ANDROID) |
7 | 7 |
8 #include "bin/eventhandler.h" | 8 #include "bin/eventhandler.h" |
9 #include "bin/eventhandler_android.h" | 9 #include "bin/eventhandler_android.h" |
10 | 10 |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 HandleInterruptFd(); | 326 HandleInterruptFd(); |
327 } | 327 } |
328 } | 328 } |
329 | 329 |
330 | 330 |
331 int64_t EventHandlerImplementation::GetTimeout() { | 331 int64_t EventHandlerImplementation::GetTimeout() { |
332 if (!timeout_queue_.HasTimeout()) { | 332 if (!timeout_queue_.HasTimeout()) { |
333 return kInfinityTimeout; | 333 return kInfinityTimeout; |
334 } | 334 } |
335 int64_t millis = timeout_queue_.CurrentTimeout() - | 335 int64_t millis = timeout_queue_.CurrentTimeout() - |
336 TimerUtils::GetCurrentTimeMilliseconds(); | 336 TimerUtils::GetCurrentMonotonicMillis(); |
337 return (millis < 0) ? 0 : millis; | 337 return (millis < 0) ? 0 : millis; |
338 } | 338 } |
339 | 339 |
340 | 340 |
341 void EventHandlerImplementation::HandleTimeout() { | 341 void EventHandlerImplementation::HandleTimeout() { |
342 if (timeout_queue_.HasTimeout()) { | 342 if (timeout_queue_.HasTimeout()) { |
343 int64_t millis = timeout_queue_.CurrentTimeout() - | 343 int64_t millis = timeout_queue_.CurrentTimeout() - |
344 TimerUtils::GetCurrentTimeMilliseconds(); | 344 TimerUtils::GetCurrentMonotonicMillis(); |
345 if (millis <= 0) { | 345 if (millis <= 0) { |
346 DartUtils::PostNull(timeout_queue_.CurrentPort()); | 346 DartUtils::PostNull(timeout_queue_.CurrentPort()); |
347 timeout_queue_.RemoveCurrent(); | 347 timeout_queue_.RemoveCurrent(); |
348 } | 348 } |
349 } | 349 } |
350 } | 350 } |
351 | 351 |
352 | 352 |
353 void EventHandlerImplementation::Poll(uword args) { | 353 void EventHandlerImplementation::Poll(uword args) { |
354 ThreadSignalBlocker signal_blocker(SIGPROF); | 354 ThreadSignalBlocker signal_blocker(SIGPROF); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 | 407 |
408 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { | 408 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { |
409 // The hashmap does not support keys with value 0. | 409 // The hashmap does not support keys with value 0. |
410 return dart::Utils::WordHash(fd + 1); | 410 return dart::Utils::WordHash(fd + 1); |
411 } | 411 } |
412 | 412 |
413 } // namespace bin | 413 } // namespace bin |
414 } // namespace dart | 414 } // namespace dart |
415 | 415 |
416 #endif // defined(TARGET_OS_ANDROID) | 416 #endif // defined(TARGET_OS_ANDROID) |
OLD | NEW |