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

Side by Side Diff: net/base/x509_certificate_win.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: willchan comments + rebase Created 9 years, 1 month 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/x509_certificate.cc ('k') | net/disk_cache/file_win.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/base/x509_certificate.h" 5 #include "net/base/x509_certificate.h"
6 6
7 #define PRArenaPool PLArenaPool // Required by <blapi.h>. 7 #define PRArenaPool PLArenaPool // Required by <blapi.h>.
8 #include <blapi.h> // Implement CalculateChainFingerprint() with NSS. 8 #include <blapi.h> // Implement CalculateChainFingerprint() with NSS.
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 CertCloseStore(cert_store_, 0 /* flags */); 713 CertCloseStore(cert_store_, 0 /* flags */);
714 } 714 }
715 715
716 const HCERTSTORE cert_store_; 716 const HCERTSTORE cert_store_;
717 717
718 DISALLOW_COPY_AND_ASSIGN(GlobalCertStore); 718 DISALLOW_COPY_AND_ASSIGN(GlobalCertStore);
719 }; 719 };
720 720
721 static base::LazyInstance<GlobalCertStore, 721 static base::LazyInstance<GlobalCertStore,
722 base::LeakyLazyInstanceTraits<GlobalCertStore> > 722 base::LeakyLazyInstanceTraits<GlobalCertStore> >
723 g_cert_store(base::LINKER_INITIALIZED); 723 g_cert_store = LAZY_INSTANCE_INITIALIZER;
724 724
725 // static 725 // static
726 HCERTSTORE X509Certificate::cert_store() { 726 HCERTSTORE X509Certificate::cert_store() {
727 return g_cert_store.Get().cert_store(); 727 return g_cert_store.Get().cert_store();
728 } 728 }
729 729
730 PCCERT_CONTEXT X509Certificate::CreateOSCertChainForCert() const { 730 PCCERT_CONTEXT X509Certificate::CreateOSCertChainForCert() const {
731 // Create an in-memory certificate store to hold this certificate and 731 // Create an in-memory certificate store to hold this certificate and
732 // any intermediate certificates in |intermediate_ca_certs_|. The store 732 // any intermediate certificates in |intermediate_ca_certs_|. The store
733 // will be referenced in the returned PCCERT_CONTEXT, and will not be freed 733 // will be referenced in the returned PCCERT_CONTEXT, and will not be freed
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 if (!CertSerializeCertificateStoreElement(cert_handle, 0, &buffer[0], 1147 if (!CertSerializeCertificateStoreElement(cert_handle, 0, &buffer[0],
1148 &length)) { 1148 &length)) {
1149 return false; 1149 return false;
1150 } 1150 }
1151 1151
1152 return pickle->WriteData(reinterpret_cast<const char*>(&buffer[0]), 1152 return pickle->WriteData(reinterpret_cast<const char*>(&buffer[0]),
1153 length); 1153 length);
1154 } 1154 }
1155 1155
1156 } // namespace net 1156 } // namespace net
OLDNEW
« no previous file with comments | « net/base/x509_certificate.cc ('k') | net/disk_cache/file_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698