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

Side by Side Diff: net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thakis comment, renamed LAZY_INSTANCE_INITIALIZER 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
OLDNEW
1 /* ***** BEGIN LICENSE BLOCK ***** 1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3 * 3 *
4 * The contents of this file are subject to the Mozilla Public License Version 4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with 5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at 6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/ 7 * http://www.mozilla.org/MPL/
8 * 8 *
9 * Software distributed under the License is distributed on an "AS IS" basis, 9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 SEC_PKCS12EnableCipher(PKCS12_DES_EDE3_168, 1); 314 SEC_PKCS12EnableCipher(PKCS12_DES_EDE3_168, 1);
315 SEC_PKCS12SetPreferredCipher(PKCS12_DES_EDE3_168, 1); 315 SEC_PKCS12SetPreferredCipher(PKCS12_DES_EDE3_168, 1);
316 316
317 // Set no-op ascii-ucs2 conversion function to work around weird NSS 317 // Set no-op ascii-ucs2 conversion function to work around weird NSS
318 // interface. Thankfully, PKCS12 appears to be the only thing in NSS that 318 // interface. Thankfully, PKCS12 appears to be the only thing in NSS that
319 // uses PORT_UCS2_ASCIIConversion, so this doesn't break anything else. 319 // uses PORT_UCS2_ASCIIConversion, so this doesn't break anything else.
320 PORT_SetUCS2_ASCIIConversionFunction(pip_ucs2_ascii_conversion_fn); 320 PORT_SetUCS2_ASCIIConversionFunction(pip_ucs2_ascii_conversion_fn);
321 } 321 }
322 }; 322 };
323 323
324 static base::LazyInstance<PKCS12InitSingleton> g_pkcs12_init_singleton( 324 static base::LazyInstance<PKCS12InitSingleton> g_pkcs12_init_singleton =
325 base::LINKER_INITIALIZED); 325 LAZY_INSTANCE_INITIALIZER;
326 326
327 } // namespace 327 } // namespace
328 328
329 void EnsurePKCS12Init() { 329 void EnsurePKCS12Init() {
330 g_pkcs12_init_singleton.Get(); 330 g_pkcs12_init_singleton.Get();
331 } 331 }
332 332
333 // Based on nsPKCS12Blob::ImportFromFile. 333 // Based on nsPKCS12Blob::ImportFromFile.
334 int nsPKCS12Blob_Import(PK11SlotInfo* slot, 334 int nsPKCS12Blob_Import(PK11SlotInfo* slot,
335 const char* pkcs12_data, 335 const char* pkcs12_data,
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 finish: 456 finish:
457 if (srv) 457 if (srv)
458 LOG(ERROR) << "PKCS#12 export failed with error " << PORT_GetError(); 458 LOG(ERROR) << "PKCS#12 export failed with error " << PORT_GetError();
459 if (ecx) 459 if (ecx)
460 SEC_PKCS12DestroyExportContext(ecx); 460 SEC_PKCS12DestroyExportContext(ecx);
461 SECITEM_ZfreeItem(&unicodePw, PR_FALSE); 461 SECITEM_ZfreeItem(&unicodePw, PR_FALSE);
462 return return_count; 462 return return_count;
463 } 463 }
464 464
465 } // namespace mozilla_security_manager 465 } // namespace mozilla_security_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698