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

Side by Side Diff: chrome/browser/ssl/ssl_error_info.cc

Issue 7819009: For the SSL cert status, convert anonymous enum that gives bit values into a typedefed uint32. Th... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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
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 "chrome/browser/ssl/ssl_error_info.h" 5 #include "chrome/browser/ssl/ssl_error_info.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/common/time_format.h" 8 #include "chrome/common/time_format.h"
9 #include "content/browser/cert_store.h" 9 #include "content/browser/cert_store.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 case net::ERR_CERT_NOT_IN_DNS: 224 case net::ERR_CERT_NOT_IN_DNS:
225 return CERT_NOT_IN_DNS; 225 return CERT_NOT_IN_DNS;
226 default: 226 default:
227 NOTREACHED(); 227 NOTREACHED();
228 return UNKNOWN; 228 return UNKNOWN;
229 } 229 }
230 } 230 }
231 231
232 // static 232 // static
233 int SSLErrorInfo::GetErrorsForCertStatus(int cert_id, 233 int SSLErrorInfo::GetErrorsForCertStatus(int cert_id,
234 int cert_status, 234 net::CertStatus cert_status,
235 const GURL& url, 235 const GURL& url,
236 std::vector<SSLErrorInfo>* errors) { 236 std::vector<SSLErrorInfo>* errors) {
237 const int kErrorFlags[] = { 237 const net::CertStatus kErrorFlags[] = {
238 net::CERT_STATUS_COMMON_NAME_INVALID, 238 net::CERT_STATUS_COMMON_NAME_INVALID,
239 net::CERT_STATUS_DATE_INVALID, 239 net::CERT_STATUS_DATE_INVALID,
240 net::CERT_STATUS_AUTHORITY_INVALID, 240 net::CERT_STATUS_AUTHORITY_INVALID,
241 net::CERT_STATUS_NO_REVOCATION_MECHANISM, 241 net::CERT_STATUS_NO_REVOCATION_MECHANISM,
242 net::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION, 242 net::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION,
243 net::CERT_STATUS_REVOKED, 243 net::CERT_STATUS_REVOKED,
244 net::CERT_STATUS_INVALID, 244 net::CERT_STATUS_INVALID,
245 net::CERT_STATUS_WEAK_SIGNATURE_ALGORITHM 245 net::CERT_STATUS_WEAK_SIGNATURE_ALGORITHM
246 }; 246 };
247 247
(...skipping 17 matching lines...) Expand all
265 if (!cert.get()) { 265 if (!cert.get()) {
266 bool r = CertStore::GetInstance()->RetrieveCert(cert_id, &cert); 266 bool r = CertStore::GetInstance()->RetrieveCert(cert_id, &cert);
267 DCHECK(r); 267 DCHECK(r);
268 } 268 }
269 if (errors) 269 if (errors)
270 errors->push_back(SSLErrorInfo::CreateError(kErrorTypes[i], cert, url)); 270 errors->push_back(SSLErrorInfo::CreateError(kErrorTypes[i], cert, url));
271 } 271 }
272 } 272 }
273 return count; 273 return count;
274 } 274 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698