OLD | NEW |
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 "chrome/browser/profiles/profile_io_data.h" | 5 #include "chrome/browser/profiles/profile_io_data.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 chromeos::UserManager* user_manager = chromeos::UserManager::Get(); | 360 chromeos::UserManager* user_manager = chromeos::UserManager::Get(); |
361 if (user_manager) { | 361 if (user_manager) { |
362 chromeos::User* user = | 362 chromeos::User* user = |
363 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); | 363 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); |
364 // No need to initialize NSS for users with empty username hash: | 364 // No need to initialize NSS for users with empty username hash: |
365 // Getters for a user's NSS slots always return NULL slot if the user's | 365 // Getters for a user's NSS slots always return NULL slot if the user's |
366 // username hash is empty, even when the NSS is not initialized for the | 366 // username hash is empty, even when the NSS is not initialized for the |
367 // user. | 367 // user. |
368 if (user && !user->username_hash().empty()) { | 368 if (user && !user->username_hash().empty()) { |
369 params->username_hash = user->username_hash(); | 369 params->username_hash = user->username_hash(); |
| 370 DCHECK(!params->username_hash.empty()); |
370 BrowserThread::PostTask(BrowserThread::IO, | 371 BrowserThread::PostTask(BrowserThread::IO, |
371 FROM_HERE, | 372 FROM_HERE, |
372 base::Bind(&StartNSSInitOnIOThread, | 373 base::Bind(&StartNSSInitOnIOThread, |
373 user->email(), | 374 user->email(), |
374 user->username_hash(), | 375 user->username_hash(), |
375 profile->GetPath())); | 376 profile->GetPath())); |
376 } | 377 } |
377 } | 378 } |
378 if (params->username_hash.empty()) | |
379 LOG(WARNING) << "No username_hash; skipped NSS initialization."; | |
380 #endif | 379 #endif |
381 | 380 |
382 params->profile = profile; | 381 params->profile = profile; |
383 params->prerender_tracker = g_browser_process->prerender_tracker(); | 382 params->prerender_tracker = g_browser_process->prerender_tracker(); |
384 profile_params_.reset(params.release()); | 383 profile_params_.reset(params.release()); |
385 | 384 |
386 ChromeNetworkDelegate::InitializePrefsOnUIThread( | 385 ChromeNetworkDelegate::InitializePrefsOnUIThread( |
387 &enable_referrers_, | 386 &enable_referrers_, |
388 &enable_do_not_track_, | 387 &enable_do_not_track_, |
389 &force_safesearch_, | 388 &force_safesearch_, |
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 void ProfileIOData::SetCookieSettingsForTesting( | 1250 void ProfileIOData::SetCookieSettingsForTesting( |
1252 CookieSettings* cookie_settings) { | 1251 CookieSettings* cookie_settings) { |
1253 DCHECK(!cookie_settings_.get()); | 1252 DCHECK(!cookie_settings_.get()); |
1254 cookie_settings_ = cookie_settings; | 1253 cookie_settings_ = cookie_settings; |
1255 } | 1254 } |
1256 | 1255 |
1257 void ProfileIOData::set_signin_names_for_testing( | 1256 void ProfileIOData::set_signin_names_for_testing( |
1258 SigninNamesOnIOThread* signin_names) { | 1257 SigninNamesOnIOThread* signin_names) { |
1259 signin_names_.reset(signin_names); | 1258 signin_names_.reset(signin_names); |
1260 } | 1259 } |
OLD | NEW |