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

Side by Side Diff: base/nss_util.cc

Issue 2873027: Consistently increase the reference count when calling GetDefaultNSSKeySlot (Closed)
Patch Set: Created 10 years, 5 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 | « no previous file | base/nss_util_internal.h » ('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) 2008-2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008-2010 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 "base/nss_util.h" 5 #include "base/nss_util.h"
6 #include "base/nss_util_internal.h" 6 #include "base/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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } else { 220 } else {
221 if (PK11_NeedUserInit(real_db_slot_)) 221 if (PK11_NeedUserInit(real_db_slot_))
222 PK11_InitPin(real_db_slot_, NULL, NULL); 222 PK11_InitPin(real_db_slot_, NULL, NULL);
223 } 223 }
224 } 224 }
225 } 225 }
226 #endif // defined(OS_CHROMEOS) 226 #endif // defined(OS_CHROMEOS)
227 227
228 PK11SlotInfo* GetDefaultKeySlot() { 228 PK11SlotInfo* GetDefaultKeySlot() {
229 if (real_db_slot_) 229 if (real_db_slot_)
230 return real_db_slot_; 230 return PK11_ReferenceSlot(real_db_slot_);
231 return PK11_GetInternalKeySlot(); 231 return PK11_GetInternalKeySlot();
232 } 232 }
233 233
234 #if defined(USE_NSS) 234 #if defined(USE_NSS)
235 Lock* write_lock() { 235 Lock* write_lock() {
236 return write_lock_.get(); 236 return write_lock_.get();
237 } 237 }
238 #endif // defined(USE_NSS) 238 #endif // defined(USE_NSS)
239 239
240 private: 240 private:
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 exploded.millisecond = prxtime.tm_usec / 1000; 300 exploded.millisecond = prxtime.tm_usec / 1000;
301 301
302 return Time::FromUTCExploded(exploded); 302 return Time::FromUTCExploded(exploded);
303 } 303 }
304 304
305 PK11SlotInfo* GetDefaultNSSKeySlot() { 305 PK11SlotInfo* GetDefaultNSSKeySlot() {
306 return Singleton<NSSInitSingleton>::get()->GetDefaultKeySlot(); 306 return Singleton<NSSInitSingleton>::get()->GetDefaultKeySlot();
307 } 307 }
308 308
309 } // namespace base 309 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/nss_util_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698