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

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

Issue 1519563003: Use a monotonic clock in the implementation of Timer. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « runtime/bin/eventhandler_patch.dart ('k') | runtime/bin/io_natives.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_WINDOWS) 6 #if defined(TARGET_OS_WINDOWS)
7 7
8 #include "bin/eventhandler.h" 8 #include "bin/eventhandler.h"
9 #include "bin/eventhandler_win.h" 9 #include "bin/eventhandler_win.h"
10 10
(...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1345 delete startup_monitor_; 1345 delete startup_monitor_;
1346 CloseHandle(completion_port_); 1346 CloseHandle(completion_port_);
1347 } 1347 }
1348 1348
1349 1349
1350 int64_t EventHandlerImplementation::GetTimeout() { 1350 int64_t EventHandlerImplementation::GetTimeout() {
1351 if (!timeout_queue_.HasTimeout()) { 1351 if (!timeout_queue_.HasTimeout()) {
1352 return kInfinityTimeout; 1352 return kInfinityTimeout;
1353 } 1353 }
1354 int64_t millis = timeout_queue_.CurrentTimeout() - 1354 int64_t millis = timeout_queue_.CurrentTimeout() -
1355 TimerUtils::GetCurrentTimeMilliseconds(); 1355 TimerUtils::GetCurrentMonotonicMillis();
1356 return (millis < 0) ? 0 : millis; 1356 return (millis < 0) ? 0 : millis;
1357 } 1357 }
1358 1358
1359 1359
1360 void EventHandlerImplementation::SendData(intptr_t id, 1360 void EventHandlerImplementation::SendData(intptr_t id,
1361 Dart_Port dart_port, 1361 Dart_Port dart_port,
1362 int64_t data) { 1362 int64_t data) {
1363 InterruptMessage* msg = new InterruptMessage; 1363 InterruptMessage* msg = new InterruptMessage;
1364 msg->id = id; 1364 msg->id = id;
1365 msg->dart_port = dart_port; 1365 msg->dart_port = dart_port;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
1463 1463
1464 1464
1465 void EventHandlerImplementation::Shutdown() { 1465 void EventHandlerImplementation::Shutdown() {
1466 SendData(kShutdownId, 0, 0); 1466 SendData(kShutdownId, 0, 0);
1467 } 1467 }
1468 1468
1469 } // namespace bin 1469 } // namespace bin
1470 } // namespace dart 1470 } // namespace dart
1471 1471
1472 #endif // defined(TARGET_OS_WINDOWS) 1472 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « runtime/bin/eventhandler_patch.dart ('k') | runtime/bin/io_natives.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698