| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/cert/x509_certificate.h" | 5 #include "net/cert/x509_certificate.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 *left = src; | 211 *left = src; |
| 212 right->clear(); | 212 right->clear(); |
| 213 } else { | 213 } else { |
| 214 *left = src.substr(0, pos); | 214 *left = src.substr(0, pos); |
| 215 *right = src.substr(pos); | 215 *right = src.substr(pos); |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 | 218 |
| 219 } // namespace | 219 } // namespace |
| 220 | 220 |
| 221 bool X509Certificate::LessThan::operator()(X509Certificate* lhs, | 221 bool X509Certificate::LessThan::operator()( |
| 222 X509Certificate* rhs) const { | 222 const scoped_refptr<X509Certificate>& lhs, |
| 223 const scoped_refptr<X509Certificate>& rhs) const { |
| 223 if (lhs == rhs) | 224 if (lhs == rhs) |
| 224 return false; | 225 return false; |
| 225 | 226 |
| 226 int rv = memcmp(lhs->fingerprint_.data, rhs->fingerprint_.data, | 227 int rv = memcmp(lhs->fingerprint_.data, rhs->fingerprint_.data, |
| 227 sizeof(lhs->fingerprint_.data)); | 228 sizeof(lhs->fingerprint_.data)); |
| 228 if (rv != 0) | 229 if (rv != 0) |
| 229 return rv < 0; | 230 return rv < 0; |
| 230 | 231 |
| 231 rv = memcmp(lhs->ca_fingerprint_.data, rhs->ca_fingerprint_.data, | 232 rv = memcmp(lhs->ca_fingerprint_.data, rhs->ca_fingerprint_.data, |
| 232 sizeof(lhs->ca_fingerprint_.data)); | 233 sizeof(lhs->ca_fingerprint_.data)); |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 RemoveFromCache(cert_handle_); | 717 RemoveFromCache(cert_handle_); |
| 717 FreeOSCertHandle(cert_handle_); | 718 FreeOSCertHandle(cert_handle_); |
| 718 } | 719 } |
| 719 for (size_t i = 0; i < intermediate_ca_certs_.size(); ++i) { | 720 for (size_t i = 0; i < intermediate_ca_certs_.size(); ++i) { |
| 720 RemoveFromCache(intermediate_ca_certs_[i]); | 721 RemoveFromCache(intermediate_ca_certs_[i]); |
| 721 FreeOSCertHandle(intermediate_ca_certs_[i]); | 722 FreeOSCertHandle(intermediate_ca_certs_[i]); |
| 722 } | 723 } |
| 723 } | 724 } |
| 724 | 725 |
| 725 } // namespace net | 726 } // namespace net |
| OLD | NEW |