Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(477)

Side by Side Diff: net/quic/quic_http_stream.cc

Issue 1057983002: Link HttpStreams to QuicSessions in net-internals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/log/net_log_event_type_list.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/log/net_log_event_type_list.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698