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

Side by Side Diff: net/base/x509_certificate_mac.cc

Issue 6609008: Change other usages of .size() to .empty() when applicable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Peter nits Created 9 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « net/base/x509_cert_types_mac.cc ('k') | net/base/x509_certificate_win.cc » ('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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/base/x509_certificate.h" 5 #include "net/base/x509_certificate.h"
6 6
7 #include <CommonCrypto/CommonDigest.h> 7 #include <CommonCrypto/CommonDigest.h>
8 #include <Security/Security.h> 8 #include <Security/Security.h>
9 #include <time.h> 9 #include <time.h>
10 10
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 } 1121 }
1122 if (i < certs->size()) 1122 if (i < certs->size())
1123 continue; 1123 continue;
1124 1124
1125 bool is_preferred = preferred_identity && 1125 bool is_preferred = preferred_identity &&
1126 CFEqual(preferred_identity, identity); 1126 CFEqual(preferred_identity, identity);
1127 1127
1128 // Make sure the issuer matches valid_issuers, if given. 1128 // Make sure the issuer matches valid_issuers, if given.
1129 // But an explicit cert preference overrides this. 1129 // But an explicit cert preference overrides this.
1130 if (!is_preferred && 1130 if (!is_preferred &&
1131 valid_issuers.size() > 0 && 1131 !valid_issuers.empty() &&
1132 !cert->IsIssuedBy(valid_issuers)) 1132 !cert->IsIssuedBy(valid_issuers))
1133 continue; 1133 continue;
1134 1134
1135 // The cert passes, so add it to the vector. 1135 // The cert passes, so add it to the vector.
1136 // If it's the preferred identity, add it at the start (so it'll be 1136 // If it's the preferred identity, add it at the start (so it'll be
1137 // selected by default in the UI.) 1137 // selected by default in the UI.)
1138 if (is_preferred) 1138 if (is_preferred)
1139 certs->insert(certs->begin(), cert); 1139 certs->insert(certs->begin(), cert);
1140 else 1140 else
1141 certs->push_back(cert); 1141 certs->push_back(cert);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 CFArrayAppendArray(chain, 1176 CFArrayAppendArray(chain,
1177 cert_chain, 1177 cert_chain,
1178 CFRangeMake(1, chain_count - 1)); 1178 CFRangeMake(1, chain_count - 1));
1179 } 1179 }
1180 } 1180 }
1181 1181
1182 return chain.release(); 1182 return chain.release();
1183 } 1183 }
1184 1184
1185 } // namespace net 1185 } // namespace net
OLDNEW
« no previous file with comments | « net/base/x509_cert_types_mac.cc ('k') | net/base/x509_certificate_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698