Chromium Code Reviews| Index: net/quic/quic_connection.cc |
| diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc |
| index 0e8371e5bf625937ec8c730e1c6eb86a6fb3ea6d..d33f545d49377d3477c5efade48fcfb16e3db805 100644 |
| --- a/net/quic/quic_connection.cc |
| +++ b/net/quic/quic_connection.cc |
| @@ -18,6 +18,7 @@ |
| #include "base/logging.h" |
| #include "base/macros.h" |
| #include "base/memory/ref_counted.h" |
| +#include "base/metrics/histogram_macros.h" |
| #include "base/stl_util.h" |
| #include "base/strings/stringprintf.h" |
| #include "net/base/net_errors.h" |
| @@ -2073,7 +2074,14 @@ void QuicConnection::CloseConnection(QuicErrorCode error, bool from_peer) { |
| } |
| connected_ = false; |
| DCHECK(visitor_ != nullptr); |
| - visitor_->OnConnectionClosed(error, from_peer); |
| + // TODO(rtenneti): crbug.com/546668. A temporary fix. Added a check for null |
| + // |visitor_| to fix crash bug. Delete |visitor_| check and histogram after |
| + // fix is merged. |
| + if (visitor_) { |
|
Alexander Potapenko
2016/02/07 08:40:18
Drive-by nit: this check is inconsistent with othe
ramant (doing other things)
2016/02/09 00:10:34
Done. Uploaded the following CL. Thanks.
https:/
|
| + visitor_->OnConnectionClosed(error, from_peer); |
| + } else { |
| + UMA_HISTOGRAM_BOOLEAN("Net.QuicCloseConnection.NullVisitor", true); |
| + } |
| if (debug_visitor_ != nullptr) { |
| debug_visitor_->OnConnectionClosed(error, from_peer); |
| } |