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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 int QuicHttpStream::InitializeStream(const HttpRequestInfo* request_info, | 54 int QuicHttpStream::InitializeStream(const HttpRequestInfo* request_info, |
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( |
| 64 NetLog::TYPE_HTTP_STREAM_REQUEST_BOUND_TO_QUIC_SESSION, |
| 65 stream_net_log.source().ToEventParametersCallback()); |
| 66 |
63 if (request_info->url.SchemeIsSecure()) { | 67 if (request_info->url.SchemeIsSecure()) { |
64 SSLInfo ssl_info; | 68 SSLInfo ssl_info; |
65 bool secure_session = | 69 bool secure_session = |
66 session_->GetSSLInfo(&ssl_info) && ssl_info.cert.get(); | 70 session_->GetSSLInfo(&ssl_info) && ssl_info.cert.get(); |
67 UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.SecureResourceSecureSession", | 71 UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.SecureResourceSecureSession", |
68 secure_session); | 72 secure_session); |
69 if (!secure_session) | 73 if (!secure_session) |
70 return ERR_REQUEST_FOR_SECURE_RESOURCE_OVER_INSECURE_QUIC; | 74 return ERR_REQUEST_FOR_SECURE_RESOURCE_OVER_INSECURE_QUIC; |
71 } | 75 } |
72 | 76 |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 | 572 |
569 void QuicHttpStream::BufferResponseBody(const char* data, int length) { | 573 void QuicHttpStream::BufferResponseBody(const char* data, int length) { |
570 if (length == 0) | 574 if (length == 0) |
571 return; | 575 return; |
572 IOBufferWithSize* io_buffer = new IOBufferWithSize(length); | 576 IOBufferWithSize* io_buffer = new IOBufferWithSize(length); |
573 memcpy(io_buffer->data(), data, length); | 577 memcpy(io_buffer->data(), data, length); |
574 response_body_.push_back(make_scoped_refptr(io_buffer)); | 578 response_body_.push_back(make_scoped_refptr(io_buffer)); |
575 } | 579 } |
576 | 580 |
577 } // namespace net | 581 } // namespace net |
OLD | NEW |