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

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

Issue 1934043002: quic: check for stream_factory_ to be non-null before all accesses. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | testing/buildbot/chromium.fyi.json » ('j') | testing/buildbot/chromium.fyi.json » ('J')
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_chromium_client_session.h" 5 #include "net/quic/quic_chromium_client_session.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 698
699 void QuicChromiumClientSession::OnClosedStream() { 699 void QuicChromiumClientSession::OnClosedStream() {
700 if (GetNumOpenOutgoingStreams() < max_open_outgoing_streams() && 700 if (GetNumOpenOutgoingStreams() < max_open_outgoing_streams() &&
701 !stream_requests_.empty() && crypto_stream_->encryption_established() && 701 !stream_requests_.empty() && crypto_stream_->encryption_established() &&
702 !goaway_received() && !going_away_ && connection()->connected()) { 702 !goaway_received() && !going_away_ && connection()->connected()) {
703 StreamRequest* request = stream_requests_.front(); 703 StreamRequest* request = stream_requests_.front();
704 stream_requests_.pop_front(); 704 stream_requests_.pop_front();
705 request->OnRequestCompleteSuccess(CreateOutgoingReliableStreamImpl()); 705 request->OnRequestCompleteSuccess(CreateOutgoingReliableStreamImpl());
706 } 706 }
707 707
708 if (GetNumOpenOutgoingStreams() == 0) { 708 if (GetNumOpenOutgoingStreams() == 0 && stream_factory_) {
709 stream_factory_->OnIdleSession(this); 709 stream_factory_->OnIdleSession(this);
710 } 710 }
711 } 711 }
712 712
713 void QuicChromiumClientSession::OnCryptoHandshakeEvent( 713 void QuicChromiumClientSession::OnCryptoHandshakeEvent(
714 CryptoHandshakeEvent event) { 714 CryptoHandshakeEvent event) {
715 if (stream_factory_ && event == HANDSHAKE_CONFIRMED && 715 if (stream_factory_ && event == HANDSHAKE_CONFIRMED &&
716 (stream_factory_->OnHandshakeConfirmed( 716 (stream_factory_->OnHandshakeConfirmed(
717 this, logger_->ReceivedPacketLossRate()))) { 717 this, logger_->ReceivedPacketLossRate()))) {
718 return; 718 return;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 NotifyFactoryOfSessionClosedLater(); 902 NotifyFactoryOfSessionClosedLater();
903 } 903 }
904 904
905 void QuicChromiumClientSession::OnSuccessfulVersionNegotiation( 905 void QuicChromiumClientSession::OnSuccessfulVersionNegotiation(
906 const QuicVersion& version) { 906 const QuicVersion& version) {
907 logger_->OnSuccessfulVersionNegotiation(version); 907 logger_->OnSuccessfulVersionNegotiation(version);
908 QuicSpdySession::OnSuccessfulVersionNegotiation(version); 908 QuicSpdySession::OnSuccessfulVersionNegotiation(version);
909 } 909 }
910 910
911 void QuicChromiumClientSession::OnPathDegrading() { 911 void QuicChromiumClientSession::OnPathDegrading() {
912 stream_factory_->MaybeMigrateSessionEarly(this); 912 if (stream_factory_) {
913 stream_factory_->MaybeMigrateSessionEarly(this);
914 }
913 } 915 }
914 916
915 void QuicChromiumClientSession::OnProofValid( 917 void QuicChromiumClientSession::OnProofValid(
916 const QuicCryptoClientConfig::CachedState& cached) { 918 const QuicCryptoClientConfig::CachedState& cached) {
917 DCHECK(cached.proof_valid()); 919 DCHECK(cached.proof_valid());
918 920
919 if (!server_info_) { 921 if (!server_info_) {
920 return; 922 return;
921 } 923 }
922 924
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 } 1177 }
1176 1178
1177 void QuicChromiumClientSession::DeletePromised( 1179 void QuicChromiumClientSession::DeletePromised(
1178 QuicClientPromisedInfo* promised) { 1180 QuicClientPromisedInfo* promised) {
1179 if (IsOpenStream(promised->id())) 1181 if (IsOpenStream(promised->id()))
1180 streams_pushed_and_claimed_count_++; 1182 streams_pushed_and_claimed_count_++;
1181 QuicClientSessionBase::DeletePromised(promised); 1183 QuicClientSessionBase::DeletePromised(promised);
1182 } 1184 }
1183 1185
1184 } // namespace net 1186 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | testing/buildbot/chromium.fyi.json » ('j') | testing/buildbot/chromium.fyi.json » ('J')

Powered by Google App Engine
This is Rietveld 408576698