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

Unified 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: Updated comment to delete histogram Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698