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

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

Issue 2365243004: QUIC/1+SPYD/3 => QUIC (Closed)
Patch Set: Rebase. Created 4 years, 2 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
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/chromium/quic_http_stream.h" 5 #include "net/quic/chromium/quic_http_stream.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 return session_->GetTokenBindingSignature(key, tb_type, out); 423 return session_->GetTokenBindingSignature(key, tb_type, out);
424 } 424 }
425 425
426 void QuicHttpStream::Drain(HttpNetworkSession* session) { 426 void QuicHttpStream::Drain(HttpNetworkSession* session) {
427 NOTREACHED(); 427 NOTREACHED();
428 Close(false); 428 Close(false);
429 delete this; 429 delete this;
430 } 430 }
431 431
432 void QuicHttpStream::PopulateNetErrorDetails(NetErrorDetails* details) { 432 void QuicHttpStream::PopulateNetErrorDetails(NetErrorDetails* details) {
433 details->connection_info = HttpResponseInfo::CONNECTION_INFO_QUIC1_SPDY3; 433 details->connection_info = HttpResponseInfo::CONNECTION_INFO_QUIC;
434 if (was_handshake_confirmed_) 434 if (was_handshake_confirmed_)
435 details->quic_connection_error = quic_connection_error_; 435 details->quic_connection_error = quic_connection_error_;
436 if (session_) { 436 if (session_) {
437 session_->PopulateNetErrorDetails(details); 437 session_->PopulateNetErrorDetails(details);
438 } else { 438 } else {
439 details->quic_port_migration_detected = port_migration_detected_; 439 details->quic_port_migration_detected = port_migration_detected_;
440 } 440 }
441 } 441 }
442 442
443 void QuicHttpStream::SetPriority(RequestPriority priority) { 443 void QuicHttpStream::SetPriority(RequestPriority priority) {
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 } 781 }
782 782
783 int QuicHttpStream::ProcessResponseHeaders(const SpdyHeaderBlock& headers) { 783 int QuicHttpStream::ProcessResponseHeaders(const SpdyHeaderBlock& headers) {
784 if (!SpdyHeadersToHttpResponse(headers, response_info_)) { 784 if (!SpdyHeadersToHttpResponse(headers, response_info_)) {
785 DLOG(WARNING) << "Invalid headers"; 785 DLOG(WARNING) << "Invalid headers";
786 return ERR_QUIC_PROTOCOL_ERROR; 786 return ERR_QUIC_PROTOCOL_ERROR;
787 } 787 }
788 // Put the peer's IP address and port into the response. 788 // Put the peer's IP address and port into the response.
789 IPEndPoint address = session_->peer_address(); 789 IPEndPoint address = session_->peer_address();
790 response_info_->socket_address = HostPortPair::FromIPEndPoint(address); 790 response_info_->socket_address = HostPortPair::FromIPEndPoint(address);
791 response_info_->connection_info = 791 response_info_->connection_info = HttpResponseInfo::CONNECTION_INFO_QUIC;
792 HttpResponseInfo::CONNECTION_INFO_QUIC1_SPDY3;
793 response_info_->vary_data.Init(*request_info_, 792 response_info_->vary_data.Init(*request_info_,
794 *response_info_->headers.get()); 793 *response_info_->headers.get());
795 response_info_->was_alpn_negotiated = true; 794 response_info_->was_alpn_negotiated = true;
796 response_info_->alpn_negotiated_protocol = "quic/1+spdy/3"; 795 response_info_->alpn_negotiated_protocol = "quic/1+spdy/3";
797 response_info_->response_time = base::Time::Now(); 796 response_info_->response_time = base::Time::Now();
798 response_info_->request_time = request_time_; 797 response_info_->request_time = request_time_;
799 response_headers_received_ = true; 798 response_headers_received_ = true;
800 799
801 // Populate |connect_timing_| when response headers are received. This should 800 // Populate |connect_timing_| when response headers are received. This should
802 // take care of 0-RTT where request is sent before handshake is confirmed. 801 // take care of 0-RTT where request is sent before handshake is confirmed.
(...skipping 30 matching lines...) Expand all
833 closed_is_first_stream_ = stream_->IsFirstStream(); 832 closed_is_first_stream_ = stream_->IsFirstStream();
834 stream_ = nullptr; 833 stream_ = nullptr;
835 834
836 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress 835 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress
837 // read. 836 // read.
838 if (request_body_stream_) 837 if (request_body_stream_)
839 request_body_stream_->Reset(); 838 request_body_stream_->Reset();
840 } 839 }
841 840
842 } // namespace net 841 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698