| 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 if (request_info->url.SchemeIsSecure()) { | 63 if (request_info->url.SchemeIsSecure()) { |
| 64 SSLInfo ssl_info; | 64 SSLInfo ssl_info; |
| 65 bool secure_session = session_->GetSSLInfo(&ssl_info) && ssl_info.cert; | 65 bool secure_session = |
| 66 session_->GetSSLInfo(&ssl_info) && ssl_info.cert.get(); |
| 66 UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.SecureResourceSecureSession", | 67 UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.SecureResourceSecureSession", |
| 67 secure_session); | 68 secure_session); |
| 68 if (!secure_session) | 69 if (!secure_session) |
| 69 return ERR_REQUEST_FOR_SECURE_RESOURCE_OVER_INSECURE_QUIC; | 70 return ERR_REQUEST_FOR_SECURE_RESOURCE_OVER_INSECURE_QUIC; |
| 70 } | 71 } |
| 71 | 72 |
| 72 stream_net_log_ = stream_net_log; | 73 stream_net_log_ = stream_net_log; |
| 73 request_info_ = request_info; | 74 request_info_ = request_info; |
| 74 request_time_ = base::Time::Now(); | 75 request_time_ = base::Time::Now(); |
| 75 priority_ = priority; | 76 priority_ = priority; |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 | 550 |
| 550 void QuicHttpStream::BufferResponseBody(const char* data, int length) { | 551 void QuicHttpStream::BufferResponseBody(const char* data, int length) { |
| 551 if (length == 0) | 552 if (length == 0) |
| 552 return; | 553 return; |
| 553 IOBufferWithSize* io_buffer = new IOBufferWithSize(length); | 554 IOBufferWithSize* io_buffer = new IOBufferWithSize(length); |
| 554 memcpy(io_buffer->data(), data, length); | 555 memcpy(io_buffer->data(), data, length); |
| 555 response_body_.push_back(make_scoped_refptr(io_buffer)); | 556 response_body_.push_back(make_scoped_refptr(io_buffer)); |
| 556 } | 557 } |
| 557 | 558 |
| 558 } // namespace net | 559 } // namespace net |
| OLD | NEW |