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

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

Issue 2778943002: Pass HttpServerProperties in to QuicHttpStream so that it can mark QUIC broken. (Closed)
Patch Set: Rebase 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_stream_factory.h ('k') | net/quic/chromium/quic_stream_factory_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_stream_factory.h" 5 #include "net/quic/chromium/quic_stream_factory.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <tuple> 8 #include <tuple>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); 656 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
657 session_ = nullptr; 657 session_ = nullptr;
658 return OK; 658 return OK;
659 } 659 }
660 660
661 factory_->ActivateSession(key_, session_); 661 factory_->ActivateSession(key_, session_);
662 662
663 return OK; 663 return OK;
664 } 664 }
665 665
666 QuicStreamRequest::QuicStreamRequest(QuicStreamFactory* factory) 666 QuicStreamRequest::QuicStreamRequest(
667 : factory_(factory) {} 667 QuicStreamFactory* factory,
668 HttpServerProperties* http_server_properties)
669 : factory_(factory), http_server_properties_(http_server_properties) {}
668 670
669 QuicStreamRequest::~QuicStreamRequest() { 671 QuicStreamRequest::~QuicStreamRequest() {
670 if (factory_ && !callback_.is_null()) 672 if (factory_ && !callback_.is_null())
671 factory_->CancelRequest(this); 673 factory_->CancelRequest(this);
672 } 674 }
673 675
674 int QuicStreamRequest::Request(const HostPortPair& destination, 676 int QuicStreamRequest::Request(const HostPortPair& destination,
675 PrivacyMode privacy_mode, 677 PrivacyMode privacy_mode,
676 int cert_verify_flags, 678 int cert_verify_flags,
677 const GURL& url, 679 const GURL& url,
(...skipping 29 matching lines...) Expand all
707 709
708 base::TimeDelta QuicStreamRequest::GetTimeDelayForWaitingJob() const { 710 base::TimeDelta QuicStreamRequest::GetTimeDelayForWaitingJob() const {
709 if (!factory_) 711 if (!factory_)
710 return base::TimeDelta(); 712 return base::TimeDelta();
711 return factory_->GetTimeDelayForWaitingJob(server_id_); 713 return factory_->GetTimeDelayForWaitingJob(server_id_);
712 } 714 }
713 715
714 std::unique_ptr<QuicHttpStream> QuicStreamRequest::CreateStream() { 716 std::unique_ptr<QuicHttpStream> QuicStreamRequest::CreateStream() {
715 if (!session_) 717 if (!session_)
716 return nullptr; 718 return nullptr;
717 return base::MakeUnique<QuicHttpStream>(session_); 719 return base::MakeUnique<QuicHttpStream>(session_, http_server_properties_);
718 } 720 }
719 721
720 std::unique_ptr<BidirectionalStreamImpl> 722 std::unique_ptr<BidirectionalStreamImpl>
721 QuicStreamRequest::CreateBidirectionalStreamImpl() { 723 QuicStreamRequest::CreateBidirectionalStreamImpl() {
722 if (!session_) 724 if (!session_)
723 return nullptr; 725 return nullptr;
724 return base::MakeUnique<BidirectionalStreamQuicImpl>(session_); 726 return base::MakeUnique<BidirectionalStreamQuicImpl>(session_);
725 } 727 }
726 728
727 QuicStreamFactory::QuicStreamFactory( 729 QuicStreamFactory::QuicStreamFactory(
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 job_requests_map_.erase(server_id); 1185 job_requests_map_.erase(server_id);
1184 } 1186 }
1185 1187
1186 void QuicStreamFactory::OnCertVerifyJobComplete(CertVerifierJob* job, int rv) { 1188 void QuicStreamFactory::OnCertVerifyJobComplete(CertVerifierJob* job, int rv) {
1187 active_cert_verifier_jobs_.erase(job->server_id()); 1189 active_cert_verifier_jobs_.erase(job->server_id());
1188 } 1190 }
1189 1191
1190 std::unique_ptr<QuicHttpStream> QuicStreamFactory::CreateFromSession( 1192 std::unique_ptr<QuicHttpStream> QuicStreamFactory::CreateFromSession(
1191 QuicChromiumClientSession* session) { 1193 QuicChromiumClientSession* session) {
1192 return std::unique_ptr<QuicHttpStream>( 1194 return std::unique_ptr<QuicHttpStream>(
1193 new QuicHttpStream(session->GetWeakPtr())); 1195 new QuicHttpStream(session->GetWeakPtr(), http_server_properties_));
1194 } 1196 }
1195 1197
1196 bool QuicStreamFactory::IsQuicDisabled() const { 1198 bool QuicStreamFactory::IsQuicDisabled() const {
1197 return status_ != OPEN; 1199 return status_ != OPEN;
1198 } 1200 }
1199 1201
1200 bool QuicStreamFactory::OnHandshakeConfirmed( 1202 bool QuicStreamFactory::OnHandshakeConfirmed(
1201 QuicChromiumClientSession* session) { 1203 QuicChromiumClientSession* session) {
1202 if (!IsQuicDisabled()) 1204 if (!IsQuicDisabled())
1203 return false; 1205 return false;
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
1985 void QuicStreamFactory::OpenFactory() { 1987 void QuicStreamFactory::OpenFactory() {
1986 status_ = OPEN; 1988 status_ = OPEN;
1987 } 1989 }
1988 1990
1989 void QuicStreamFactory::MaybeClearConsecutiveDisabledCount() { 1991 void QuicStreamFactory::MaybeClearConsecutiveDisabledCount() {
1990 if (status_ == OPEN) 1992 if (status_ == OPEN)
1991 consecutive_disabled_count_ = 0; 1993 consecutive_disabled_count_ = 0;
1992 } 1994 }
1993 1995
1994 } // namespace net 1996 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/chromium/quic_stream_factory.h ('k') | net/quic/chromium/quic_stream_factory_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698