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 |
| 11 #include "base/time.h" |
11 #include "base/threading/non_thread_safe.h" | 12 #include "base/threading/non_thread_safe.h" |
12 #include "net/base/address_list.h" | 13 #include "net/base/address_list.h" |
13 #include "net/base/completion_callback.h" | 14 #include "net/base/completion_callback.h" |
14 #include "net/base/net_log.h" | 15 #include "net/base/net_log.h" |
15 #include "net/socket/stream_socket.h" | 16 #include "net/socket/stream_socket.h" |
16 | 17 |
17 namespace net { | 18 namespace net { |
18 | 19 |
19 class BoundNetLog; | 20 class BoundNetLog; |
20 | 21 |
(...skipping 22 matching lines...) Expand all Loading... |
43 virtual bool IsConnected() const; | 44 virtual bool IsConnected() const; |
44 virtual bool IsConnectedAndIdle() const; | 45 virtual bool IsConnectedAndIdle() const; |
45 virtual int GetPeerAddress(AddressList* address) const; | 46 virtual int GetPeerAddress(AddressList* address) const; |
46 virtual int GetLocalAddress(IPEndPoint* address) const; | 47 virtual int GetLocalAddress(IPEndPoint* address) const; |
47 virtual const BoundNetLog& NetLog() const { return net_log_; } | 48 virtual const BoundNetLog& NetLog() const { return net_log_; } |
48 virtual void SetSubresourceSpeculation(); | 49 virtual void SetSubresourceSpeculation(); |
49 virtual void SetOmniboxSpeculation(); | 50 virtual void SetOmniboxSpeculation(); |
50 virtual bool WasEverUsed() const; | 51 virtual bool WasEverUsed() const; |
51 virtual bool UsingTCPFastOpen() const; | 52 virtual bool UsingTCPFastOpen() const; |
52 | 53 |
| 54 virtual int NumBytesRead() const { return num_bytes_read_; } |
| 55 virtual double GetRTTInMs() const { return rtt_ms_; } |
| 56 |
53 // Socket methods: | 57 // Socket methods: |
54 // Multiple outstanding requests are not supported. | 58 // Multiple outstanding requests are not supported. |
55 // Full duplex mode (reading and writing at the same time) is supported | 59 // Full duplex mode (reading and writing at the same time) is supported |
56 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 60 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
57 virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 61 virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
58 | 62 |
59 virtual bool SetReceiveBufferSize(int32 size); | 63 virtual bool SetReceiveBufferSize(int32 size); |
60 virtual bool SetSendBufferSize(int32 size); | 64 virtual bool SetSendBufferSize(int32 size); |
61 | 65 |
62 private: | 66 private: |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 133 |
130 BoundNetLog net_log_; | 134 BoundNetLog net_log_; |
131 | 135 |
132 // This socket was previously disconnected and has not been re-connected. | 136 // This socket was previously disconnected and has not been re-connected. |
133 bool previously_disconnected_; | 137 bool previously_disconnected_; |
134 | 138 |
135 // Record of connectivity and transmissions, for use in speculative connection | 139 // Record of connectivity and transmissions, for use in speculative connection |
136 // histograms. | 140 // histograms. |
137 UseHistory use_history_; | 141 UseHistory use_history_; |
138 | 142 |
| 143 base::Time connect_start_time_; |
| 144 int num_bytes_read_; |
| 145 double rtt_ms_; |
| 146 |
139 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketWin); | 147 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketWin); |
140 }; | 148 }; |
141 | 149 |
142 } // namespace net | 150 } // namespace net |
143 | 151 |
144 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_WIN_H_ | 152 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_WIN_H_ |
OLD | NEW |