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

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

Issue 2805043004: Add a GetAlternativeService method to HttpStream to return any (Closed)
Patch Set: fix Created 3 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/quic/chromium/quic_http_stream.h ('k') | net/quic/chromium/quic_http_stream_test.cc » ('j') | 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/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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 is_first_stream = stream_->IsFirstStream(); 416 is_first_stream = stream_->IsFirstStream();
417 if (is_first_stream) { 417 if (is_first_stream) {
418 load_timing_info->socket_reused = false; 418 load_timing_info->socket_reused = false;
419 load_timing_info->connect_timing = connect_timing_; 419 load_timing_info->connect_timing = connect_timing_;
420 } else { 420 } else {
421 load_timing_info->socket_reused = true; 421 load_timing_info->socket_reused = true;
422 } 422 }
423 return true; 423 return true;
424 } 424 }
425 425
426 bool QuicHttpStream::GetAlternativeService(
427 AlternativeService* alternative_service) const {
428 alternative_service->protocol = kProtoQUIC;
429 alternative_service->host = server_id_.host();
430 alternative_service->port = server_id_.port();
431 return true;
432 }
433
426 void QuicHttpStream::PopulateNetErrorDetails(NetErrorDetails* details) { 434 void QuicHttpStream::PopulateNetErrorDetails(NetErrorDetails* details) {
427 details->connection_info = ConnectionInfoFromQuicVersion(quic_version_); 435 details->connection_info = ConnectionInfoFromQuicVersion(quic_version_);
428 if (was_handshake_confirmed_) 436 if (was_handshake_confirmed_)
429 details->quic_connection_error = quic_connection_error_; 437 details->quic_connection_error = quic_connection_error_;
430 if (session_) { 438 if (session_) {
431 session_->PopulateNetErrorDetails(details); 439 session_->PopulateNetErrorDetails(details);
432 } else { 440 } else {
433 details->quic_port_migration_detected = port_migration_detected_; 441 details->quic_port_migration_detected = port_migration_detected_;
434 } 442 }
435 } 443 }
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 if (!response_headers_received_ && 897 if (!response_headers_received_ &&
890 http_server_properties_->IsAlternativeServiceBroken(AlternativeService( 898 http_server_properties_->IsAlternativeServiceBroken(AlternativeService(
891 kProtoQUIC, server_id_.host(), server_id_.port()))) { 899 kProtoQUIC, server_id_.host(), server_id_.port()))) {
892 return ERR_QUIC_BROKEN_ERROR; 900 return ERR_QUIC_BROKEN_ERROR;
893 } 901 }
894 902
895 return ERR_QUIC_PROTOCOL_ERROR; 903 return ERR_QUIC_PROTOCOL_ERROR;
896 } 904 }
897 905
898 } // namespace net 906 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/chromium/quic_http_stream.h ('k') | net/quic/chromium/quic_http_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698