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

Unified Diff: net/nqe/network_quality_estimator.cc

Issue 2208733004: Fix crash in NQE: Replace DCHECK by an if-conditional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/network_quality_estimator.cc
diff --git a/net/nqe/network_quality_estimator.cc b/net/nqe/network_quality_estimator.cc
index d38cf0b4f690c7715e97f87253e29231e2423045..dbf4986aaff0e8d7016e0240eb0496e393e549bd 100644
--- a/net/nqe/network_quality_estimator.cc
+++ b/net/nqe/network_quality_estimator.cc
@@ -801,8 +801,12 @@ void NetworkQualityEstimator::RecordCorrelationMetric(
LoadTimingInfo load_timing_info;
request.GetLoadTimingInfo(&load_timing_info);
- DCHECK(!load_timing_info.send_start.is_null() &&
- !load_timing_info.receive_headers_end.is_null());
+ // If the load timing info is unavailable, it probably means that the request
+ // did not go over the network.
+ if (load_timing_info.send_start.is_null() ||
+ load_timing_info.receive_headers_end.is_null()) {
+ return;
+ }
// Record UMA only for successful requests that have completed.
if (!request.status().is_success() || request.status().is_io_pending())
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698