Move Net.HttpRequestCompletionErrorCodes to NetworkContext

1108083
This commit is contained in:
Jeremy Apthorp 2018-10-02 15:17:26 -07:00
parent 42120b4a72
commit 120b6079a8
2 changed files with 10 additions and 5 deletions

View file

@ -343,14 +343,16 @@ void AtomNetworkDelegate::OnResponseStarted(net::URLRequest* request,
request->was_cached());
}
void AtomNetworkDelegate::OnCompleted(net::URLRequest* request, bool started) {
void AtomNetworkDelegate::OnCompleted(net::URLRequest* request,
bool started,
int net_error) {
// OnCompleted may happen before other events.
callbacks_.erase(request->identifier());
if (request->status().status() == net::URLRequestStatus::FAILED ||
request->status().status() == net::URLRequestStatus::CANCELED) {
// Error event.
OnErrorOccurred(request, started);
OnErrorOccurred(request, started, net_error);
return;
}
@ -452,7 +454,8 @@ bool AtomNetworkDelegate::OnCanUseReportingClient(const url::Origin& origin,
}
void AtomNetworkDelegate::OnErrorOccurred(net::URLRequest* request,
bool started) {
bool started,
int net_error) {
if (!base::ContainsKey(simple_listeners_, kOnErrorOccurred))
return;