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

Side by Side Diff: net/cert/test_root_certs_nss.cc

Issue 1082123003: Rename USE_NSS to USE_NSS_CERTS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use-nss-certs
Patch Set: rebase Created 5 years, 8 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
« no previous file with comments | « net/cert/test_root_certs.h ('k') | net/cert/test_root_certs_unittest.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/test_root_certs.h" 5 #include "net/cert/test_root_certs.h"
6 6
7 #include <cert.h> 7 #include <cert.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // occur after Clear() has been called. 107 // occur after Clear() has been called.
108 DCHECK_EQ(SECSuccess, rv) << "Cannot restore certificate trust."; 108 DCHECK_EQ(SECSuccess, rv) << "Cannot restore certificate trust.";
109 } 109 }
110 STLDeleteElements(&trust_cache_); 110 STLDeleteElements(&trust_cache_);
111 } 111 }
112 112
113 bool TestRootCerts::IsEmpty() const { 113 bool TestRootCerts::IsEmpty() const {
114 return trust_cache_.empty(); 114 return trust_cache_.empty();
115 } 115 }
116 116
117 #if defined(USE_NSS) 117 #if defined(USE_NSS_CERTS)
118 bool TestRootCerts::Contains(CERTCertificate* cert) const { 118 bool TestRootCerts::Contains(CERTCertificate* cert) const {
119 for (std::list<TrustEntry*>::const_iterator it = trust_cache_.begin(); 119 for (std::list<TrustEntry*>::const_iterator it = trust_cache_.begin();
120 it != trust_cache_.end(); ++it) { 120 it != trust_cache_.end(); ++it) {
121 if (X509Certificate::IsSameOSCert(cert, (*it)->certificate())) 121 if (X509Certificate::IsSameOSCert(cert, (*it)->certificate()))
122 return true; 122 return true;
123 } 123 }
124 return false; 124 return false;
125 } 125 }
126 #endif 126 #endif
127 127
128 TestRootCerts::~TestRootCerts() { 128 TestRootCerts::~TestRootCerts() {
129 Clear(); 129 Clear();
130 } 130 }
131 131
132 void TestRootCerts::Init() { 132 void TestRootCerts::Init() {
133 crypto::EnsureNSSInit(); 133 crypto::EnsureNSSInit();
134 } 134 }
135 135
136 } // namespace net 136 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/test_root_certs.h ('k') | net/cert/test_root_certs_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698