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

Unified Diff: net/nqe/network_quality_estimator.cc

Issue 2486033002: NQE: Use ResponseHeaders to get the HTTP status code (Closed)
Patch Set: cleanup Created 4 years, 1 month 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 | net/nqe/network_quality_estimator_test_util.h » ('j') | 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 34ab21f7296d333c1ea0e7e080dd6c5fb54ca590..926ec14904722328db9e04c9acf81c5056081a48 100644
--- a/net/nqe/network_quality_estimator.cc
+++ b/net/nqe/network_quality_estimator.cc
@@ -29,6 +29,8 @@
#include "net/base/load_timing_info.h"
#include "net/base/network_interfaces.h"
#include "net/base/url_util.h"
+#include "net/http/http_response_headers.h"
+#include "net/http/http_response_info.h"
#include "net/http/http_status_code.h"
#include "net/nqe/network_quality_estimator_params.h"
#include "net/nqe/socket_watcher_factory.h"
@@ -570,8 +572,10 @@ void NetworkQualityEstimator::RecordCorrelationMetric(const URLRequest& request,
// Record UMA only for successful requests that have completed.
if (net_error != OK)
return;
- if (request.GetResponseCode() != HTTP_OK)
+ if (!request.response_info().headers.get() ||
+ request.response_info().headers->response_code() != HTTP_OK) {
return;
+ }
if (load_timing_info.receive_headers_end < last_main_frame_request_)
return;
« no previous file with comments | « no previous file | net/nqe/network_quality_estimator_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698