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

Side by Side Diff: base/nss_util.cc

Issue 6272012: Temporary whitelist several cases of disk I/O on the UI threads in cros. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/chromeos
Patch Set: remove UI thread restriction, nits Created 9 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/apply_services_customization.cc » ('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) 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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/apply_services_customization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698