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

Side by Side Diff: crypto/nss_util.cc

Issue 419013003: Replace c/b/nss_context by a KeyedService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added Linux implementation. Created 6 years, 3 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
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 <pk11pub.h> 9 #include <pk11pub.h>
10 #include <plarena.h> 10 #include <plarena.h>
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 << GetNSSErrorMessage(); 208 << GetNSSErrorMessage();
209 LOG(FATAL) << "nss_error=" << nss_error << ", os_error=" << os_error; 209 LOG(FATAL) << "nss_error=" << nss_error << ", os_error=" << os_error;
210 } 210 }
211 211
212 #if defined(OS_CHROMEOS) 212 #if defined(OS_CHROMEOS)
213 class ChromeOSUserData { 213 class ChromeOSUserData {
214 public: 214 public:
215 explicit ChromeOSUserData(ScopedPK11Slot public_slot) 215 explicit ChromeOSUserData(ScopedPK11Slot public_slot)
216 : public_slot_(public_slot.Pass()), 216 : public_slot_(public_slot.Pass()),
217 private_slot_initialization_started_(false) { 217 private_slot_initialization_started_(false) {
218 CHECK(public_slot); 218 CHECK(public_slot_);
219 } 219 }
220 220
221 ~ChromeOSUserData() { 221 ~ChromeOSUserData() {
222 SECStatus status = SECMOD_CloseUserDB(public_slot_.get()); 222 SECStatus status = SECMOD_CloseUserDB(public_slot_.get());
223 if (status != SECSuccess) 223 if (status != SECSuccess)
224 PLOG(ERROR) << "SECMOD_CloseUserDB failed: " << PORT_GetError(); 224 PLOG(ERROR) << "SECMOD_CloseUserDB failed: " << PORT_GetError();
225 } 225 }
226 226
227 ScopedPK11Slot GetPublicSlot() { 227 ScopedPK11Slot GetPublicSlot() {
228 return ScopedPK11Slot(PK11_ReferenceSlot(public_slot_.get())); 228 return ScopedPK11Slot(PK11_ReferenceSlot(public_slot_.get()));
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 return time.ToInternalValue() - base::Time::UnixEpoch().ToInternalValue(); 1094 return time.ToInternalValue() - base::Time::UnixEpoch().ToInternalValue();
1095 } 1095 }
1096 1096
1097 #if !defined(OS_CHROMEOS) 1097 #if !defined(OS_CHROMEOS)
1098 PK11SlotInfo* GetPersistentNSSKeySlot() { 1098 PK11SlotInfo* GetPersistentNSSKeySlot() {
1099 return g_nss_singleton.Get().GetPersistentNSSKeySlot(); 1099 return g_nss_singleton.Get().GetPersistentNSSKeySlot();
1100 } 1100 }
1101 #endif 1101 #endif
1102 1102
1103 } // namespace crypto 1103 } // namespace crypto
OLDNEW
« components/cert_database.gypi ('K') | « components/components.gyp ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698