Commit 51d5a4dd authored by maksim.sisov's avatar maksim.sisov Committed by Commit bot

Adjust net/report_sender to modified URLRequest API

This cl splits the big CL with changes to net/ folder and
has changes only to net/report_sender according to the
changes to URLRequest API.

What the big cl does:
It modifies net/ clients that use URLRequest API as long as
URLRequest::Read returns int net errors and
URLRequest::Delegate and NetworkDelegate methods
(for example, OnResponseStarted or OnCompleted) have int
net_error in the arguments now.

The reason behind splitting the CL into small one is that
an android bot started to be unstable and unittests became
flaky. It was not possible to locate the problem and the
decision was to split the CL and upload small parts with a
6+ hours interval in order to make it possible to locate
the problematic code.

The big CL is located here -
https://codereview.chromium.org/2265873002/

BUG=423484

Review-Url: https://codereview.chromium.org/2331863002
Cr-Commit-Position: refs/heads/master@{#418534}
parent d271a620
......@@ -59,11 +59,13 @@ void ReportSender::SetErrorCallback(const ErrorCallback& error_callback) {
error_callback_ = error_callback;
}
void ReportSender::OnResponseStarted(URLRequest* request) {
if (!request->status().is_success()) {
void ReportSender::OnResponseStarted(URLRequest* request, int net_error) {
DCHECK_NE(ERR_IO_PENDING, net_error);
if (net_error != OK) {
DVLOG(1) << "Failed to send report for " << request->url().host();
if (!error_callback_.is_null())
error_callback_.Run(request->url(), request->status().error());
error_callback_.Run(request->url(), net_error);
}
CHECK_GT(inflight_requests_.erase(request), 0u);
......
......@@ -58,7 +58,7 @@ class NET_EXPORT ReportSender
void SetErrorCallback(const ErrorCallback& error_callback) override;
// net::URLRequest::Delegate implementation.
void OnResponseStarted(URLRequest* request) override;
void OnResponseStarted(URLRequest* request, int net_error) override;
void OnReadCompleted(URLRequest* request, int bytes_read) override;
private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment