| OLD | NEW |
| 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 | 9 |
| 10 #include <winsock2.h> // NOLINT | 10 #include <winsock2.h> // NOLINT |
| (...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 } | 981 } |
| 982 | 982 |
| 983 if ((msg->data & (1 << kCloseCommand)) != 0) { | 983 if ((msg->data & (1 << kCloseCommand)) != 0) { |
| 984 listen_socket->Close(); | 984 listen_socket->Close(); |
| 985 } | 985 } |
| 986 } else { | 986 } else { |
| 987 handle->EnsureInitialized(this); | 987 handle->EnsureInitialized(this); |
| 988 | 988 |
| 989 Handle::ScopedLock lock(handle); | 989 Handle::ScopedLock lock(handle); |
| 990 | 990 |
| 991 if (!handle->IsError()) { | 991 if (handle->IsError()) { |
| 992 DartUtils::PostInt32(msg->dart_port, 1 << kErrorEvent); |
| 993 } else { |
| 992 if ((msg->data & ((1 << kInEvent) | (1 << kOutEvent))) != 0) { | 994 if ((msg->data & ((1 << kInEvent) | (1 << kOutEvent))) != 0) { |
| 993 // Only set mask if we turned on kInEvent or kOutEvent. | 995 // Only set mask if we turned on kInEvent or kOutEvent. |
| 994 handle->SetPortAndMask(msg->dart_port, msg->data); | 996 handle->SetPortAndMask(msg->dart_port, msg->data); |
| 995 | 997 |
| 996 // If in events (data available events) have been requested, and data | 998 // If in events (data available events) have been requested, and data |
| 997 // is available, post an in event immediately. Otherwise make sure | 999 // is available, post an in event immediately. Otherwise make sure |
| 998 // that a pending read is issued, unless the socket is already closed | 1000 // that a pending read is issued, unless the socket is already closed |
| 999 // for read. | 1001 // for read. |
| 1000 if ((msg->data & (1 << kInEvent)) != 0) { | 1002 if ((msg->data & (1 << kInEvent)) != 0) { |
| 1001 if (handle->Available() > 0) { | 1003 if (handle->Available() > 0) { |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1307 | 1309 |
| 1308 | 1310 |
| 1309 void EventHandlerImplementation::Shutdown() { | 1311 void EventHandlerImplementation::Shutdown() { |
| 1310 SendData(kShutdownId, 0, 0); | 1312 SendData(kShutdownId, 0, 0); |
| 1311 } | 1313 } |
| 1312 | 1314 |
| 1313 } // namespace bin | 1315 } // namespace bin |
| 1314 } // namespace dart | 1316 } // namespace dart |
| 1315 | 1317 |
| 1316 #endif // defined(TARGET_OS_WINDOWS) | 1318 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |