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

Side by Side Diff: runtime/bin/eventhandler_win.h

Issue 12218035: Fix socket error reporting on Windows (Closed) Base URL: https://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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/bin/eventhandler_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef BIN_EVENTHANDLER_WIN_H_ 5 #ifndef BIN_EVENTHANDLER_WIN_H_
6 #define BIN_EVENTHANDLER_WIN_H_ 6 #define BIN_EVENTHANDLER_WIN_H_
7 7
8 #if !defined(BIN_EVENTHANDLER_H_) 8 #if !defined(BIN_EVENTHANDLER_H_)
9 #error Do not include eventhandler_win.h directly; use eventhandler.h instead. 9 #error Do not include eventhandler_win.h directly; use eventhandler.h instead.
10 #endif 10 #endif
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 kCloseRead = 1, 210 kCloseRead = 1,
211 kCloseWrite = 2, 211 kCloseWrite = 2,
212 kDoesNotSupportOverlappedIO = 3, 212 kDoesNotSupportOverlappedIO = 3,
213 kError = 4 213 kError = 4
214 }; 214 };
215 215
216 explicit Handle(HANDLE handle); 216 explicit Handle(HANDLE handle);
217 Handle(HANDLE handle, Dart_Port port); 217 Handle(HANDLE handle, Dart_Port port);
218 218
219 virtual void AfterClose() = 0; 219 virtual void AfterClose() = 0;
220 virtual void HandleIssueError();
220 221
221 Type type_; 222 Type type_;
222 HANDLE handle_; 223 HANDLE handle_;
223 Dart_Port port_; // Dart port to communicate events for this socket. 224 Dart_Port port_; // Dart port to communicate events for this socket.
224 intptr_t mask_; // Mask of events to report through the port. 225 intptr_t mask_; // Mask of events to report through the port.
225 HANDLE completion_port_; 226 HANDLE completion_port_;
226 EventHandlerImplementation* event_handler_; 227 EventHandlerImplementation* event_handler_;
227 228
228 IOBuffer* data_ready_; // IO buffer for data ready to be read. 229 IOBuffer* data_ready_; // IO buffer for data ready to be read.
229 IOBuffer* pending_read_; // IO buffer for pending read. 230 IOBuffer* pending_read_; // IO buffer for pending read.
(...skipping 23 matching lines...) Expand all
253 254
254 255
255 class SocketHandle : public Handle { 256 class SocketHandle : public Handle {
256 public: 257 public:
257 SOCKET socket() { return reinterpret_cast<SOCKET>(handle_); } 258 SOCKET socket() { return reinterpret_cast<SOCKET>(handle_); }
258 259
259 protected: 260 protected:
260 explicit SocketHandle(SOCKET s) : Handle(reinterpret_cast<HANDLE>(s)) {} 261 explicit SocketHandle(SOCKET s) : Handle(reinterpret_cast<HANDLE>(s)) {}
261 SocketHandle(SOCKET s, Dart_Port port) 262 SocketHandle(SOCKET s, Dart_Port port)
262 : Handle(reinterpret_cast<HANDLE>(s), port) {} 263 : Handle(reinterpret_cast<HANDLE>(s), port) {}
264
265 virtual void HandleIssueError();
263 }; 266 };
264 267
265 268
266 // Information on listen sockets. 269 // Information on listen sockets.
267 class ListenSocket : public SocketHandle { 270 class ListenSocket : public SocketHandle {
268 public: 271 public:
269 explicit ListenSocket(SOCKET s) : SocketHandle(s), 272 explicit ListenSocket(SOCKET s) : SocketHandle(s),
270 AcceptEx_(NULL), 273 AcceptEx_(NULL),
271 pending_accept_count_(0), 274 pending_accept_count_(0),
272 accepted_head_(NULL), 275 accepted_head_(NULL),
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 ClientSocket* client_sockets_head_; 376 ClientSocket* client_sockets_head_;
374 377
375 int64_t timeout_; // Time for next timeout. 378 int64_t timeout_; // Time for next timeout.
376 Dart_Port timeout_port_; 379 Dart_Port timeout_port_;
377 bool shutdown_; 380 bool shutdown_;
378 HANDLE completion_port_; 381 HANDLE completion_port_;
379 }; 382 };
380 383
381 384
382 #endif // BIN_EVENTHANDLER_WIN_H_ 385 #endif // BIN_EVENTHANDLER_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/eventhandler_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698