| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 RequestPriority priority, | 55 RequestPriority priority, |
| 56 const BoundNetLog& stream_net_log, | 56 const BoundNetLog& stream_net_log, |
| 57 const CompletionCallback& callback) { | 57 const CompletionCallback& callback) { |
| 58 DCHECK(!stream_); | 58 DCHECK(!stream_); |
| 59 if (!session_) | 59 if (!session_) |
| 60 return was_handshake_confirmed_ ? ERR_CONNECTION_CLOSED : | 60 return was_handshake_confirmed_ ? ERR_CONNECTION_CLOSED : |
| 61 ERR_QUIC_HANDSHAKE_FAILED; | 61 ERR_QUIC_HANDSHAKE_FAILED; |
| 62 | 62 |
| 63 stream_net_log.AddEvent( | 63 stream_net_log.AddEvent( |
| 64 NetLog::TYPE_HTTP_STREAM_REQUEST_BOUND_TO_QUIC_SESSION, | 64 NetLog::TYPE_HTTP_STREAM_REQUEST_BOUND_TO_QUIC_SESSION, |
| 65 stream_net_log.source().ToEventParametersCallback()); | 65 session_->net_log().source().ToEventParametersCallback()); |
| 66 | 66 |
| 67 if (request_info->url.SchemeIsSecure()) { | 67 if (request_info->url.SchemeIsSecure()) { |
| 68 SSLInfo ssl_info; | 68 SSLInfo ssl_info; |
| 69 bool secure_session = | 69 bool secure_session = |
| 70 session_->GetSSLInfo(&ssl_info) && ssl_info.cert.get(); | 70 session_->GetSSLInfo(&ssl_info) && ssl_info.cert.get(); |
| 71 UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.SecureResourceSecureSession", | 71 UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.SecureResourceSecureSession", |
| 72 secure_session); | 72 secure_session); |
| 73 if (!secure_session) | 73 if (!secure_session) |
| 74 return ERR_REQUEST_FOR_SECURE_RESOURCE_OVER_INSECURE_QUIC; | 74 return ERR_REQUEST_FOR_SECURE_RESOURCE_OVER_INSECURE_QUIC; |
| 75 } | 75 } |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 | 572 |
| 573 void QuicHttpStream::BufferResponseBody(const char* data, int length) { | 573 void QuicHttpStream::BufferResponseBody(const char* data, int length) { |
| 574 if (length == 0) | 574 if (length == 0) |
| 575 return; | 575 return; |
| 576 IOBufferWithSize* io_buffer = new IOBufferWithSize(length); | 576 IOBufferWithSize* io_buffer = new IOBufferWithSize(length); |
| 577 memcpy(io_buffer->data(), data, length); | 577 memcpy(io_buffer->data(), data, length); |
| 578 response_body_.push_back(make_scoped_refptr(io_buffer)); | 578 response_body_.push_back(make_scoped_refptr(io_buffer)); |
| 579 } | 579 } |
| 580 | 580 |
| 581 } // namespace net | 581 } // namespace net |
| OLD | NEW |