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

Side by Side Diff: chrome/browser/password_manager/password_store_factory.cc

Issue 1125653002: [chrome/browser/password_manager] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
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 "chrome/browser/password_manager/password_store_factory.h" 5 #include "chrome/browser/password_manager/password_store_factory.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/environment.h" 8 #include "base/environment.h"
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
11 #include "base/thread_task_runner_handle.h"
11 #include "chrome/browser/password_manager/password_manager_util.h" 12 #include "chrome/browser/password_manager/password_manager_util.h"
12 #include "chrome/browser/password_manager/sync_metrics.h" 13 #include "chrome/browser/password_manager/sync_metrics.h"
13 #include "chrome/browser/profiles/incognito_helpers.h" 14 #include "chrome/browser/profiles/incognito_helpers.h"
14 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/sync/glue/sync_start_util.h" 16 #include "chrome/browser/sync/glue/sync_start_util.h"
16 #include "chrome/browser/sync/profile_sync_service.h" 17 #include "chrome/browser/sync/profile_sync_service.h"
17 #include "chrome/browser/sync/profile_sync_service_factory.h" 18 #include "chrome/browser/sync/profile_sync_service_factory.h"
18 #include "chrome/browser/webdata/web_data_service_factory.h" 19 #include "chrome/browser/webdata/web_data_service_factory.h"
19 #include "chrome/common/chrome_constants.h" 20 #include "chrome/common/chrome_constants.h"
20 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_switches.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 Profile* profile = static_cast<Profile*>(context); 231 Profile* profile = static_cast<Profile*>(context);
231 232
232 // Given that LoginDatabase::Init() takes ~100ms on average; it will be called 233 // Given that LoginDatabase::Init() takes ~100ms on average; it will be called
233 // by PasswordStore::Init() on the background thread to avoid UI jank. 234 // by PasswordStore::Init() on the background thread to avoid UI jank.
234 base::FilePath login_db_file_path = profile->GetPath(); 235 base::FilePath login_db_file_path = profile->GetPath();
235 login_db_file_path = login_db_file_path.Append(chrome::kLoginDataFileName); 236 login_db_file_path = login_db_file_path.Append(chrome::kLoginDataFileName);
236 scoped_ptr<password_manager::LoginDatabase> login_db( 237 scoped_ptr<password_manager::LoginDatabase> login_db(
237 new password_manager::LoginDatabase(login_db_file_path)); 238 new password_manager::LoginDatabase(login_db_file_path));
238 239
239 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner( 240 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner(
240 base::MessageLoopProxy::current()); 241 base::ThreadTaskRunnerHandle::Get());
241 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner( 242 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner(
242 content::BrowserThread::GetMessageLoopProxyForThread( 243 content::BrowserThread::GetMessageLoopProxyForThread(
243 content::BrowserThread::DB)); 244 content::BrowserThread::DB));
244 245
245 scoped_refptr<PasswordStore> ps; 246 scoped_refptr<PasswordStore> ps;
246 #if defined(OS_WIN) 247 #if defined(OS_WIN)
247 ps = new PasswordStoreWin(main_thread_runner, db_thread_runner, 248 ps = new PasswordStoreWin(main_thread_runner, db_thread_runner,
248 login_db.Pass(), 249 login_db.Pass(),
249 WebDataServiceFactory::GetPasswordWebDataForProfile( 250 WebDataServiceFactory::GetPasswordWebDataForProfile(
250 profile, ServiceAccessType::EXPLICIT_ACCESS)); 251 profile, ServiceAccessType::EXPLICIT_ACCESS));
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 break; 430 break;
430 case LIBSECRET: 431 case LIBSECRET:
431 usage = OTHER_LIBSECRET; 432 usage = OTHER_LIBSECRET;
432 break; 433 break;
433 } 434 }
434 } 435 }
435 UMA_HISTOGRAM_ENUMERATION("PasswordManager.LinuxBackendStatistics", usage, 436 UMA_HISTOGRAM_ENUMERATION("PasswordManager.LinuxBackendStatistics", usage,
436 MAX_BACKEND_USAGE_VALUE); 437 MAX_BACKEND_USAGE_VALUE);
437 } 438 }
438 #endif 439 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698