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

Side by Side Diff: net/url_request/report_sender.cc

Issue 2313013002: Revert of Adjust callers and networking delegates in net/ to modified APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@URLRequestRead
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « net/url_request/report_sender.h ('k') | net/url_request/sdch_dictionary_fetcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/url_request/report_sender.h" 5 #include "net/url_request/report_sender.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "net/base/elements_upload_data_stream.h" 10 #include "net/base/elements_upload_data_stream.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 URLRequest* raw_url_request = url_request.get(); 53 URLRequest* raw_url_request = url_request.get();
54 inflight_requests_.insert(url_request.release()); 54 inflight_requests_.insert(url_request.release());
55 raw_url_request->Start(); 55 raw_url_request->Start();
56 } 56 }
57 57
58 void ReportSender::SetErrorCallback(const ErrorCallback& error_callback) { 58 void ReportSender::SetErrorCallback(const ErrorCallback& error_callback) {
59 error_callback_ = error_callback; 59 error_callback_ = error_callback;
60 } 60 }
61 61
62 void ReportSender::OnResponseStarted(URLRequest* request, int net_error) { 62 void ReportSender::OnResponseStarted(URLRequest* request) {
63 DCHECK_NE(ERR_IO_PENDING, net_error); 63 if (!request->status().is_success()) {
64
65 if (net_error != OK) {
66 DVLOG(1) << "Failed to send report for " << request->url().host(); 64 DVLOG(1) << "Failed to send report for " << request->url().host();
67 if (!error_callback_.is_null()) 65 if (!error_callback_.is_null())
68 error_callback_.Run(request->url(), net_error); 66 error_callback_.Run(request->url(), request->status().error());
69 } 67 }
70 68
71 CHECK_GT(inflight_requests_.erase(request), 0u); 69 CHECK_GT(inflight_requests_.erase(request), 0u);
72 // Clean up the request, which cancels it. 70 // Clean up the request, which cancels it.
73 delete request; 71 delete request;
74 } 72 }
75 73
76 void ReportSender::OnReadCompleted(URLRequest* request, int bytes_read) { 74 void ReportSender::OnReadCompleted(URLRequest* request, int bytes_read) {
77 NOTREACHED(); 75 NOTREACHED();
78 } 76 }
79 77
80 } // namespace net 78 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/report_sender.h ('k') | net/url_request/sdch_dictionary_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698