OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/time.h" | 9 #include "base/time.h" |
10 #include "net/base/net_log.h" | 10 #include "net/base/net_log.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // Returns true if the underlying transport socket is using TCP FastOpen. | 80 // Returns true if the underlying transport socket is using TCP FastOpen. |
81 // TCP FastOpen is an experiment with sending data in the TCP SYN packet. | 81 // TCP FastOpen is an experiment with sending data in the TCP SYN packet. |
82 virtual bool UsingTCPFastOpen() const = 0; | 82 virtual bool UsingTCPFastOpen() const = 0; |
83 | 83 |
84 // Returns the number of bytes successfully read from this socket. | 84 // Returns the number of bytes successfully read from this socket. |
85 virtual int64 NumBytesRead() const = 0; | 85 virtual int64 NumBytesRead() const = 0; |
86 | 86 |
87 // Returns the connection setup time of this socket. | 87 // Returns the connection setup time of this socket. |
88 virtual base::TimeDelta GetConnectTimeMicros() const = 0; | 88 virtual base::TimeDelta GetConnectTimeMicros() const = 0; |
89 | 89 |
| 90 // Returns the protocol negotiated via NPN for this socket, or |
| 91 // kProtoUnknown will be returned if NPN is not applicable. |
| 92 virtual NextProto GetNegotiatedProtocol() const = 0; |
| 93 |
90 protected: | 94 protected: |
91 // The following class is only used to gather statistics about the history of | 95 // The following class is only used to gather statistics about the history of |
92 // a socket. It is only instantiated and used in basic sockets, such as | 96 // a socket. It is only instantiated and used in basic sockets, such as |
93 // TCPClientSocket* instances. Other classes that are derived from | 97 // TCPClientSocket* instances. Other classes that are derived from |
94 // StreamSocket should forward any potential settings to their underlying | 98 // StreamSocket should forward any potential settings to their underlying |
95 // transport sockets. | 99 // transport sockets. |
96 class UseHistory { | 100 class UseHistory { |
97 public: | 101 public: |
98 UseHistory(); | 102 UseHistory(); |
99 ~UseHistory(); | 103 ~UseHistory(); |
(...skipping 26 matching lines...) Expand all Loading... |
126 // identify the motivation. | 130 // identify the motivation. |
127 bool omnibox_speculation_; | 131 bool omnibox_speculation_; |
128 bool subresource_speculation_; | 132 bool subresource_speculation_; |
129 DISALLOW_COPY_AND_ASSIGN(UseHistory); | 133 DISALLOW_COPY_AND_ASSIGN(UseHistory); |
130 }; | 134 }; |
131 }; | 135 }; |
132 | 136 |
133 } // namespace net | 137 } // namespace net |
134 | 138 |
135 #endif // NET_SOCKET_STREAM_SOCKET_H_ | 139 #endif // NET_SOCKET_STREAM_SOCKET_H_ |
OLD | NEW |