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

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

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 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
« no previous file with comments | « net/cert/test_root_certs.h ('k') | net/cert/x509_certificate.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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 23 matching lines...) Expand all
34 // The previous default function for opening system stores. For most 34 // The previous default function for opening system stores. For most
35 // configurations, this should point to Crypt32's internal 35 // configurations, this should point to Crypt32's internal
36 // I_CertDllOpenSystemStoreProvW function. 36 // I_CertDllOpenSystemStoreProvW function.
37 PFN_CERT_DLL_OPEN_STORE_PROV_FUNC original_function; 37 PFN_CERT_DLL_OPEN_STORE_PROV_FUNC original_function;
38 38
39 // The handle that CryptoAPI uses to ensure the DLL implementing 39 // The handle that CryptoAPI uses to ensure the DLL implementing
40 // |original_function| remains loaded in memory. 40 // |original_function| remains loaded in memory.
41 HCRYPTOIDFUNCADDR original_handle; 41 HCRYPTOIDFUNCADDR original_handle;
42 42
43 private: 43 private:
44 friend struct base::DefaultLazyInstanceTraits<CryptoAPIInjector>; 44 friend struct base::LazyInstanceTraitsBase<CryptoAPIInjector>;
45 45
46 CryptoAPIInjector() 46 CryptoAPIInjector()
47 : original_function(NULL), 47 : original_function(NULL),
48 original_handle(NULL) { 48 original_handle(NULL) {
49 HCRYPTOIDFUNCSET registered_functions = 49 HCRYPTOIDFUNCSET registered_functions =
50 CryptInitOIDFunctionSet(CRYPT_OID_OPEN_STORE_PROV_FUNC, 0); 50 CryptInitOIDFunctionSet(CRYPT_OID_OPEN_STORE_PROV_FUNC, 0);
51 51
52 // Preserve the original handler function in |original_function|. If other 52 // Preserve the original handler function in |original_function|. If other
53 // functions are overridden, they will also need to be preserved. 53 // functions are overridden, they will also need to be preserved.
54 BOOL ok = CryptGetOIDFunctionAddress( 54 BOOL ok = CryptGetOIDFunctionAddress(
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 void TestRootCerts::Init() { 204 void TestRootCerts::Init() {
205 empty_ = true; 205 empty_ = true;
206 temporary_roots_ = CertOpenStore( 206 temporary_roots_ = CertOpenStore(
207 CERT_STORE_PROV_MEMORY, 0, NULL, 207 CERT_STORE_PROV_MEMORY, 0, NULL,
208 CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG, NULL); 208 CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG, NULL);
209 DCHECK(temporary_roots_); 209 DCHECK(temporary_roots_);
210 } 210 }
211 211
212 } // namespace net 212 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/test_root_certs.h ('k') | net/cert/x509_certificate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698