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

Side by Side Diff: crypto/nss_util.cc

Issue 11411013: Initialize NSS in the PPAPI process for ClearKey CDM. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address nits in comments. Created 8 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
« content/ppapi_plugin/ppapi_plugin_main.cc ('K') | « crypto/nss_util.h ('k') | no next file » | 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 "crypto/nss_util.h" 5 #include "crypto/nss_util.h"
6 #include "crypto/nss_util_internal.h" 6 #include "crypto/nss_util_internal.h"
7 7
8 #include <nss.h> 8 #include <nss.h>
9 #include <plarena.h> 9 #include <plarena.h>
10 #include <prerror.h> 10 #include <prerror.h>
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 FilePath database_dir = GetInitialConfigDirectory(); 643 FilePath database_dir = GetInitialConfigDirectory();
644 if (!database_dir.empty()) 644 if (!database_dir.empty())
645 UseLocalCacheOfNSSDatabaseIfNFS(database_dir); 645 UseLocalCacheOfNSSDatabaseIfNFS(database_dir);
646 } 646 }
647 #endif 647 #endif
648 648
649 void EnsureNSPRInit() { 649 void EnsureNSPRInit() {
650 g_nspr_singleton.Get(); 650 g_nspr_singleton.Get();
651 } 651 }
652 652
653 void WarmUpNSSSafely() {
654 // We might fork, but we haven't loaded any security modules.
655 crypto::DisableNSSForkCheck();
656 // If we're sandboxed, we shouldn't be able to open user security modules,
657 // but it's more correct to tell NSS to not even try.
658 // Loading user security modules would have security implications.
659 crypto::ForceNSSNoDBInit();
660 // Initialize NSS.
661 crypto::EnsureNSSInit();
662 }
663
653 void EnsureNSSInit() { 664 void EnsureNSSInit() {
654 // Initializing SSL causes us to do blocking IO. 665 // Initializing SSL causes us to do blocking IO.
655 // Temporarily allow it until we fix 666 // Temporarily allow it until we fix
656 // http://code.google.com/p/chromium/issues/detail?id=59847 667 // http://code.google.com/p/chromium/issues/detail?id=59847
657 base::ThreadRestrictions::ScopedAllowIO allow_io; 668 base::ThreadRestrictions::ScopedAllowIO allow_io;
658 g_nss_singleton.Get(); 669 g_nss_singleton.Get();
659 } 670 }
660 671
661 void ForceNSSNoDBInit() { 672 void ForceNSSNoDBInit() {
662 NSSInitSingleton::ForceNoDBInit(); 673 NSSInitSingleton::ForceNoDBInit();
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 807
797 PK11SlotInfo* GetPublicNSSKeySlot() { 808 PK11SlotInfo* GetPublicNSSKeySlot() {
798 return g_nss_singleton.Get().GetPublicNSSKeySlot(); 809 return g_nss_singleton.Get().GetPublicNSSKeySlot();
799 } 810 }
800 811
801 PK11SlotInfo* GetPrivateNSSKeySlot() { 812 PK11SlotInfo* GetPrivateNSSKeySlot() {
802 return g_nss_singleton.Get().GetPrivateNSSKeySlot(); 813 return g_nss_singleton.Get().GetPrivateNSSKeySlot();
803 } 814 }
804 815
805 } // namespace crypto 816 } // namespace crypto
OLDNEW
« content/ppapi_plugin/ppapi_plugin_main.cc ('K') | « crypto/nss_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698