| Index: net/url_request/certificate_report_sender.cc
|
| diff --git a/net/url_request/certificate_report_sender.cc b/net/url_request/certificate_report_sender.cc
|
| index 55b27a592757d73fa0df3ffbb086315d2adfc2b6..6091701cbddfd4d4ff0f40f37b9b255570573466 100644
|
| --- a/net/url_request/certificate_report_sender.cc
|
| +++ b/net/url_request/certificate_report_sender.cc
|
| @@ -19,8 +19,17 @@ namespace net {
|
| CertificateReportSender::CertificateReportSender(
|
| URLRequestContext* request_context,
|
| CookiesPreference cookies_preference)
|
| + : CertificateReportSender(request_context,
|
| + cookies_preference,
|
| + base::Callback<void(URLRequest*)>()) {}
|
| +
|
| +CertificateReportSender::CertificateReportSender(
|
| + URLRequestContext* request_context,
|
| + CookiesPreference cookies_preference,
|
| + const base::Callback<void(URLRequest*)>& error_callback)
|
| : request_context_(request_context),
|
| - cookies_preference_(cookies_preference) {}
|
| + cookies_preference_(cookies_preference),
|
| + error_callback_(error_callback) {}
|
|
|
| CertificateReportSender::~CertificateReportSender() {
|
| // Cancel all of the uncompleted requests.
|
| @@ -52,9 +61,12 @@ void CertificateReportSender::Send(const GURL& report_uri,
|
| }
|
|
|
| void CertificateReportSender::OnResponseStarted(URLRequest* request) {
|
| - // TODO(estark): call a callback so that the caller can print a
|
| - // warning on failure.
|
| - DVLOG(1) << "Failed to send certificate report for " << request->url().host();
|
| + if (!request->status().is_success()) {
|
| + DVLOG(1) << "Failed to send certificate report for "
|
| + << request->url().host();
|
| + if (!error_callback_.is_null())
|
| + error_callback_.Run(request);
|
| + }
|
|
|
| CHECK_GT(inflight_requests_.erase(request), 0u);
|
| // Clean up the request, which cancels it.
|
|
|