Chromium Code Reviews| 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 425 | 425 |
| 426 if (pending_read_ != NULL) { | 426 if (pending_read_ != NULL) { |
| 427 CancelIoEx(handle(), pending_read_->GetCleanOverlapped()); | 427 CancelIoEx(handle(), pending_read_->GetCleanOverlapped()); |
| 428 // Don't dispose of the buffer, as it will still complete (with length 0). | 428 // Don't dispose of the buffer, as it will still complete (with length 0). |
| 429 } | 429 } |
| 430 | 430 |
| 431 DoClose(); | 431 DoClose(); |
| 432 } | 432 } |
| 433 | 433 |
| 434 | 434 |
| 435 bool SocketHandle::CreateCompletionPort(HANDLE completion_port) { | |
| 436 completion_port_ = CreateIoCompletionPort(reinterpret_cast<HANDLE>(socket()), | |
|
kasperl
2014/06/04 14:01:05
Would it make sense to have a non-virtual DoCreate
Anders Johnsen
2014/06/04 14:05:22
Done.
| |
| 437 completion_port, | |
| 438 reinterpret_cast<ULONG_PTR>(this), | |
| 439 0); | |
| 440 if (completion_port_ == NULL) { | |
| 441 return false; | |
| 442 } | |
| 443 return true; | |
| 444 } | |
| 445 | |
| 446 | |
| 435 void SocketHandle::HandleIssueError() { | 447 void SocketHandle::HandleIssueError() { |
| 436 int error = WSAGetLastError(); | 448 int error = WSAGetLastError(); |
| 437 if (error == WSAECONNRESET) { | 449 if (error == WSAECONNRESET) { |
| 438 HandleClosed(this); | 450 HandleClosed(this); |
| 439 } else { | 451 } else { |
| 440 HandleError(this); | 452 HandleError(this); |
| 441 } | 453 } |
| 442 WSASetLastError(error); | 454 WSASetLastError(error); |
| 443 } | 455 } |
| 444 | 456 |
| (...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1363 | 1375 |
| 1364 | 1376 |
| 1365 void EventHandlerImplementation::Shutdown() { | 1377 void EventHandlerImplementation::Shutdown() { |
| 1366 SendData(kShutdownId, 0, 0); | 1378 SendData(kShutdownId, 0, 0); |
| 1367 } | 1379 } |
| 1368 | 1380 |
| 1369 } // namespace bin | 1381 } // namespace bin |
| 1370 } // namespace dart | 1382 } // namespace dart |
| 1371 | 1383 |
| 1372 #endif // defined(TARGET_OS_WINDOWS) | 1384 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |