| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_CLIENT_SOCKET_H_ | 5 #ifndef NET_SOCKET_CLIENT_SOCKET_H_ |
| 6 #define NET_SOCKET_CLIENT_SOCKET_H_ | 6 #define NET_SOCKET_CLIENT_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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // reasons. This call is generally forwarded to a basic TCPClientSocket*, | 62 // reasons. This call is generally forwarded to a basic TCPClientSocket*, |
| 63 // where a UseHistory can be updated. | 63 // where a UseHistory can be updated. |
| 64 virtual void SetSubresourceSpeculation() = 0; | 64 virtual void SetSubresourceSpeculation() = 0; |
| 65 virtual void SetOmniboxSpeculation() = 0; | 65 virtual void SetOmniboxSpeculation() = 0; |
| 66 | 66 |
| 67 // Returns true if the underlying transport socket ever had any reads or | 67 // Returns true if the underlying transport socket ever had any reads or |
| 68 // writes. ClientSockets layered on top of transport sockets should forward | 68 // writes. ClientSockets layered on top of transport sockets should forward |
| 69 // this call to the transport socket. | 69 // this call to the transport socket. |
| 70 virtual bool WasEverUsed() const = 0; | 70 virtual bool WasEverUsed() const = 0; |
| 71 | 71 |
| 72 // Returns true if the underlying transport socket is using TCP FastOpen. |
| 73 // TCP FastOpen is an experiment with sending data in the TCP SYN packet. |
| 74 virtual bool UsingTCPFastOpen() const = 0; |
| 75 |
| 72 protected: | 76 protected: |
| 73 // The following class is only used to gather statistics about the history of | 77 // The following class is only used to gather statistics about the history of |
| 74 // a socket. It is only instantiated and used in basic sockets, such as | 78 // a socket. It is only instantiated and used in basic sockets, such as |
| 75 // TCPClientSocket* instances. Other classes that are derived from | 79 // TCPClientSocket* instances. Other classes that are derived from |
| 76 // ClientSocket should forward any potential settings to their underlying | 80 // ClientSocket should forward any potential settings to their underlying |
| 77 // transport sockets. | 81 // transport sockets. |
| 78 class UseHistory { | 82 class UseHistory { |
| 79 public: | 83 public: |
| 80 UseHistory(); | 84 UseHistory(); |
| 81 ~UseHistory(); | 85 ~UseHistory(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 110 // Logs a SOCKET_BYTES_RECEIVED or SOCKET_BYTES_SENT event to the NetLog. | 114 // Logs a SOCKET_BYTES_RECEIVED or SOCKET_BYTES_SENT event to the NetLog. |
| 111 // Determines whether to log the received bytes or not, based on the current | 115 // Determines whether to log the received bytes or not, based on the current |
| 112 // logging level. | 116 // logging level. |
| 113 void LogByteTransfer(const BoundNetLog& net_log, NetLog::EventType event_type, | 117 void LogByteTransfer(const BoundNetLog& net_log, NetLog::EventType event_type, |
| 114 int byte_count, char* bytes) const; | 118 int byte_count, char* bytes) const; |
| 115 }; | 119 }; |
| 116 | 120 |
| 117 } // namespace net | 121 } // namespace net |
| 118 | 122 |
| 119 #endif // NET_SOCKET_CLIENT_SOCKET_H_ | 123 #endif // NET_SOCKET_CLIENT_SOCKET_H_ |
| OLD | NEW |