| 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/quic/quic_http_stream.h" | 5 #include "net/quic/quic_http_stream.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 const CompletionCallback& callback) { | 58 const CompletionCallback& callback) { |
| 59 DCHECK(!stream_); | 59 DCHECK(!stream_); |
| 60 if (!session_) | 60 if (!session_) |
| 61 return was_handshake_confirmed_ ? ERR_CONNECTION_CLOSED : | 61 return was_handshake_confirmed_ ? ERR_CONNECTION_CLOSED : |
| 62 ERR_QUIC_HANDSHAKE_FAILED; | 62 ERR_QUIC_HANDSHAKE_FAILED; |
| 63 | 63 |
| 64 stream_net_log.AddEvent( | 64 stream_net_log.AddEvent( |
| 65 NetLog::TYPE_HTTP_STREAM_REQUEST_BOUND_TO_QUIC_SESSION, | 65 NetLog::TYPE_HTTP_STREAM_REQUEST_BOUND_TO_QUIC_SESSION, |
| 66 session_->net_log().source().ToEventParametersCallback()); | 66 session_->net_log().source().ToEventParametersCallback()); |
| 67 | 67 |
| 68 if (request_info->url.SchemeIsSecure()) { | 68 if (request_info->url.SchemeIsCryptographic()) { |
| 69 SSLInfo ssl_info; | 69 SSLInfo ssl_info; |
| 70 bool secure_session = | 70 bool secure_session = |
| 71 session_->GetSSLInfo(&ssl_info) && ssl_info.cert.get(); | 71 session_->GetSSLInfo(&ssl_info) && ssl_info.cert.get(); |
| 72 UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.SecureResourceSecureSession", | 72 UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.SecureResourceSecureSession", |
| 73 secure_session); | 73 secure_session); |
| 74 if (!secure_session) | 74 if (!secure_session) |
| 75 return ERR_REQUEST_FOR_SECURE_RESOURCE_OVER_INSECURE_QUIC; | 75 return ERR_REQUEST_FOR_SECURE_RESOURCE_OVER_INSECURE_QUIC; |
| 76 } | 76 } |
| 77 | 77 |
| 78 stream_net_log_ = stream_net_log; | 78 stream_net_log_ = stream_net_log; |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 IOBufferWithSize* io_buffer = new IOBufferWithSize(length); | 578 IOBufferWithSize* io_buffer = new IOBufferWithSize(length); |
| 579 memcpy(io_buffer->data(), data, length); | 579 memcpy(io_buffer->data(), data, length); |
| 580 response_body_.push_back(make_scoped_refptr(io_buffer)); | 580 response_body_.push_back(make_scoped_refptr(io_buffer)); |
| 581 } | 581 } |
| 582 | 582 |
| 583 SpdyMajorVersion QuicHttpStream::GetSpdyVersion() { | 583 SpdyMajorVersion QuicHttpStream::GetSpdyVersion() { |
| 584 return SpdyUtils::GetSpdyVersionForQuicVersion(stream_->version()); | 584 return SpdyUtils::GetSpdyVersionForQuicVersion(stream_->version()); |
| 585 } | 585 } |
| 586 | 586 |
| 587 } // namespace net | 587 } // namespace net |
| OLD | NEW |