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

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

Issue 1679113002: QUIC - Make |visitor_| nullptr check consistent with other nullptr (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 2059 matching lines...) Expand 10 before | Expand all | Expand 10 after
2070 void QuicConnection::CloseConnection(QuicErrorCode error, bool from_peer) { 2070 void QuicConnection::CloseConnection(QuicErrorCode error, bool from_peer) {
2071 if (!connected_) { 2071 if (!connected_) {
2072 DVLOG(1) << "Connection is already closed."; 2072 DVLOG(1) << "Connection is already closed.";
2073 return; 2073 return;
2074 } 2074 }
2075 connected_ = false; 2075 connected_ = false;
2076 DCHECK(visitor_ != nullptr); 2076 DCHECK(visitor_ != nullptr);
2077 // TODO(rtenneti): crbug.com/546668. A temporary fix. Added a check for null 2077 // TODO(rtenneti): crbug.com/546668. A temporary fix. Added a check for null
2078 // |visitor_| to fix crash bug. Delete |visitor_| check and histogram after 2078 // |visitor_| to fix crash bug. Delete |visitor_| check and histogram after
2079 // fix is merged. 2079 // fix is merged.
2080 if (visitor_) { 2080 if (visitor_ != nullptr) {
2081 visitor_->OnConnectionClosed(error, from_peer); 2081 visitor_->OnConnectionClosed(error, from_peer);
2082 } else { 2082 } else {
2083 UMA_HISTOGRAM_BOOLEAN("Net.QuicCloseConnection.NullVisitor", true); 2083 UMA_HISTOGRAM_BOOLEAN("Net.QuicCloseConnection.NullVisitor", true);
2084 } 2084 }
2085 if (debug_visitor_ != nullptr) { 2085 if (debug_visitor_ != nullptr) {
2086 debug_visitor_->OnConnectionClosed(error, from_peer); 2086 debug_visitor_->OnConnectionClosed(error, from_peer);
2087 } 2087 }
2088 // Cancel the alarms so they don't trigger any action now that the 2088 // Cancel the alarms so they don't trigger any action now that the
2089 // connection is closed. 2089 // connection is closed.
2090 ack_alarm_->Cancel(); 2090 ack_alarm_->Cancel();
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
2535 void QuicConnection::OnPathClosed(QuicPathId path_id) { 2535 void QuicConnection::OnPathClosed(QuicPathId path_id) {
2536 // Stop receiving packets on this path. 2536 // Stop receiving packets on this path.
2537 framer_.OnPathClosed(path_id); 2537 framer_.OnPathClosed(path_id);
2538 } 2538 }
2539 2539
2540 bool QuicConnection::ack_frame_updated() const { 2540 bool QuicConnection::ack_frame_updated() const {
2541 return received_packet_manager_.ack_frame_updated(); 2541 return received_packet_manager_.ack_frame_updated();
2542 } 2542 }
2543 2543
2544 } // namespace net 2544 } // 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