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

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: Added 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 79f0d5d25ecda3306082fc2ba7ce71c50e2f3ea0..3473472c787f1ed6d03fa986c6d3c5168ff79aba 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,13 @@ 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 it after fix is merged.
Alexei Svitkine (slow) 2016/02/01 19:03:14 Planning to delete the histogram at that point too
ramant (doing other things) 2016/02/01 19:12:18 Done.
+ if (visitor_) {
+ 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