Chromium Code Reviews| 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_STREAM_SOCKET_H_ | 5 #ifndef NET_SOCKET_STREAM_SOCKET_H_ |
| 6 #define NET_SOCKET_STREAM_SOCKET_H_ | 6 #define NET_SOCKET_STREAM_SOCKET_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "net/base/net_log.h" | 9 #include "net/base/net_log.h" |
| 10 #include "net/socket/socket.h" | 10 #include "net/socket/socket.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 | 72 |
| 73 // Returns true if the underlying transport socket ever had any reads or | 73 // Returns true if the underlying transport socket ever had any reads or |
| 74 // writes. StreamSockets layered on top of transport sockets should forward | 74 // writes. StreamSockets layered on top of transport sockets should forward |
| 75 // this call to the transport socket. | 75 // this call to the transport socket. |
| 76 virtual bool WasEverUsed() const = 0; | 76 virtual bool WasEverUsed() const = 0; |
| 77 | 77 |
| 78 // Returns true if the underlying transport socket is using TCP FastOpen. | 78 // Returns true if the underlying transport socket is using TCP FastOpen. |
| 79 // TCP FastOpen is an experiment with sending data in the TCP SYN packet. | 79 // TCP FastOpen is an experiment with sending data in the TCP SYN packet. |
| 80 virtual bool UsingTCPFastOpen() const = 0; | 80 virtual bool UsingTCPFastOpen() const = 0; |
| 81 | 81 |
| 82 // Returns the number of bytes successfully written to this socket. | |
| 83 virtual int NumBytesRead() const = 0; | |
|
wtc
2011/06/06 17:24:05
The comment says "written" but the function name s
Gagan
2011/06/06 20:27:10
Done.
| |
| 84 | |
| 85 // Returns the RTT of this socket. | |
| 86 virtual double GetRTTInMs() const = 0; | |
| 87 | |
| 82 protected: | 88 protected: |
| 83 // The following class is only used to gather statistics about the history of | 89 // The following class is only used to gather statistics about the history of |
| 84 // a socket. It is only instantiated and used in basic sockets, such as | 90 // a socket. It is only instantiated and used in basic sockets, such as |
| 85 // TCPClientSocket* instances. Other classes that are derived from | 91 // TCPClientSocket* instances. Other classes that are derived from |
| 86 // StreamSocket should forward any potential settings to their underlying | 92 // StreamSocket should forward any potential settings to their underlying |
| 87 // transport sockets. | 93 // transport sockets. |
| 88 class UseHistory { | 94 class UseHistory { |
| 89 public: | 95 public: |
| 90 UseHistory(); | 96 UseHistory(); |
| 91 ~UseHistory(); | 97 ~UseHistory(); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 // Logs a SOCKET_BYTES_RECEIVED or SOCKET_BYTES_SENT event to the NetLog. | 130 // Logs a SOCKET_BYTES_RECEIVED or SOCKET_BYTES_SENT event to the NetLog. |
| 125 // Determines whether to log the received bytes or not, based on the current | 131 // Determines whether to log the received bytes or not, based on the current |
| 126 // logging level. | 132 // logging level. |
| 127 void LogByteTransfer(const BoundNetLog& net_log, NetLog::EventType event_type, | 133 void LogByteTransfer(const BoundNetLog& net_log, NetLog::EventType event_type, |
| 128 int byte_count, char* bytes) const; | 134 int byte_count, char* bytes) const; |
| 129 }; | 135 }; |
| 130 | 136 |
| 131 } // namespace net | 137 } // namespace net |
| 132 | 138 |
| 133 #endif // NET_SOCKET_STREAM_SOCKET_H_ | 139 #endif // NET_SOCKET_STREAM_SOCKET_H_ |
| OLD | NEW |