| OLD | NEW |
| 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 "chrome/browser/net/certificate_error_reporter.h" | 5 #include "chrome/browser/net/certificate_error_reporter.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 CertLoggerRequest request; | 40 CertLoggerRequest request; |
| 41 std::string out; | 41 std::string out; |
| 42 | 42 |
| 43 BuildReport(hostname, ssl_info, &request); | 43 BuildReport(hostname, ssl_info, &request); |
| 44 | 44 |
| 45 switch (type) { | 45 switch (type) { |
| 46 case REPORT_TYPE_PINNING_VIOLATION: | 46 case REPORT_TYPE_PINNING_VIOLATION: |
| 47 SendCertLoggerRequest(request); | 47 SendCertLoggerRequest(request); |
| 48 break; | 48 break; |
| 49 case REPORT_TYPE_EXTENDED_REPORTING: | 49 case REPORT_TYPE_EXTENDED_REPORTING: |
| 50 // TODO(estark): Encrypt the report if not sending over HTTPS | 50 // TODO(estark): Encrypt the report if not sending over HTTPS. |
| 51 DCHECK(upload_url_.SchemeIsSecure()); | 51 DCHECK(upload_url_.SchemeUsesTLS()); |
| 52 SendCertLoggerRequest(request); | 52 SendCertLoggerRequest(request); |
| 53 break; | 53 break; |
| 54 default: | 54 default: |
| 55 NOTREACHED(); | 55 NOTREACHED(); |
| 56 } | 56 } |
| 57 } | 57 } |
| 58 | 58 |
| 59 void CertificateErrorReporter::OnResponseStarted(net::URLRequest* request) { | 59 void CertificateErrorReporter::OnResponseStarted(net::URLRequest* request) { |
| 60 const net::URLRequestStatus& status(request->status()); | 60 const net::URLRequestStatus& status(request->status()); |
| 61 if (!status.is_success()) { | 61 if (!status.is_success()) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 } | 126 } |
| 127 | 127 |
| 128 void CertificateErrorReporter::RequestComplete(net::URLRequest* request) { | 128 void CertificateErrorReporter::RequestComplete(net::URLRequest* request) { |
| 129 std::set<net::URLRequest*>::iterator i = inflight_requests_.find(request); | 129 std::set<net::URLRequest*>::iterator i = inflight_requests_.find(request); |
| 130 DCHECK(i != inflight_requests_.end()); | 130 DCHECK(i != inflight_requests_.end()); |
| 131 scoped_ptr<net::URLRequest> url_request(*i); | 131 scoped_ptr<net::URLRequest> url_request(*i); |
| 132 inflight_requests_.erase(i); | 132 inflight_requests_.erase(i); |
| 133 } | 133 } |
| 134 | 134 |
| 135 } // namespace chrome_browser_net | 135 } // namespace chrome_browser_net |
| OLD | NEW |