OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |