Chromium Code Reviews| Index: runtime/bin/eventhandler_win.cc |
| diff --git a/runtime/bin/eventhandler_win.cc b/runtime/bin/eventhandler_win.cc |
| index 6819fce44ee4fb2a76f0eda7724d23b0de2ea25a..e6735e60df34ee7d123fb544a16e8d5d6e32e5f3 100644 |
| --- a/runtime/bin/eventhandler_win.cc |
| +++ b/runtime/bin/eventhandler_win.cc |
| @@ -906,11 +906,11 @@ EventHandlerImplementation::~EventHandlerImplementation() { |
| } |
| -DWORD 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; |
| } |
| @@ -938,12 +938,14 @@ void EventHandlerImplementation::EventHandlerEntry(uword args) { |
| DWORD bytes; |
| ULONG_PTR key; |
| OVERLAPPED* overlapped; |
| - intptr_t millis = handler_impl->GetTimeout(); |
| + int64_t millis = handler_impl->GetTimeout(); |
| + ASSERT(millis == kInfinityTimeout || millis >= 0); |
|
floitsch
2013/06/26 13:21:11
ASSERT(size_of(int32) == size_of(DWORD));
Søren Gjesse
2013/06/26 13:26:32
Done.
|
| + if (millis > kMaxInt32) millis = kMaxInt32; |
| BOOL ok = GetQueuedCompletionStatus(handler_impl->completion_port(), |
| &bytes, |
| &key, |
| &overlapped, |
| - millis); |
| + static_cast<DWORD>(millis)); |
| if (!ok && overlapped == NULL) { |
| if (GetLastError() == ERROR_ABANDONED_WAIT_0) { |
| // The completion port should never be closed. |