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

Unified Diff: runtime/bin/eventhandler_win.cc

Issue 12280004: Moved GetCurrentTime functions from bin/eventhandler to bin/utils. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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_macos.cc ('k') | runtime/bin/utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/eventhandler_win.cc
===================================================================
--- runtime/bin/eventhandler_win.cc (revision 18591)
+++ runtime/bin/eventhandler_win.cc (working copy)
@@ -13,6 +13,7 @@
#include "bin/dartutils.h"
#include "bin/log.h"
#include "bin/socket.h"
+#include "bin/utils.h"
#include "platform/thread.h"
@@ -21,23 +22,6 @@
static const int kShutdownId = -2;
-int64_t GetCurrentTimeMilliseconds() {
- static const int64_t kTimeEpoc = 116444736000000000LL;
-
- // Although win32 uses 64-bit integers for representing timestamps,
- // these are packed into a FILETIME structure. The FILETIME structure
- // is just a struct representing a 64-bit integer. The TimeStamp union
- // allows access to both a FILETIME and an integer representation of
- // the timestamp.
- union TimeStamp {
- FILETIME ft_;
- int64_t t_;
- };
- TimeStamp time;
- GetSystemTimeAsFileTime(&time.ft_);
- return (time.t_ - kTimeEpoc) / 10000;
-}
-
IOBuffer* IOBuffer::AllocateBuffer(int buffer_size, Operation operation) {
IOBuffer* buffer = new(buffer_size) IOBuffer(buffer_size, operation);
return buffer;
@@ -858,7 +842,7 @@
if (timeout_ == kInfinityTimeout) {
return kInfinityTimeout;
}
- intptr_t millis = timeout_ - GetCurrentTimeMilliseconds();
+ intptr_t millis = timeout_ - TimerUtils::GetCurrentTimeMilliseconds();
return (millis < 0) ? 0 : millis;
}
« no previous file with comments | « runtime/bin/eventhandler_macos.cc ('k') | runtime/bin/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698