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

Unified Diff: runtime/bin/eventhandler_android.cc

Issue 17878002: Change the timeout handling in the standalone VM to use 64-bit integers (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 years, 6 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/eventhandler_android.h ('k') | runtime/bin/eventhandler_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/eventhandler_android.cc
diff --git a/runtime/bin/eventhandler_android.cc b/runtime/bin/eventhandler_android.cc
index c043c2dbc824fe90ba255c78818eaa40b91a6a21..10f482b0c91a652ccd51b8a37348ad20e603f3b9 100644
--- a/runtime/bin/eventhandler_android.cc
+++ b/runtime/bin/eventhandler_android.cc
@@ -350,11 +350,11 @@ void EventHandlerImplementation::HandleEvents(struct epoll_event* events,
}
-intptr_t EventHandlerImplementation::GetTimeout() {
+int64_t EventHandlerImplementation::GetTimeout() {
if (timeout_ == kInfinityTimeout) {
return kInfinityTimeout;
}
- intptr_t millis = timeout_ - TimerUtils::GetCurrentTimeMilliseconds();
+ int64_t millis = timeout_ - TimerUtils::GetCurrentTimeMilliseconds();
return (millis < 0) ? 0 : millis;
}
@@ -378,7 +378,9 @@ void EventHandlerImplementation::Poll(uword args) {
reinterpret_cast<EventHandlerImplementation*>(args);
ASSERT(handler != NULL);
while (!handler->shutdown_) {
- intptr_t millis = handler->GetTimeout();
+ int64_t millis = handler->GetTimeout();
+ ASSERT(millis == kInfinityTimeout || millis >= 0);
+ if (millis > kMaxInt32) millis = kMaxInt32;
intptr_t result = TEMP_FAILURE_RETRY(epoll_wait(handler->epoll_fd_,
events,
kMaxEvents,
« no previous file with comments | « runtime/bin/eventhandler_android.h ('k') | runtime/bin/eventhandler_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698