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

Unified Diff: net/socket/ssl_client_socket_nss.cc

Issue 213363003: Delete some dead code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/x509_certificate_mac.cc ('k') | tools/gn/builder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_nss.cc
diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc
index ca5a6891b89f7efebd7747cf0e67c32e896502d3..71836cc280503f663d8eac6e3b84dc1aea1d6002 100644
--- a/net/socket/ssl_client_socket_nss.cc
+++ b/net/socket/ssl_client_socket_nss.cc
@@ -333,7 +333,7 @@ class PeerCertificateChain {
size_t size() const { return certs_.size(); }
CERTCertificate* operator[](size_t index) const {
- DCHECK_LT(index, certs_.size());
+ DCHECK_LT(index, size());
return certs_[index];
}
@@ -356,15 +356,15 @@ PeerCertificateChain& PeerCertificateChain::operator=(
return *this;
Reset(NULL);
- certs_.reserve(other.certs_.size());
- for (size_t i = 0; i < other.certs_.size(); ++i)
+ certs_.reserve(other.size());
+ for (size_t i = 0; i < other.size(); ++i)
Ryan Sleevi 2014/03/26 21:22:45 This = not lgtm Not sure why Clang griped about t
Nico 2014/03/26 21:35:12 Why is this? It calls others.size(), not this->siz
Ryan Sleevi 2014/03/26 21:42:20 Because it's inconsistently coupling implementatio
Nico 2014/03/26 21:43:52 Ok, deleted size() instead.
certs_.push_back(CERT_DupCertificate(other.certs_[i]));
return *this;
}
void PeerCertificateChain::Reset(PRFileDesc* nss_fd) {
- for (size_t i = 0; i < certs_.size(); ++i)
+ for (size_t i = 0; i < size(); ++i)
CERT_DestroyCertificate(certs_[i]);
certs_.clear();
@@ -385,8 +385,8 @@ void PeerCertificateChain::Reset(PRFileDesc* nss_fd) {
std::vector<base::StringPiece>
PeerCertificateChain::AsStringPieceVector() const {
- std::vector<base::StringPiece> v(certs_.size());
- for (unsigned i = 0; i < certs_.size(); i++) {
+ std::vector<base::StringPiece> v(size());
+ for (unsigned i = 0; i < size(); i++) {
Ryan Sleevi 2014/03/26 21:22:45 Ditto this - inconsistent with using certs_[i] imm
Nico 2014/03/26 21:35:12 Ditto "I don't understand" :-)
v[i] = base::StringPiece(
reinterpret_cast<const char*>(certs_[i]->derCert.data),
certs_[i]->derCert.len);
« no previous file with comments | « net/cert/x509_certificate_mac.cc ('k') | tools/gn/builder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698