| 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 | 254 |
| 255 std::vector<std::string> pem_encoded_chain; | 255 std::vector<std::string> pem_encoded_chain; |
| 256 if (!ssl_info.cert->GetPEMEncodedChain(&pem_encoded_chain)) | 256 if (!ssl_info.cert->GetPEMEncodedChain(&pem_encoded_chain)) |
| 257 LOG(ERROR) << "Could not get PEM encoded chain."; | 257 LOG(ERROR) << "Could not get PEM encoded chain."; |
| 258 | 258 |
| 259 std::string* cert_chain = out_request->mutable_cert_chain(); | 259 std::string* cert_chain = out_request->mutable_cert_chain(); |
| 260 for (size_t i = 0; i < pem_encoded_chain.size(); ++i) | 260 for (size_t i = 0; i < pem_encoded_chain.size(); ++i) |
| 261 *cert_chain += pem_encoded_chain[i]; | 261 *cert_chain += pem_encoded_chain[i]; |
| 262 | 262 |
| 263 out_request->add_pin(ssl_info.pinning_failure_log); | 263 out_request->add_pin(ssl_info.pinning_failure_log); |
| 264 |
| 265 out_request->set_cert_status(ssl_info.cert_status); |
| 264 } | 266 } |
| 265 | 267 |
| 266 void CertificateErrorReporter::RequestComplete(net::URLRequest* request) { | 268 void CertificateErrorReporter::RequestComplete(net::URLRequest* request) { |
| 267 std::set<net::URLRequest*>::iterator i = inflight_requests_.find(request); | 269 std::set<net::URLRequest*>::iterator i = inflight_requests_.find(request); |
| 268 DCHECK(i != inflight_requests_.end()); | 270 DCHECK(i != inflight_requests_.end()); |
| 269 scoped_ptr<net::URLRequest> url_request(*i); | 271 scoped_ptr<net::URLRequest> url_request(*i); |
| 270 inflight_requests_.erase(i); | 272 inflight_requests_.erase(i); |
| 271 } | 273 } |
| 272 | 274 |
| 273 } // namespace chrome_browser_net | 275 } // namespace chrome_browser_net |
| OLD | NEW |