| 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 #include "net/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 2026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2037 } | 2037 } |
| 2038 | 2038 |
| 2039 bool SpdySession::GetSSLInfo(SSLInfo* ssl_info, | 2039 bool SpdySession::GetSSLInfo(SSLInfo* ssl_info, |
| 2040 bool* was_npn_negotiated, | 2040 bool* was_npn_negotiated, |
| 2041 NextProto* protocol_negotiated) { | 2041 NextProto* protocol_negotiated) { |
| 2042 *was_npn_negotiated = connection_->socket()->WasNpnNegotiated(); | 2042 *was_npn_negotiated = connection_->socket()->WasNpnNegotiated(); |
| 2043 *protocol_negotiated = connection_->socket()->GetNegotiatedProtocol(); | 2043 *protocol_negotiated = connection_->socket()->GetNegotiatedProtocol(); |
| 2044 return connection_->socket()->GetSSLInfo(ssl_info); | 2044 return connection_->socket()->GetSSLInfo(ssl_info); |
| 2045 } | 2045 } |
| 2046 | 2046 |
| 2047 Error SpdySession::GetSignedEKMForTokenBinding(crypto::ECPrivateKey* key, |
| 2048 std::vector<uint8_t>* out) { |
| 2049 if (!is_secure_) { |
| 2050 NOTREACHED(); |
| 2051 return ERR_FAILED; |
| 2052 } |
| 2053 SSLClientSocket* ssl_socket = |
| 2054 static_cast<SSLClientSocket*>(connection_->socket()); |
| 2055 return ssl_socket->GetSignedEKMForTokenBinding(key, out); |
| 2056 } |
| 2057 |
| 2047 void SpdySession::OnError(SpdyFramer::SpdyError error_code) { | 2058 void SpdySession::OnError(SpdyFramer::SpdyError error_code) { |
| 2048 CHECK(in_io_loop_); | 2059 CHECK(in_io_loop_); |
| 2049 | 2060 |
| 2050 RecordProtocolErrorHistogram(MapFramerErrorToProtocolError(error_code)); | 2061 RecordProtocolErrorHistogram(MapFramerErrorToProtocolError(error_code)); |
| 2051 std::string description = | 2062 std::string description = |
| 2052 base::StringPrintf("Framer error: %d (%s).", | 2063 base::StringPrintf("Framer error: %d (%s).", |
| 2053 error_code, | 2064 error_code, |
| 2054 SpdyFramer::ErrorCodeToString(error_code)); | 2065 SpdyFramer::ErrorCodeToString(error_code)); |
| 2055 DoDrainSession(MapFramerErrorToNetError(error_code), description); | 2066 DoDrainSession(MapFramerErrorToNetError(error_code), description); |
| 2056 } | 2067 } |
| (...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3273 if (!queue->empty()) { | 3284 if (!queue->empty()) { |
| 3274 SpdyStreamId stream_id = queue->front(); | 3285 SpdyStreamId stream_id = queue->front(); |
| 3275 queue->pop_front(); | 3286 queue->pop_front(); |
| 3276 return stream_id; | 3287 return stream_id; |
| 3277 } | 3288 } |
| 3278 } | 3289 } |
| 3279 return 0; | 3290 return 0; |
| 3280 } | 3291 } |
| 3281 | 3292 |
| 3282 } // namespace net | 3293 } // namespace net |
| OLD | NEW |