OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/base/tcp_client_socket_win.h" | 5 #include "net/base/tcp_client_socket_win.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory_debug.h" | 9 #include "base/memory_debug.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
11 #include "base/sys_info.h" | 11 #include "base/sys_info.h" |
12 #include "base/trace_event.h" | 12 #include "base/trace_event.h" |
| 13 #include "net/base/io_buffer.h" |
13 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
14 #include "net/base/winsock_init.h" | 15 #include "net/base/winsock_init.h" |
15 | 16 |
16 namespace net { | 17 namespace net { |
17 | 18 |
18 namespace { | 19 namespace { |
19 | 20 |
20 // If the (manual-reset) event object is signaled, resets it and returns true. | 21 // If the (manual-reset) event object is signaled, resets it and returns true. |
21 // Otherwise, does nothing and returns false. Called after a Winsock function | 22 // Otherwise, does nothing and returns false. Called after a Winsock function |
22 // succeeds synchronously | 23 // succeeds synchronously |
(...skipping 545 matching lines...) Loading... |
568 BOOL ok = WSAGetOverlappedResult(socket_, &core_->write_overlapped_, | 569 BOOL ok = WSAGetOverlappedResult(socket_, &core_->write_overlapped_, |
569 &num_bytes, FALSE, &flags); | 570 &num_bytes, FALSE, &flags); |
570 WSAResetEvent(core_->write_overlapped_.hEvent); | 571 WSAResetEvent(core_->write_overlapped_.hEvent); |
571 TRACE_EVENT_END("socket.write", this, StringPrintf("%d bytes", num_bytes)); | 572 TRACE_EVENT_END("socket.write", this, StringPrintf("%d bytes", num_bytes)); |
572 waiting_write_ = false; | 573 waiting_write_ = false; |
573 core_->write_iobuffer_ = NULL; | 574 core_->write_iobuffer_ = NULL; |
574 DoWriteCallback(ok ? num_bytes : MapWinsockError(WSAGetLastError())); | 575 DoWriteCallback(ok ? num_bytes : MapWinsockError(WSAGetLastError())); |
575 } | 576 } |
576 | 577 |
577 } // namespace net | 578 } // namespace net |
OLD | NEW |