| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 }; | 158 }; |
| 159 | 159 |
| 160 LazyInstance<NSPRInitSingleton, LeakyLazyInstanceTraits<NSPRInitSingleton> > | 160 LazyInstance<NSPRInitSingleton, LeakyLazyInstanceTraits<NSPRInitSingleton> > |
| 161 g_nspr_singleton(LINKER_INITIALIZED); | 161 g_nspr_singleton(LINKER_INITIALIZED); |
| 162 | 162 |
| 163 class NSSInitSingleton { | 163 class NSSInitSingleton { |
| 164 public: | 164 public: |
| 165 #if defined(OS_CHROMEOS) | 165 #if defined(OS_CHROMEOS) |
| 166 void OpenPersistentNSSDB() { | 166 void OpenPersistentNSSDB() { |
| 167 if (!chromeos_user_logged_in_) { | 167 if (!chromeos_user_logged_in_) { |
| 168 // GetDefaultConfigDirectory causes us to do blocking IO on UI thread. |
| 169 // Temporarily allow it until we fix http://crbug.com.70119 |
| 170 ThreadRestrictions::ScopedAllowIO allow_io; |
| 168 chromeos_user_logged_in_ = true; | 171 chromeos_user_logged_in_ = true; |
| 169 real_db_slot_ = OpenUserDB(GetDefaultConfigDirectory(), | 172 real_db_slot_ = OpenUserDB(GetDefaultConfigDirectory(), |
| 170 "Real NSS database"); | 173 "Real NSS database"); |
| 171 } | 174 } |
| 172 } | 175 } |
| 173 #endif // defined(OS_CHROMEOS) | 176 #endif // defined(OS_CHROMEOS) |
| 174 | 177 |
| 175 bool OpenTestNSSDB(const FilePath& path, const char* description) { | 178 bool OpenTestNSSDB(const FilePath& path, const char* description) { |
| 176 test_db_slot_ = OpenUserDB(path, description); | 179 test_db_slot_ = OpenUserDB(path, description); |
| 177 return !!test_db_slot_; | 180 return !!test_db_slot_; |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 exploded.millisecond = prxtime.tm_usec / 1000; | 427 exploded.millisecond = prxtime.tm_usec / 1000; |
| 425 | 428 |
| 426 return Time::FromUTCExploded(exploded); | 429 return Time::FromUTCExploded(exploded); |
| 427 } | 430 } |
| 428 | 431 |
| 429 PK11SlotInfo* GetDefaultNSSKeySlot() { | 432 PK11SlotInfo* GetDefaultNSSKeySlot() { |
| 430 return g_nss_singleton.Get().GetDefaultKeySlot(); | 433 return g_nss_singleton.Get().GetDefaultKeySlot(); |
| 431 } | 434 } |
| 432 | 435 |
| 433 } // namespace base | 436 } // namespace base |
| OLD | NEW |