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_connection.cc

Issue 1656673002: QUIC - Fix for crash in stable channel. Check for null |visitor_| before (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | 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_connection.h" 5 #include "net/quic/quic_connection.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 #include <sys/types.h> 8 #include <sys/types.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 2055 matching lines...) Expand 10 before | Expand all | Expand 10 after
2066 packet_generator_.FlushAllQueuedFrames(); 2066 packet_generator_.FlushAllQueuedFrames();
2067 } 2067 }
2068 2068
2069 void QuicConnection::CloseConnection(QuicErrorCode error, bool from_peer) { 2069 void QuicConnection::CloseConnection(QuicErrorCode error, bool from_peer) {
2070 if (!connected_) { 2070 if (!connected_) {
2071 DVLOG(1) << "Connection is already closed."; 2071 DVLOG(1) << "Connection is already closed.";
2072 return; 2072 return;
2073 } 2073 }
2074 connected_ = false; 2074 connected_ = false;
2075 DCHECK(visitor_ != nullptr); 2075 DCHECK(visitor_ != nullptr);
2076 visitor_->OnConnectionClosed(error, from_peer); 2076 // TODO(rtenneti): crbug.com/546668. A temporary fix. Added a check for null
2077 // |visitor_| to fix crash bug. Delete it after fix is merged.
2078 if (visitor_) {
2079 visitor_->OnConnectionClosed(error, from_peer);
2080 }
Ryan Hamilton 2016/02/01 03:39:31 Would it be worth adding an: } else { UMA_HISTO
ramant (doing other things) 2016/02/01 17:50:27 Good idea. Done.
2077 if (debug_visitor_ != nullptr) { 2081 if (debug_visitor_ != nullptr) {
2078 debug_visitor_->OnConnectionClosed(error, from_peer); 2082 debug_visitor_->OnConnectionClosed(error, from_peer);
2079 } 2083 }
2080 // Cancel the alarms so they don't trigger any action now that the 2084 // Cancel the alarms so they don't trigger any action now that the
2081 // connection is closed. 2085 // connection is closed.
2082 ack_alarm_->Cancel(); 2086 ack_alarm_->Cancel();
2083 ping_alarm_->Cancel(); 2087 ping_alarm_->Cancel();
2084 fec_alarm_->Cancel(); 2088 fec_alarm_->Cancel();
2085 resume_writes_alarm_->Cancel(); 2089 resume_writes_alarm_->Cancel();
2086 retransmission_alarm_->Cancel(); 2090 retransmission_alarm_->Cancel();
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
2441 void QuicConnection::OnPathClosed(QuicPathId path_id) { 2445 void QuicConnection::OnPathClosed(QuicPathId path_id) {
2442 // Stop receiving packets on this path. 2446 // Stop receiving packets on this path.
2443 framer_.OnPathClosed(path_id); 2447 framer_.OnPathClosed(path_id);
2444 } 2448 }
2445 2449
2446 bool QuicConnection::ack_frame_updated() const { 2450 bool QuicConnection::ack_frame_updated() const {
2447 return received_packet_manager_.ack_frame_updated(); 2451 return received_packet_manager_.ack_frame_updated();
2448 } 2452 }
2449 2453
2450 } // namespace net 2454 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698