OLD | NEW |
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 "bin/eventhandler.h" | 5 #include "bin/eventhandler.h" |
6 | 6 |
7 #include <process.h> | 7 #include <process.h> |
8 #include <winsock2.h> | 8 #include <winsock2.h> |
9 #include <ws2tcpip.h> | 9 #include <ws2tcpip.h> |
10 #include <mswsock.h> | 10 #include <mswsock.h> |
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 if (timeout_ == kInfinityTimeout) { | 839 if (timeout_ == kInfinityTimeout) { |
840 return kInfinityTimeout; | 840 return kInfinityTimeout; |
841 } | 841 } |
842 intptr_t millis = timeout_ - GetCurrentTimeMilliseconds(); | 842 intptr_t millis = timeout_ - GetCurrentTimeMilliseconds(); |
843 return (millis < 0) ? 0 : millis; | 843 return (millis < 0) ? 0 : millis; |
844 } | 844 } |
845 | 845 |
846 | 846 |
847 void EventHandlerImplementation::SendData(intptr_t id, | 847 void EventHandlerImplementation::SendData(intptr_t id, |
848 Dart_Port dart_port, | 848 Dart_Port dart_port, |
849 intptr_t data) { | 849 int64_t data) { |
850 InterruptMessage* msg = new InterruptMessage; | 850 InterruptMessage* msg = new InterruptMessage; |
851 msg->id = id; | 851 msg->id = id; |
852 msg->dart_port = dart_port; | 852 msg->dart_port = dart_port; |
853 msg->data = data; | 853 msg->data = data; |
854 BOOL ok = PostQueuedCompletionStatus( | 854 BOOL ok = PostQueuedCompletionStatus( |
855 completion_port_, 0, NULL, reinterpret_cast<OVERLAPPED*>(msg)); | 855 completion_port_, 0, NULL, reinterpret_cast<OVERLAPPED*>(msg)); |
856 if (!ok) { | 856 if (!ok) { |
857 FATAL("PostQueuedCompletionStatus failed"); | 857 FATAL("PostQueuedCompletionStatus failed"); |
858 } | 858 } |
859 } | 859 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 // Initialize Winsock32 | 921 // Initialize Winsock32 |
922 if (!Socket::Initialize()) { | 922 if (!Socket::Initialize()) { |
923 FATAL("Failed to initialized Windows sockets"); | 923 FATAL("Failed to initialized Windows sockets"); |
924 } | 924 } |
925 } | 925 } |
926 | 926 |
927 | 927 |
928 void EventHandlerImplementation::Shutdown() { | 928 void EventHandlerImplementation::Shutdown() { |
929 SendData(kShutdownId, 0, 0); | 929 SendData(kShutdownId, 0, 0); |
930 } | 930 } |
OLD | NEW |