| 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 #include "net/spdy/chromium/multiplexed_http_stream.h" | 5 #include "net/spdy/chromium/multiplexed_http_stream.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace net { | 9 namespace net { |
| 10 | 10 |
| 11 MultiplexedHttpStream::MultiplexedHttpStream(MultiplexedSessionHandle session) | 11 MultiplexedHttpStream::MultiplexedHttpStream( |
| 12 : session_(session) {} | 12 std::unique_ptr<MultiplexedSessionHandle> session) |
| 13 : session_(std::move(session)) {} |
| 13 | 14 |
| 14 MultiplexedHttpStream::~MultiplexedHttpStream() {} | 15 MultiplexedHttpStream::~MultiplexedHttpStream() {} |
| 15 | 16 |
| 16 bool MultiplexedHttpStream::GetRemoteEndpoint(IPEndPoint* endpoint) { | 17 bool MultiplexedHttpStream::GetRemoteEndpoint(IPEndPoint* endpoint) { |
| 17 return session_.GetRemoteEndpoint(endpoint); | 18 return session_->GetRemoteEndpoint(endpoint); |
| 18 } | 19 } |
| 19 | 20 |
| 20 void MultiplexedHttpStream::GetSSLInfo(SSLInfo* ssl_info) { | 21 void MultiplexedHttpStream::GetSSLInfo(SSLInfo* ssl_info) { |
| 21 session_.GetSSLInfo(ssl_info); | 22 session_->GetSSLInfo(ssl_info); |
| 22 } | 23 } |
| 23 | 24 |
| 24 void MultiplexedHttpStream::SaveSSLInfo() { | 25 void MultiplexedHttpStream::SaveSSLInfo() { |
| 25 session_.SaveSSLInfo(); | 26 session_->SaveSSLInfo(); |
| 26 } | 27 } |
| 27 | 28 |
| 28 void MultiplexedHttpStream::GetSSLCertRequestInfo( | 29 void MultiplexedHttpStream::GetSSLCertRequestInfo( |
| 29 SSLCertRequestInfo* cert_request_info) { | 30 SSLCertRequestInfo* cert_request_info) { |
| 30 // A multiplexed stream cannot request client certificates. Client | 31 // A multiplexed stream cannot request client certificates. Client |
| 31 // authentication may only occur during the initial SSL handshake. | 32 // authentication may only occur during the initial SSL handshake. |
| 32 NOTREACHED(); | 33 NOTREACHED(); |
| 33 } | 34 } |
| 34 | 35 |
| 35 Error MultiplexedHttpStream::GetTokenBindingSignature( | 36 Error MultiplexedHttpStream::GetTokenBindingSignature( |
| 36 crypto::ECPrivateKey* key, | 37 crypto::ECPrivateKey* key, |
| 37 TokenBindingType tb_type, | 38 TokenBindingType tb_type, |
| 38 std::vector<uint8_t>* out) { | 39 std::vector<uint8_t>* out) { |
| 39 return session_.GetTokenBindingSignature(key, tb_type, out); | 40 return session_->GetTokenBindingSignature(key, tb_type, out); |
| 40 } | 41 } |
| 41 | 42 |
| 42 void MultiplexedHttpStream::Drain(HttpNetworkSession* session) { | 43 void MultiplexedHttpStream::Drain(HttpNetworkSession* session) { |
| 43 NOTREACHED(); | 44 NOTREACHED(); |
| 44 Close(false); | 45 Close(false); |
| 45 delete this; | 46 delete this; |
| 46 } | 47 } |
| 47 | 48 |
| 48 HttpStream* MultiplexedHttpStream::RenewStreamForAuth() { | 49 HttpStream* MultiplexedHttpStream::RenewStreamForAuth() { |
| 49 return nullptr; | 50 return nullptr; |
| 50 } | 51 } |
| 51 | 52 |
| 52 void MultiplexedHttpStream::SetConnectionReused() {} | 53 void MultiplexedHttpStream::SetConnectionReused() {} |
| 53 | 54 |
| 54 bool MultiplexedHttpStream::CanReuseConnection() const { | 55 bool MultiplexedHttpStream::CanReuseConnection() const { |
| 55 // Multiplexed streams aren't considered reusable. | 56 // Multiplexed streams aren't considered reusable. |
| 56 return false; | 57 return false; |
| 57 } | 58 } |
| 58 | 59 |
| 59 } // namespace net | 60 } // namespace net |
| OLD | NEW |