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

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

Issue 374033002: Fixes for re-enabling more MSVC level 4 warnings: net/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comment Created 6 years, 5 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/net_log.cc ('k') | net/disk_cache/blockfile/entry_impl.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <windows.h> 7 #include <windows.h>
8 #include <wincrypt.h> 8 #include <wincrypt.h>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 return GetLastError() == CRYPT_E_EXISTS; 153 return GetLastError() == CRYPT_E_EXISTS;
154 } 154 }
155 155
156 empty_ = false; 156 empty_ = false;
157 return true; 157 return true;
158 } 158 }
159 159
160 void TestRootCerts::Clear() { 160 void TestRootCerts::Clear() {
161 empty_ = true; 161 empty_ = true;
162 162
163 PCCERT_CONTEXT prev_cert = NULL; 163 for (PCCERT_CONTEXT prev_cert =
164 while (prev_cert = CertEnumCertificatesInStore(temporary_roots_, NULL)) 164 CertEnumCertificatesInStore(temporary_roots_, NULL);
165 prev_cert;
166 prev_cert = CertEnumCertificatesInStore(temporary_roots_, NULL))
165 CertDeleteCertificateFromStore(prev_cert); 167 CertDeleteCertificateFromStore(prev_cert);
166 } 168 }
167 169
168 bool TestRootCerts::IsEmpty() const { 170 bool TestRootCerts::IsEmpty() const {
169 return empty_; 171 return empty_;
170 } 172 }
171 173
172 HCERTCHAINENGINE TestRootCerts::GetChainEngine() const { 174 HCERTCHAINENGINE TestRootCerts::GetChainEngine() const {
173 if (IsEmpty()) 175 if (IsEmpty())
174 return NULL; // Default chain engine will suffice. 176 return NULL; // Default chain engine will suffice.
(...skipping 29 matching lines...) Expand all
204 206
205 void TestRootCerts::Init() { 207 void TestRootCerts::Init() {
206 empty_ = true; 208 empty_ = true;
207 temporary_roots_ = CertOpenStore( 209 temporary_roots_ = CertOpenStore(
208 CERT_STORE_PROV_MEMORY, 0, NULL, 210 CERT_STORE_PROV_MEMORY, 0, NULL,
209 CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG, NULL); 211 CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG, NULL);
210 DCHECK(temporary_roots_); 212 DCHECK(temporary_roots_);
211 } 213 }
212 214
213 } // namespace net 215 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_log.cc ('k') | net/disk_cache/blockfile/entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698