| 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 "base/time.h" | 9 #include "base/time.h" |
| 10 #include "net/base/net_log.h" | 10 #include "net/base/net_log.h" |
| 11 #include "net/base/next_proto.h" | 11 #include "net/base/next_proto.h" |
| 12 #include "net/socket/socket.h" | 12 #include "net/socket/socket.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 | 15 |
| 16 class AddressList; | 16 class AddressList; |
| 17 class IPEndPoint; | 17 class IPEndPoint; |
| 18 | 18 |
| 19 class NET_EXPORT_PRIVATE StreamSocket : public Socket { | 19 class NET_EXPORT_PRIVATE StreamSocket : public Socket { |
| 20 public: | 20 public: |
| 21 virtual ~StreamSocket() {} | 21 virtual ~StreamSocket() {} |
| 22 | 22 |
| 23 // Next Protocol Negotiation (NPN), if successful, results in agreement on an |
| 24 // application-level string that specifies the application level protocol to |
| 25 // use over the TLS connection. NextProto enumerates the application level |
| 26 // protocols that we recognise. |
| 27 enum NextProto { |
| 28 kProtoUnknown = 0, |
| 29 kProtoHTTP11 = 1, |
| 30 kProtoSPDY1 = 2, |
| 31 kProtoSPDY2 = 3, |
| 32 kProtoSPDY21 = 4, |
| 33 kProtoSPDY3 = 5, |
| 34 }; |
| 35 |
| 23 // Called to establish a connection. Returns OK if the connection could be | 36 // Called to establish a connection. Returns OK if the connection could be |
| 24 // established synchronously. Otherwise, ERR_IO_PENDING is returned and the | 37 // established synchronously. Otherwise, ERR_IO_PENDING is returned and the |
| 25 // given callback will run asynchronously when the connection is established | 38 // given callback will run asynchronously when the connection is established |
| 26 // or when an error occurs. The result is some other error code if the | 39 // or when an error occurs. The result is some other error code if the |
| 27 // connection could not be established. | 40 // connection could not be established. |
| 28 // | 41 // |
| 29 // The socket's Read and Write methods may not be called until Connect | 42 // The socket's Read and Write methods may not be called until Connect |
| 30 // succeeds. | 43 // succeeds. |
| 31 // | 44 // |
| 32 // It is valid to call Connect on an already connected socket, in which case | 45 // It is valid to call Connect on an already connected socket, in which case |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // identify the motivation. | 142 // identify the motivation. |
| 130 bool omnibox_speculation_; | 143 bool omnibox_speculation_; |
| 131 bool subresource_speculation_; | 144 bool subresource_speculation_; |
| 132 DISALLOW_COPY_AND_ASSIGN(UseHistory); | 145 DISALLOW_COPY_AND_ASSIGN(UseHistory); |
| 133 }; | 146 }; |
| 134 }; | 147 }; |
| 135 | 148 |
| 136 } // namespace net | 149 } // namespace net |
| 137 | 150 |
| 138 #endif // NET_SOCKET_STREAM_SOCKET_H_ | 151 #endif // NET_SOCKET_STREAM_SOCKET_H_ |
| OLD | NEW |