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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 | 91 |
92 int IOBuffer::GetRemainingLength() { | 92 int IOBuffer::GetRemainingLength() { |
93 ASSERT(operation_ == kRead); | 93 ASSERT(operation_ == kRead); |
94 return data_length_ - index_; | 94 return data_length_ - index_; |
95 } | 95 } |
96 | 96 |
97 | 97 |
98 Handle::Handle(HANDLE handle) | 98 Handle::Handle(HANDLE handle) |
99 : handle_(reinterpret_cast<HANDLE>(handle)), | 99 : handle_(reinterpret_cast<HANDLE>(handle)), |
100 flags_(0), | |
101 port_(0), | 100 port_(0), |
| 101 mask_(0), |
102 completion_port_(INVALID_HANDLE_VALUE), | 102 completion_port_(INVALID_HANDLE_VALUE), |
103 event_handler_(NULL), | 103 event_handler_(NULL), |
104 data_ready_(NULL), | 104 data_ready_(NULL), |
105 pending_read_(NULL), | 105 pending_read_(NULL), |
106 pending_write_(NULL), | 106 pending_write_(NULL), |
107 last_error_(NOERROR) { | 107 last_error_(NOERROR), |
| 108 flags_(0) { |
108 InitializeCriticalSection(&cs_); | 109 InitializeCriticalSection(&cs_); |
109 } | 110 } |
110 | 111 |
111 | 112 |
112 Handle::Handle(HANDLE handle, Dart_Port port) | 113 Handle::Handle(HANDLE handle, Dart_Port port) |
113 : handle_(reinterpret_cast<HANDLE>(handle)), | 114 : handle_(reinterpret_cast<HANDLE>(handle)), |
114 flags_(0), | |
115 port_(port), | 115 port_(port), |
| 116 mask_(0), |
116 completion_port_(INVALID_HANDLE_VALUE), | 117 completion_port_(INVALID_HANDLE_VALUE), |
117 event_handler_(NULL), | 118 event_handler_(NULL), |
118 data_ready_(NULL), | 119 data_ready_(NULL), |
119 pending_read_(NULL), | 120 pending_read_(NULL), |
120 pending_write_(NULL), | 121 pending_write_(NULL), |
121 last_error_(NOERROR) { | 122 last_error_(NOERROR), |
| 123 flags_(0) { |
122 InitializeCriticalSection(&cs_); | 124 InitializeCriticalSection(&cs_); |
123 } | 125 } |
124 | 126 |
125 | 127 |
126 Handle::~Handle() { | 128 Handle::~Handle() { |
127 DeleteCriticalSection(&cs_); | 129 DeleteCriticalSection(&cs_); |
128 } | 130 } |
129 | 131 |
130 | 132 |
131 void Handle::Lock() { | 133 void Handle::Lock() { |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 // Initialize Winsock32 | 938 // Initialize Winsock32 |
937 if (!Socket::Initialize()) { | 939 if (!Socket::Initialize()) { |
938 FATAL("Failed to initialized Windows sockets"); | 940 FATAL("Failed to initialized Windows sockets"); |
939 } | 941 } |
940 } | 942 } |
941 | 943 |
942 | 944 |
943 void EventHandlerImplementation::Shutdown() { | 945 void EventHandlerImplementation::Shutdown() { |
944 SendData(kShutdownId, 0, 0); | 946 SendData(kShutdownId, 0, 0); |
945 } | 947 } |
OLD | NEW |