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

Side by Side Diff: net/socket/ssl_host_info.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/http/http_util.cc ('k') | net/tools/flip_server/balsa_headers.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/socket/ssl_host_info.h" 5 #include "net/socket/ssl_host_info.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/pickle.h" 8 #include "base/pickle.h"
9 #include "base/string_piece.h" 9 #include "base/string_piece.h"
10 #include "net/base/dns_util.h" 10 #include "net/base/dns_util.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 if (state->npn_valid) { 109 if (state->npn_valid) {
110 int status; 110 int status;
111 if (!p.ReadInt(&iter, &status) || 111 if (!p.ReadInt(&iter, &status) ||
112 !p.ReadString(&iter, &state->npn_protocol)) { 112 !p.ReadString(&iter, &state->npn_protocol)) {
113 return false; 113 return false;
114 } 114 }
115 state->npn_status = static_cast<SSLClientSocket::NextProtoStatus>(status); 115 state->npn_status = static_cast<SSLClientSocket::NextProtoStatus>(status);
116 } 116 }
117 117
118 if (state->certs.size() > 0) { 118 if (!state->certs.empty()) {
119 std::vector<base::StringPiece> der_certs(state->certs.size()); 119 std::vector<base::StringPiece> der_certs(state->certs.size());
120 for (size_t i = 0; i < state->certs.size(); i++) 120 for (size_t i = 0; i < state->certs.size(); i++)
121 der_certs[i] = state->certs[i]; 121 der_certs[i] = state->certs[i];
122 cert_ = X509Certificate::CreateFromDERCertChain(der_certs); 122 cert_ = X509Certificate::CreateFromDERCertChain(der_certs);
123 if (cert_.get()) { 123 if (cert_.get()) {
124 int flags = 0; 124 int flags = 0;
125 if (verify_ev_cert_) 125 if (verify_ev_cert_)
126 flags |= X509Certificate::VERIFY_EV_CERT; 126 flags |= X509Certificate::VERIFY_EV_CERT;
127 if (rev_checking_enabled_) 127 if (rev_checking_enabled_)
128 flags |= X509Certificate::VERIFY_REV_CHECKING_ENABLED; 128 flags |= X509Certificate::VERIFY_REV_CHECKING_ENABLED;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 if (cert_verification_callback_) { 207 if (cert_verification_callback_) {
208 CompletionCallback* callback = cert_verification_callback_; 208 CompletionCallback* callback = cert_verification_callback_;
209 cert_verification_callback_ = NULL; 209 cert_verification_callback_ = NULL;
210 callback->Run(rv); 210 callback->Run(rv);
211 } 211 }
212 } 212 }
213 213
214 SSLHostInfoFactory::~SSLHostInfoFactory() {} 214 SSLHostInfoFactory::~SSLHostInfoFactory() {}
215 215
216 } // namespace net 216 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_util.cc ('k') | net/tools/flip_server/balsa_headers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698