| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_SPDY_MULTIPLEXED_SESSION_H_ | 5 #ifndef NET_SPDY_MULTIPLEXED_SESSION_H_ |
| 6 #define NET_SPDY_MULTIPLEXED_SESSION_H_ | 6 #define NET_SPDY_MULTIPLEXED_SESSION_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "net/base/ip_endpoint.h" | 10 #include "net/base/ip_endpoint.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 virtual Error GetTokenBindingSignature(crypto::ECPrivateKey* key, | 38 virtual Error GetTokenBindingSignature(crypto::ECPrivateKey* key, |
| 39 TokenBindingType tb_type, | 39 TokenBindingType tb_type, |
| 40 std::vector<uint8_t>* out) = 0; | 40 std::vector<uint8_t>* out) = 0; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 // A handle to a multiplexed session which will be valid even after the | 43 // A handle to a multiplexed session which will be valid even after the |
| 44 // underlying session is deleted. | 44 // underlying session is deleted. |
| 45 class NET_EXPORT_PRIVATE MultiplexedSessionHandle { | 45 class NET_EXPORT_PRIVATE MultiplexedSessionHandle { |
| 46 public: | 46 public: |
| 47 explicit MultiplexedSessionHandle(base::WeakPtr<MultiplexedSession> session); | 47 explicit MultiplexedSessionHandle(base::WeakPtr<MultiplexedSession> session); |
| 48 MultiplexedSessionHandle(const MultiplexedSessionHandle& other); | 48 virtual ~MultiplexedSessionHandle(); |
| 49 MultiplexedSessionHandle(MultiplexedSessionHandle&& other); | |
| 50 ~MultiplexedSessionHandle(); | |
| 51 | 49 |
| 52 // Gets the remote endpoint of the socket that the HTTP stream is using, if | 50 // Gets the remote endpoint of the socket that the HTTP stream is using, if |
| 53 // any. Returns true and fills in |endpoint| if it is available; returns false | 51 // any. Returns true and fills in |endpoint| if it is available; returns false |
| 54 // and does not modify |endpoint| if it is unavailable. | 52 // and does not modify |endpoint| if it is unavailable. |
| 55 bool GetRemoteEndpoint(IPEndPoint* endpoint); | 53 bool GetRemoteEndpoint(IPEndPoint* endpoint); |
| 56 | 54 |
| 57 // Fills SSL info in |ssl_info| and returns true when SSL is in use. | 55 // Fills SSL info in |ssl_info| and returns true when SSL is in use. |
| 58 bool GetSSLInfo(SSLInfo* ssl_info) const; | 56 bool GetSSLInfo(SSLInfo* ssl_info) const; |
| 59 | 57 |
| 60 // Caches SSL info from the underlying session. | 58 // Caches SSL info from the underlying session. |
| 61 void SaveSSLInfo(); | 59 void SaveSSLInfo(); |
| 62 | 60 |
| 63 // Generates the signature used in Token Binding using key |*key| and for a | 61 // Generates the signature used in Token Binding using key |*key| and for a |
| 64 // Token Binding of type |tb_type|, putting the signature in |*out|. Returns a | 62 // Token Binding of type |tb_type|, putting the signature in |*out|. Returns a |
| 65 // net error code. | 63 // net error code. |
| 66 Error GetTokenBindingSignature(crypto::ECPrivateKey* key, | 64 Error GetTokenBindingSignature(crypto::ECPrivateKey* key, |
| 67 TokenBindingType tb_type, | 65 TokenBindingType tb_type, |
| 68 std::vector<uint8_t>* out); | 66 std::vector<uint8_t>* out); |
| 69 | 67 |
| 70 private: | 68 private: |
| 71 base::WeakPtr<MultiplexedSession> session_; | 69 base::WeakPtr<MultiplexedSession> session_; |
| 72 SSLInfo ssl_info_; | 70 SSLInfo ssl_info_; |
| 73 bool has_ssl_info_; | 71 bool has_ssl_info_; |
| 74 }; | 72 }; |
| 75 | 73 |
| 76 } // namespace net | 74 } // namespace net |
| 77 | 75 |
| 78 #endif // NET_SPDY_MULTIPLEXED_SESSION_H_ | 76 #endif // NET_SPDY_MULTIPLEXED_SESSION_H_ |
| OLD | NEW |