OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef NET_SOCKET_TCP_CLIENT_SOCKET_WIN_H_ | 5 #ifndef NET_SOCKET_TCP_CLIENT_SOCKET_WIN_H_ |
6 #define NET_SOCKET_TCP_CLIENT_SOCKET_WIN_H_ | 6 #define NET_SOCKET_TCP_CLIENT_SOCKET_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <winsock2.h> | 9 #include <winsock2.h> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 virtual void SetOmniboxSpeculation(); | 54 virtual void SetOmniboxSpeculation(); |
55 virtual bool WasEverUsed() const; | 55 virtual bool WasEverUsed() const; |
56 virtual bool UsingTCPFastOpen() const; | 56 virtual bool UsingTCPFastOpen() const; |
57 virtual int64 NumBytesRead() const; | 57 virtual int64 NumBytesRead() const; |
58 virtual base::TimeDelta GetConnectTimeMicros() const; | 58 virtual base::TimeDelta GetConnectTimeMicros() const; |
59 | 59 |
60 // Socket implementation. | 60 // Socket implementation. |
61 // Multiple outstanding requests are not supported. | 61 // Multiple outstanding requests are not supported. |
62 // Full duplex mode (reading and writing at the same time) is supported | 62 // Full duplex mode (reading and writing at the same time) is supported |
63 virtual int Read(IOBuffer* buf, int buf_len, OldCompletionCallback* callback); | 63 virtual int Read(IOBuffer* buf, int buf_len, OldCompletionCallback* callback); |
| 64 virtual int Read(IOBuffer* buf, int buf_len, |
| 65 const CompletionCallback& callback); |
64 virtual int Write(IOBuffer* buf, int buf_len, OldCompletionCallback* callback)
; | 66 virtual int Write(IOBuffer* buf, int buf_len, OldCompletionCallback* callback)
; |
65 | 67 |
66 virtual bool SetReceiveBufferSize(int32 size); | 68 virtual bool SetReceiveBufferSize(int32 size); |
67 virtual bool SetSendBufferSize(int32 size); | 69 virtual bool SetSendBufferSize(int32 size); |
68 | 70 |
69 private: | 71 private: |
70 // State machine for connecting the socket. | 72 // State machine for connecting the socket. |
71 enum ConnectState { | 73 enum ConnectState { |
72 CONNECT_STATE_CONNECT, | 74 CONNECT_STATE_CONNECT, |
73 CONNECT_STATE_CONNECT_COMPLETE, | 75 CONNECT_STATE_CONNECT_COMPLETE, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 base::TimeTicks connect_start_time_; | 150 base::TimeTicks connect_start_time_; |
149 base::TimeDelta connect_time_micros_; | 151 base::TimeDelta connect_time_micros_; |
150 int64 num_bytes_read_; | 152 int64 num_bytes_read_; |
151 | 153 |
152 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketWin); | 154 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketWin); |
153 }; | 155 }; |
154 | 156 |
155 } // namespace net | 157 } // namespace net |
156 | 158 |
157 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_WIN_H_ | 159 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_WIN_H_ |
OLD | NEW |