diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-09 02:02:35 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-09 02:02:35 +0000 |
commit | ba4f1137a6f051c668857f850b00373a7adc0253 (patch) | |
tree | 035068c94504742025464521d97ec8e000d34acf /chrome/browser/password_manager | |
parent | a6a48a3eac6218a0eb22418db06022ce091165a6 (diff) | |
download | chromium_src-ba4f1137a6f051c668857f850b00373a7adc0253.zip chromium_src-ba4f1137a6f051c668857f850b00373a7adc0253.tar.gz chromium_src-ba4f1137a6f051c668857f850b00373a7adc0253.tar.bz2 |
Rename ChromeThread to BrowserThread Part8:
- Rename entries under net and password_manager and printing.
BUG=56926
TEST=trybots
Review URL: http://codereview.chromium.org/3645001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62062 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/password_manager')
10 files changed, 150 insertions, 124 deletions
diff --git a/chrome/browser/password_manager/native_backend_gnome_x.cc b/chrome/browser/password_manager/native_backend_gnome_x.cc index 86da685..d39140c0 100644 --- a/chrome/browser/password_manager/native_backend_gnome_x.cc +++ b/chrome/browser/password_manager/native_backend_gnome_x.cc @@ -304,7 +304,7 @@ class GKRMethod { }; void GKRMethod::AddLogin(const PasswordForm& form) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); gnome_keyring_store_password( &kGnomeSchema, NULL, // Default keyring. @@ -330,7 +330,7 @@ void GKRMethod::AddLogin(const PasswordForm& form) { } void GKRMethod::UpdateLoginSearch(const PasswordForm& form) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // Search GNOME Keyring for matching passwords to update. gnome_keyring_find_itemsv( GNOME_KEYRING_ITEM_GENERIC_SECRET, @@ -353,7 +353,7 @@ void GKRMethod::UpdateLoginSearch(const PasswordForm& form) { } void GKRMethod::RemoveLogin(const PasswordForm& form) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // We find forms using the same fields as LoginDatabase::RemoveLogin(). gnome_keyring_delete_password( &kGnomeSchema, @@ -371,7 +371,7 @@ void GKRMethod::RemoveLogin(const PasswordForm& form) { } void GKRMethod::GetLogins(const PasswordForm& form) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // Search GNOME Keyring for matching passwords. gnome_keyring_find_itemsv( GNOME_KEYRING_ITEM_GENERIC_SECRET, @@ -387,7 +387,7 @@ void GKRMethod::GetLogins(const PasswordForm& form) { #if !defined(GNOME_KEYRING_WORK_AROUND_MEMORY_CORRUPTION) void GKRMethod::GetLoginsList(uint32_t blacklisted_by_user) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // Search GNOME Keyring for matching passwords. gnome_keyring_find_itemsv( GNOME_KEYRING_ITEM_GENERIC_SECRET, @@ -402,7 +402,7 @@ void GKRMethod::GetLoginsList(uint32_t blacklisted_by_user) { } void GKRMethod::GetAllLogins() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // We need to search for something, otherwise we get no results - so // we search for the fixed application string. gnome_keyring_find_itemsv( @@ -416,29 +416,29 @@ void GKRMethod::GetAllLogins() { } #else void GKRMethod::GetItemIds() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); gnome_keyring_list_item_ids(NULL, OnOperationGetIds, this, NULL); } void GKRMethod::GetItemAttrs(guint id) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); gnome_keyring_item_get_attributes(NULL, id, OnOperationGetAttrs, this, NULL); } void GKRMethod::GetItemInfo(guint id) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); gnome_keyring_item_get_info(NULL, id, OnOperationGetInfo, this, NULL); } #endif GnomeKeyringResult GKRMethod::WaitResult() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); event_.Wait(); return result_; } GnomeKeyringResult GKRMethod::WaitResult(PasswordFormList* forms) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); event_.Wait(); forms->swap(forms_); return result_; @@ -446,21 +446,21 @@ GnomeKeyringResult GKRMethod::WaitResult(PasswordFormList* forms) { #if defined(GNOME_KEYRING_WORK_AROUND_MEMORY_CORRUPTION) GnomeKeyringResult GKRMethod::WaitResult(std::vector<guint>* item_ids) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); event_.Wait(); item_ids->swap(item_ids_); return result_; } GnomeKeyringResult GKRMethod::WaitResult(PasswordForm** form) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); event_.Wait(); *form = form_.release(); return result_; } GnomeKeyringResult GKRMethod::WaitResult(string16* password) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); event_.Wait(); *password = password_; return result_; @@ -551,12 +551,12 @@ bool NativeBackendGnome::Init() { } bool NativeBackendGnome::AddLogin(const PasswordForm& form) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); GKRMethod method; - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, - NewRunnableMethod(&method, - &GKRMethod::AddLogin, - form)); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + NewRunnableMethod(&method, + &GKRMethod::AddLogin, + form)); GnomeKeyringResult result = method.WaitResult(); if (result != GNOME_KEYRING_RESULT_OK) { LOG(ERROR) << "Keyring save failed: " @@ -573,9 +573,9 @@ bool NativeBackendGnome::UpdateLogin(const PasswordForm& form) { // differ in any of the action, password_value, ssl_valid, or preferred // fields, then we add a new login with those fields updated and only delete // the original on success. - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); GKRMethod method; - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod(&method, &GKRMethod::UpdateLoginSearch, form)); @@ -608,12 +608,12 @@ bool NativeBackendGnome::UpdateLogin(const PasswordForm& form) { } bool NativeBackendGnome::RemoveLogin(const PasswordForm& form) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); GKRMethod method; - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, - NewRunnableMethod(&method, - &GKRMethod::RemoveLogin, - form)); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + NewRunnableMethod(&method, + &GKRMethod::RemoveLogin, + form)); GnomeKeyringResult result = method.WaitResult(); if (result != GNOME_KEYRING_RESULT_OK) { LOG(ERROR) << "Keyring delete failed: " @@ -626,7 +626,7 @@ bool NativeBackendGnome::RemoveLogin(const PasswordForm& form) { bool NativeBackendGnome::RemoveLoginsCreatedBetween( const base::Time& delete_begin, const base::Time& delete_end) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); bool ok = true; // We could walk the list and delete items as we find them, but it is much // easier to build the list and use RemoveLogin() to delete them. @@ -647,12 +647,12 @@ bool NativeBackendGnome::RemoveLoginsCreatedBetween( bool NativeBackendGnome::GetLogins(const PasswordForm& form, PasswordFormList* forms) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); GKRMethod method; - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, - NewRunnableMethod(&method, - &GKRMethod::GetLogins, - form)); + BrowserThread::PostTask( + BrowserThread::UI, + FROM_HERE, + NewRunnableMethod(&method, &GKRMethod::GetLogins, form)); GnomeKeyringResult result = method.WaitResult(forms); if (result == GNOME_KEYRING_RESULT_NO_MATCH) return true; @@ -667,7 +667,7 @@ bool NativeBackendGnome::GetLogins(const PasswordForm& form, bool NativeBackendGnome::GetLoginsCreatedBetween(const base::Time& get_begin, const base::Time& get_end, PasswordFormList* forms) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); // We could walk the list and add items as we find them, but it is much // easier to build the list and then filter the results. PasswordFormList all_forms; @@ -697,16 +697,16 @@ bool NativeBackendGnome::GetBlacklistLogins(PasswordFormList* forms) { bool NativeBackendGnome::GetLoginsList(PasswordFormList* forms, bool autofillable) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); uint32_t blacklisted_by_user = !autofillable; #if !defined(GNOME_KEYRING_WORK_AROUND_MEMORY_CORRUPTION) GKRMethod method; - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, - NewRunnableMethod(&method, - &GKRMethod::GetLoginsList, - blacklisted_by_user)); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + NewRunnableMethod(&method, + &GKRMethod::GetLoginsList, + blacklisted_by_user)); GnomeKeyringResult result = method.WaitResult(forms); if (result == GNOME_KEYRING_RESULT_NO_MATCH) return true; @@ -734,9 +734,9 @@ bool NativeBackendGnome::GetLoginsList(PasswordFormList* forms, bool NativeBackendGnome::GetAllLogins(PasswordFormList* forms) { GKRMethod method; #if !defined(GNOME_KEYRING_WORK_AROUND_MEMORY_CORRUPTION) - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, - NewRunnableMethod(&method, - &GKRMethod::GetAllLogins)); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + NewRunnableMethod(&method, + &GKRMethod::GetAllLogins)); GnomeKeyringResult result = method.WaitResult(forms); if (result == GNOME_KEYRING_RESULT_NO_MATCH) return true; @@ -747,9 +747,9 @@ bool NativeBackendGnome::GetAllLogins(PasswordFormList* forms) { } return true; #else - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, - NewRunnableMethod(&method, - &GKRMethod::GetItemIds)); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + NewRunnableMethod(&method, + &GKRMethod::GetItemIds)); std::vector<guint> item_ids; GnomeKeyringResult result = method.WaitResult(&item_ids); if (result != GNOME_KEYRING_RESULT_OK) { @@ -761,10 +761,10 @@ bool NativeBackendGnome::GetAllLogins(PasswordFormList* forms) { // We can parallelize getting the item attributes. GKRMethod* methods = new GKRMethod[item_ids.size()]; for (size_t i = 0; i < item_ids.size(); ++i) { - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, - NewRunnableMethod(&methods[i], - &GKRMethod::GetItemAttrs, - item_ids[i])); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + NewRunnableMethod(&methods[i], + &GKRMethod::GetItemAttrs, + item_ids[i])); } bool success = true; @@ -783,10 +783,10 @@ bool NativeBackendGnome::GetAllLogins(PasswordFormList* forms) { success = false; } if (all_forms[i]) { - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, - NewRunnableMethod(&methods[i], - &GKRMethod::GetItemInfo, - item_ids[i])); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + NewRunnableMethod(&methods[i], + &GKRMethod::GetItemInfo, + item_ids[i])); } } diff --git a/chrome/browser/password_manager/native_backend_kwallet_x.cc b/chrome/browser/password_manager/native_backend_kwallet_x.cc index 5f07bb8..9337e93 100644 --- a/chrome/browser/password_manager/native_backend_kwallet_x.cc +++ b/chrome/browser/password_manager/native_backend_kwallet_x.cc @@ -549,7 +549,7 @@ bool NativeBackendKWallet::CheckError() { } int NativeBackendKWallet::WalletHandle() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); // Open the wallet. int handle = kInvalidKWalletHandle; dbus_g_proxy_call(proxy_, "open", &error_, diff --git a/chrome/browser/password_manager/password_manager_unittest.cc b/chrome/browser/password_manager/password_manager_unittest.cc index d408a64..2be490f 100644 --- a/chrome/browser/password_manager/password_manager_unittest.cc +++ b/chrome/browser/password_manager/password_manager_unittest.cc @@ -73,7 +73,7 @@ ACTION_P(SaveToScopedPtr, scoped) { class PasswordManagerTest : public testing::Test { public: PasswordManagerTest() - : ui_thread_(ChromeThread::UI, &message_loop_) {} + : ui_thread_(BrowserThread::UI, &message_loop_) {} protected: virtual void SetUp() { @@ -108,7 +108,7 @@ class PasswordManagerTest : public testing::Test { // We create a UI thread to satisfy PasswordStore. MessageLoopForUI message_loop_; - ChromeThread ui_thread_; + BrowserThread ui_thread_; scoped_ptr<Profile> profile_; scoped_refptr<MockPasswordStore> store_; diff --git a/chrome/browser/password_manager/password_store.cc b/chrome/browser/password_manager/password_store.cc index a02d666..3630d6b 100644 --- a/chrome/browser/password_manager/password_store.cc +++ b/chrome/browser/password_manager/password_store.cc @@ -21,7 +21,7 @@ bool PasswordStore::Init() { } void PasswordStore::ScheduleTask(Task* task) { - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, task); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, task); } void PasswordStore::ReportMetrics() { @@ -79,7 +79,7 @@ void PasswordStore::NotifyConsumer(GetLoginsRequest* request, scoped_ptr<GetLoginsRequest> request_ptr(request); #if !defined(OS_MACOSX) - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); #endif request->message_loop->PostTask(FROM_HERE, NewRunnableMethod(this, @@ -90,7 +90,7 @@ void PasswordStore::NotifyConsumer(GetLoginsRequest* request, void PasswordStore::NotifyConsumerImpl(PasswordStoreConsumer* consumer, int handle, const vector<PasswordForm*> forms) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // Don't notify the consumer if the request was canceled. if (pending_requests_.find(handle) == pending_requests_.end()) { // |forms| is const so we iterate rather than use STLDeleteElements(). @@ -104,14 +104,14 @@ void PasswordStore::NotifyConsumerImpl(PasswordStoreConsumer* consumer, } int PasswordStore::GetNewRequestHandle() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); int handle = handle_++; pending_requests_.insert(handle); return handle; } void PasswordStore::CancelLoginsQuery(int handle) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); pending_requests_.erase(handle); } diff --git a/chrome/browser/password_manager/password_store_default.cc b/chrome/browser/password_manager/password_store_default.cc index 012cfa1..3aa1323 100644 --- a/chrome/browser/password_manager/password_store_default.cc +++ b/chrome/browser/password_manager/password_store_default.cc @@ -34,7 +34,7 @@ PasswordStoreDefault::~PasswordStoreDefault() { } void PasswordStoreDefault::ReportMetricsImpl() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); login_db_->ReportMetrics(); } @@ -114,13 +114,13 @@ void PasswordStoreDefault::GetBlacklistLoginsImpl( bool PasswordStoreDefault::FillAutofillableLogins( std::vector<PasswordForm*>* forms) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); return login_db_->GetAutofillableLogins(forms); } bool PasswordStoreDefault::FillBlacklistLogins( std::vector<PasswordForm*>* forms) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); return login_db_->GetBlacklistLogins(forms); } diff --git a/chrome/browser/password_manager/password_store_default_unittest.cc b/chrome/browser/password_manager/password_store_default_unittest.cc index a416d37..31200d5 100644 --- a/chrome/browser/password_manager/password_store_default_unittest.cc +++ b/chrome/browser/password_manager/password_store_default_unittest.cc @@ -55,21 +55,21 @@ class MockNotificationObserver : public NotificationObserver { // the DB thread. class DBThreadObserverHelper : public base::RefCountedThreadSafe<DBThreadObserverHelper, - ChromeThread::DeleteOnDBThread> { + BrowserThread::DeleteOnDBThread> { public: DBThreadObserverHelper() : done_event_(true, false) {} void Init() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); - ChromeThread::PostTask( - ChromeThread::DB, + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + BrowserThread::PostTask( + BrowserThread::DB, FROM_HERE, NewRunnableMethod(this, &DBThreadObserverHelper::AddObserverTask)); done_event_.Wait(); } virtual ~DBThreadObserverHelper() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); registrar_.RemoveAll(); } @@ -81,7 +81,7 @@ class DBThreadObserverHelper : friend class base::RefCountedThreadSafe<DBThreadObserverHelper>; void AddObserverTask() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); registrar_.Add(&observer_, NotificationType::LOGINS_CHANGED, NotificationService::AllSources()); @@ -100,8 +100,8 @@ typedef std::vector<PasswordForm*> VectorOfForms; class PasswordStoreDefaultTest : public testing::Test { protected: PasswordStoreDefaultTest() - : ui_thread_(ChromeThread::UI, &message_loop_), - db_thread_(ChromeThread::DB) { + : ui_thread_(BrowserThread::UI, &message_loop_), + db_thread_(BrowserThread::DB) { } virtual void SetUp() { @@ -126,8 +126,8 @@ class PasswordStoreDefaultTest : public testing::Test { } MessageLoopForUI message_loop_; - ChromeThread ui_thread_; - ChromeThread db_thread_; // PasswordStore, WDS schedule work on this thread. + BrowserThread ui_thread_; + BrowserThread db_thread_; // PasswordStore, WDS schedule work on this thread. scoped_ptr<LoginDatabase> login_db_; scoped_ptr<TestingProfile> profile_; @@ -140,7 +140,7 @@ ACTION(STLDeleteElements0) { } ACTION(QuitUIMessageLoop) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); MessageLoop::current()->Quit(); } @@ -185,7 +185,8 @@ TEST_F(PasswordStoreDefaultTest, NonASCIIData) { // The PasswordStore schedules tasks to run on the DB thread so we schedule // yet another task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); MockPasswordStoreConsumer consumer; @@ -279,7 +280,8 @@ TEST_F(PasswordStoreDefaultTest, Migration) { // The WDS schedules tasks to run on the DB thread so we schedule yet another // task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); // Initializing the PasswordStore should trigger a migration. @@ -294,7 +296,8 @@ TEST_F(PasswordStoreDefaultTest, Migration) { // Again, the WDS schedules tasks to run on the DB thread, so schedule a task // to signal us when it is safe to continue. - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); // Let the WDS callbacks proceed so the logins can be migrated. @@ -338,7 +341,8 @@ TEST_F(PasswordStoreDefaultTest, Migration) { wds_->GetAutofillableLogins(&wds_consumer); // Wait for the WDS methods to execute on the DB thread. - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); // Handle the callback from the WDS. @@ -351,7 +355,8 @@ TEST_F(PasswordStoreDefaultTest, Migration) { wds_->GetBlacklistLogins(&wds_consumer); // Wait for the WDS methods to execute on the DB thread. - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); // Handle the callback from the WDS. @@ -386,7 +391,8 @@ TEST_F(PasswordStoreDefaultTest, MigrationAlreadyDone) { // The WDS schedules tasks to run on the DB thread so we schedule yet another // task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); // Prentend that the migration has already taken place. @@ -461,7 +467,8 @@ TEST_F(PasswordStoreDefaultTest, Notifications) { // The PasswordStore schedules tasks to run on the DB thread so we schedule // yet another task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); // Change the password. @@ -482,7 +489,8 @@ TEST_F(PasswordStoreDefaultTest, Notifications) { store->UpdateLogin(*form); // Wait for PasswordStore to send the notification. - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); const PasswordStoreChange expected_delete_changes[] = { @@ -500,6 +508,7 @@ TEST_F(PasswordStoreDefaultTest, Notifications) { store->RemoveLogin(*form); // Wait for PasswordStore to send the notification. - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); } diff --git a/chrome/browser/password_manager/password_store_mac_unittest.cc b/chrome/browser/password_manager/password_store_mac_unittest.cc index 3db112d..877309d 100644 --- a/chrome/browser/password_manager/password_store_mac_unittest.cc +++ b/chrome/browser/password_manager/password_store_mac_unittest.cc @@ -36,7 +36,7 @@ ACTION(STLDeleteElements0) { } ACTION(QuitUIMessageLoop) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); MessageLoop::current()->Quit(); } @@ -896,7 +896,7 @@ TEST_F(PasswordStoreMacInternalsTest, TestPasswordGetAll) { class PasswordStoreMacTest : public testing::Test { public: - PasswordStoreMacTest() : ui_thread_(ChromeThread::UI, &message_loop_) {} + PasswordStoreMacTest() : ui_thread_(BrowserThread::UI, &message_loop_) {} virtual void SetUp() { login_db_ = new LoginDatabase(); @@ -917,7 +917,7 @@ class PasswordStoreMacTest : public testing::Test { protected: MessageLoopForUI message_loop_; - ChromeThread ui_thread_; + BrowserThread ui_thread_; MockKeychain* keychain_; // Owned by store_. LoginDatabase* login_db_; // Owned by store_. diff --git a/chrome/browser/password_manager/password_store_win_unittest.cc b/chrome/browser/password_manager/password_store_win_unittest.cc index aae342d..5133bc1 100644 --- a/chrome/browser/password_manager/password_store_win_unittest.cc +++ b/chrome/browser/password_manager/password_store_win_unittest.cc @@ -51,8 +51,8 @@ typedef std::vector<PasswordForm*> VectorOfForms; class PasswordStoreWinTest : public testing::Test { protected: PasswordStoreWinTest() - : ui_thread_(ChromeThread::UI, &message_loop_), - db_thread_(ChromeThread::DB) { + : ui_thread_(BrowserThread::UI, &message_loop_), + db_thread_(BrowserThread::DB) { } bool CreateIE7PasswordInfo(const std::wstring& url, const base::Time& created, @@ -121,8 +121,8 @@ class PasswordStoreWinTest : public testing::Test { } MessageLoopForUI message_loop_; - ChromeThread ui_thread_; - ChromeThread db_thread_; // PasswordStore, WDS schedule work on this thread. + BrowserThread ui_thread_; + BrowserThread db_thread_; // PasswordStore, WDS schedule work on this thread. scoped_ptr<LoginDatabase> login_db_; scoped_ptr<TestingProfile> profile_; @@ -135,7 +135,7 @@ ACTION(STLDeleteElements0) { } ACTION(QuitUIMessageLoop) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); MessageLoop::current()->Quit(); } @@ -159,7 +159,8 @@ TEST_F(PasswordStoreWinTest, ConvertIE7Login) { // The WDS schedules tasks to run on the DB thread so we schedule yet another // task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); // Prentend that the migration has already taken place. @@ -264,7 +265,8 @@ TEST_F(PasswordStoreWinTest, DISABLED_MultipleWDSQueriesOnDifferentThreads) { // The WDS schedules tasks to run on the DB thread so we schedule yet another // task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); // Prentend that the migration has already taken place. @@ -416,7 +418,8 @@ TEST_F(PasswordStoreWinTest, Migration) { // The WDS schedules tasks to run on the DB thread so we schedule yet another // task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); // Initializing the PasswordStore should trigger a migration. @@ -430,7 +433,8 @@ TEST_F(PasswordStoreWinTest, Migration) { // Again, the WDS schedules tasks to run on the DB thread, so schedule a task // to signal us when it is safe to continue. - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); // Let the WDS callbacks proceed so the logins can be migrated. @@ -474,7 +478,8 @@ TEST_F(PasswordStoreWinTest, Migration) { wds_->GetAutofillableLogins(&wds_consumer); // Wait for the WDS methods to execute on the DB thread. - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); // Handle the callback from the WDS. @@ -487,7 +492,8 @@ TEST_F(PasswordStoreWinTest, Migration) { wds_->GetBlacklistLogins(&wds_consumer); // Wait for the WDS methods to execute on the DB thread. - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); // Handle the callback from the WDS. diff --git a/chrome/browser/password_manager/password_store_x.cc b/chrome/browser/password_manager/password_store_x.cc index 85d1170..9132da5 100644 --- a/chrome/browser/password_manager/password_store_x.cc +++ b/chrome/browser/password_manager/password_store_x.cc @@ -164,7 +164,7 @@ bool PasswordStoreX::FillBlacklistLogins(vector<PasswordForm*>* forms) { } void PasswordStoreX::CheckMigration() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); if (migration_checked_ || !backend_.get()) return; migration_checked_ = true; diff --git a/chrome/browser/password_manager/password_store_x_unittest.cc b/chrome/browser/password_manager/password_store_x_unittest.cc index 1bb1ab3..55d6391 100644 --- a/chrome/browser/password_manager/password_store_x_unittest.cc +++ b/chrome/browser/password_manager/password_store_x_unittest.cc @@ -55,21 +55,21 @@ class MockNotificationObserver : public NotificationObserver { // the DB thread. class DBThreadObserverHelper : public base::RefCountedThreadSafe<DBThreadObserverHelper, - ChromeThread::DeleteOnDBThread> { + BrowserThread::DeleteOnDBThread> { public: DBThreadObserverHelper() : done_event_(true, false) {} void Init() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); - ChromeThread::PostTask( - ChromeThread::DB, + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + BrowserThread::PostTask( + BrowserThread::DB, FROM_HERE, NewRunnableMethod(this, &DBThreadObserverHelper::AddObserverTask)); done_event_.Wait(); } virtual ~DBThreadObserverHelper() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); registrar_.RemoveAll(); } @@ -81,7 +81,7 @@ class DBThreadObserverHelper friend class base::RefCountedThreadSafe<DBThreadObserverHelper>; void AddObserverTask() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); registrar_.Add(&observer_, NotificationType::LOGINS_CHANGED, NotificationService::AllSources()); @@ -276,8 +276,8 @@ enum BackendType { class PasswordStoreXTest : public testing::TestWithParam<BackendType> { protected: PasswordStoreXTest() - : ui_thread_(ChromeThread::UI, &message_loop_), - db_thread_(ChromeThread::DB) { + : ui_thread_(BrowserThread::UI, &message_loop_), + db_thread_(BrowserThread::DB) { } virtual void SetUp() { @@ -312,8 +312,8 @@ class PasswordStoreXTest : public testing::TestWithParam<BackendType> { } MessageLoopForUI message_loop_; - ChromeThread ui_thread_; - ChromeThread db_thread_; // PasswordStore, WDS schedule work on this thread. + BrowserThread ui_thread_; + BrowserThread db_thread_; // PasswordStore, WDS schedule work on this thread. scoped_ptr<LoginDatabase> login_db_; scoped_ptr<TestingProfile> profile_; @@ -326,7 +326,7 @@ ACTION(STLDeleteElements0) { } ACTION(QuitUIMessageLoop) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); MessageLoop::current()->Quit(); } @@ -355,7 +355,8 @@ TEST_P(PasswordStoreXTest, WDSMigration) { // The WDS schedules tasks to run on the DB thread so we schedule yet another // task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); // Initializing the PasswordStore should trigger a migration. @@ -372,7 +373,8 @@ TEST_P(PasswordStoreXTest, WDSMigration) { // Again, the WDS schedules tasks to run on the DB thread, so schedule a task // to signal us when it is safe to continue. - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); // Let the WDS callbacks proceed so the logins can be migrated. @@ -416,7 +418,8 @@ TEST_P(PasswordStoreXTest, WDSMigration) { wds_->GetAutofillableLogins(&wds_consumer); // Wait for the WDS methods to execute on the DB thread. - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); // Handle the callback from the WDS. @@ -429,7 +432,8 @@ TEST_P(PasswordStoreXTest, WDSMigration) { wds_->GetBlacklistLogins(&wds_consumer); // Wait for the WDS methods to execute on the DB thread. - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); // Handle the callback from the WDS. @@ -468,7 +472,8 @@ TEST_P(PasswordStoreXTest, WDSMigrationAlreadyDone) { // The WDS schedules tasks to run on the DB thread so we schedule yet another // task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); // Prentend that the migration has already taken place. @@ -547,7 +552,8 @@ TEST_P(PasswordStoreXTest, Notifications) { // The PasswordStore schedules tasks to run on the DB thread so we schedule // yet another task to notify us that it's safe to carry on with the test. WaitableEvent done(false, false); - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); // Change the password. @@ -568,7 +574,8 @@ TEST_P(PasswordStoreXTest, Notifications) { store->UpdateLogin(*form); // Wait for PasswordStore to send the notification. - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); const PasswordStoreChange expected_delete_changes[] = { @@ -586,7 +593,8 @@ TEST_P(PasswordStoreXTest, Notifications) { store->RemoveLogin(*form); // Wait for PasswordStore to send the notification. - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); } @@ -608,7 +616,7 @@ TEST_P(PasswordStoreXTest, NativeMigration) { // Populate the login DB with logins that should be migrated. for (VectorOfForms::iterator it = expected_autofillable.begin(); it != expected_autofillable.end(); ++it) { - ChromeThread::PostTask(ChromeThread::DB, + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, NewRunnableMethod(login_db, &LoginDatabase::AddLogin, @@ -616,7 +624,7 @@ TEST_P(PasswordStoreXTest, NativeMigration) { } for (VectorOfForms::iterator it = expected_blacklisted.begin(); it != expected_blacklisted.end(); ++it) { - ChromeThread::PostTask(ChromeThread::DB, + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, NewRunnableMethod(login_db, &LoginDatabase::AddLogin, @@ -626,7 +634,8 @@ TEST_P(PasswordStoreXTest, NativeMigration) { // Schedule another task on the DB thread to notify us that it's safe to // carry on with the test. WaitableEvent done(false, false); - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); // Get the new size of the login DB file. We expect it to be larger. @@ -685,11 +694,12 @@ TEST_P(PasswordStoreXTest, NativeMigration) { .WillOnce(WithArg<0>(STLDeleteElements0())); } - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, new LoginDatabaseQueryTask(login_db, true, &ld_return)); // Wait for the login DB methods to execute on the DB thread. - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); if (GetParam() == WORKING_BACKEND) { @@ -704,11 +714,12 @@ TEST_P(PasswordStoreXTest, NativeMigration) { .WillOnce(WithArg<0>(STLDeleteElements0())); } - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, new LoginDatabaseQueryTask(login_db, false, &ld_return)); // Wait for the login DB methods to execute on the DB thread. - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done)); + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, + new SignalingTask(&done)); done.Wait(); if (GetParam() == WORKING_BACKEND) { |