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 1887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1898 void QuicConnection::CloseConnection(QuicErrorCode error, bool from_peer) { | 1898 void QuicConnection::CloseConnection(QuicErrorCode error, bool from_peer) { |
1899 if (!connected_) { | 1899 if (!connected_) { |
1900 DLOG(DFATAL) << "Error: attempt to close an already closed connection" | 1900 DLOG(DFATAL) << "Error: attempt to close an already closed connection" |
1901 << base::debug::StackTrace().ToString(); | 1901 << base::debug::StackTrace().ToString(); |
1902 return; | 1902 return; |
1903 } | 1903 } |
1904 connected_ = false; | 1904 connected_ = false; |
1905 if (debug_visitor_ != nullptr) { | 1905 if (debug_visitor_ != nullptr) { |
1906 debug_visitor_->OnConnectionClosed(error, from_peer); | 1906 debug_visitor_->OnConnectionClosed(error, from_peer); |
1907 } | 1907 } |
| 1908 DCHECK(visitor_ != nullptr); |
1908 visitor_->OnConnectionClosed(error, from_peer); | 1909 visitor_->OnConnectionClosed(error, from_peer); |
1909 // Cancel the alarms so they don't trigger any action now that the | 1910 // Cancel the alarms so they don't trigger any action now that the |
1910 // connection is closed. | 1911 // connection is closed. |
1911 ack_alarm_->Cancel(); | 1912 ack_alarm_->Cancel(); |
1912 ping_alarm_->Cancel(); | 1913 ping_alarm_->Cancel(); |
1913 fec_alarm_->Cancel(); | 1914 fec_alarm_->Cancel(); |
1914 resume_writes_alarm_->Cancel(); | 1915 resume_writes_alarm_->Cancel(); |
1915 retransmission_alarm_->Cancel(); | 1916 retransmission_alarm_->Cancel(); |
1916 send_alarm_->Cancel(); | 1917 send_alarm_->Cancel(); |
1917 timeout_alarm_->Cancel(); | 1918 timeout_alarm_->Cancel(); |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2125 } | 2126 } |
2126 for (const QuicFrame& frame : retransmittable_frames->frames()) { | 2127 for (const QuicFrame& frame : retransmittable_frames->frames()) { |
2127 if (frame.type == CONNECTION_CLOSE_FRAME) { | 2128 if (frame.type == CONNECTION_CLOSE_FRAME) { |
2128 return true; | 2129 return true; |
2129 } | 2130 } |
2130 } | 2131 } |
2131 return false; | 2132 return false; |
2132 } | 2133 } |
2133 | 2134 |
2134 } // namespace net | 2135 } // namespace net |
OLD | NEW |