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

Side by Side Diff: runtime/bin/eventhandler_android.cc

Issue 17888002: Change the timeout handling in the standalone VM to use 64-bit integers - take 2 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/bin/eventhandler_macos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 9
10 #include <errno.h> // NOLINT 10 #include <errno.h> // NOLINT
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::Poll(uword args) { 374 void EventHandlerImplementation::Poll(uword args) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 427
428 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { 428 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) {
429 // The hashmap does not support keys with value 0. 429 // The hashmap does not support keys with value 0.
430 return dart::Utils::WordHash(fd + 1); 430 return dart::Utils::WordHash(fd + 1);
431 } 431 }
432 432
433 } // namespace bin 433 } // namespace bin
434 } // namespace dart 434 } // namespace dart
435 435
436 #endif // defined(TARGET_OS_ANDROID) 436 #endif // defined(TARGET_OS_ANDROID)
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/eventhandler_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698