diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-10 05:00:51 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-10 05:00:51 +0000 |
commit | 0aa26f4be3c0590ca2876f017e6ad4f244dd35e3 (patch) | |
tree | 2f272ce104169abdab697cd5f81ca16bf2074ac3 | |
parent | 945a25941ed4de145a5041cccbe5908c92aa0c3b (diff) | |
download | chromium_src-0aa26f4be3c0590ca2876f017e6ad4f244dd35e3.zip chromium_src-0aa26f4be3c0590ca2876f017e6ad4f244dd35e3.tar.gz chromium_src-0aa26f4be3c0590ca2876f017e6ad4f244dd35e3.tar.bz2 |
Rename ChromeThread to BrowserThread Part11:
- Rename entries under geolocation, google, gtk, history and importer.
BUG=56926
TEST=trybots
Review URL: http://codereview.chromium.org/3646002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62106 0039d316-1c4b-4281-b951-d872f2087c98
34 files changed, 183 insertions, 182 deletions
diff --git a/chrome/browser/geolocation/access_token_store.cc b/chrome/browser/geolocation/access_token_store.cc index 63b8478..0210bdb 100644 --- a/chrome/browser/geolocation/access_token_store.cc +++ b/chrome/browser/geolocation/access_token_store.cc @@ -36,7 +36,7 @@ ChromePrefsAccessTokenStore::ChromePrefsAccessTokenStore() { void ChromePrefsAccessTokenStore::LoadDictionaryStoreInUIThread( scoped_refptr<CancelableRequest<LoadAccessTokensCallbackType> > request) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (request->canceled()) return; const DictionaryValue* token_dictionary = @@ -60,13 +60,13 @@ void ChromePrefsAccessTokenStore::LoadDictionaryStoreInUIThread( void ChromePrefsAccessTokenStore::DoLoadAccessTokens( scoped_refptr<CancelableRequest<LoadAccessTokensCallbackType> > request) { - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, NewRunnableMethod( + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod( this, &ChromePrefsAccessTokenStore::LoadDictionaryStoreInUIThread, request)); } void SetAccessTokenOnUIThread(const GURL& server_url, const string16& token) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DictionaryValue* access_token_dictionary = g_browser_process->local_state()->GetMutableDictionary( prefs::kGeolocationAccessToken); @@ -76,7 +76,7 @@ void SetAccessTokenOnUIThread(const GURL& server_url, const string16& token) { void ChromePrefsAccessTokenStore::SaveAccessToken( const GURL& server_url, const string16& access_token) { - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, NewRunnableFunction( + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableFunction( &SetAccessTokenOnUIThread, server_url, access_token)); } } // namespace diff --git a/chrome/browser/geolocation/access_token_store_browsertest.cc b/chrome/browser/geolocation/access_token_store_browsertest.cc index f7ea990..3c53243 100644 --- a/chrome/browser/geolocation/access_token_store_browsertest.cc +++ b/chrome/browser/geolocation/access_token_store_browsertest.cc @@ -14,7 +14,7 @@ namespace { // The token store factory implementation expects to be used from any well-known // chrome thread other than UI. We could use any arbitrary thread; IO is // a good choice as this is the expected usage. -const ChromeThread::ID kExpectedClientThreadId = ChromeThread::IO; +const BrowserThread::ID kExpectedClientThreadId = BrowserThread::IO; const char* kRefServerUrl1 = "https://test.domain.example/foo?id=bar.bar"; const char* kRefServerUrl2 = "http://another.domain.example/foo?id=bar.bar#2"; } // namespace @@ -43,7 +43,7 @@ void StartTestStepFromClientThread( scoped_refptr<AccessTokenStore>* store, CancelableRequestConsumerBase* consumer, AccessTokenStore::LoadAccessTokensCallbackType* callback) { - ASSERT_TRUE(ChromeThread::CurrentlyOn(kExpectedClientThreadId)); + ASSERT_TRUE(BrowserThread::CurrentlyOn(kExpectedClientThreadId)); if (*store == NULL) (*store) = NewChromePrefsAccessTokenStore(); (*store)->LoadAccessTokens(consumer, callback); @@ -56,7 +56,7 @@ struct TokenLoadClientForTest { }; void RunCancelTestInClientTread() { - ASSERT_TRUE(ChromeThread::CurrentlyOn(kExpectedClientThreadId)); + ASSERT_TRUE(BrowserThread::CurrentlyOn(kExpectedClientThreadId)); scoped_refptr<AccessTokenStore> store = NewChromePrefsAccessTokenStore(); CancelableRequestConsumer consumer; TokenLoadClientForTest load_client; @@ -82,8 +82,8 @@ void RunCancelTestInClientTread() { EXPECT_FALSE(consumer.HasPendingRequests()); EXPECT_EQ(0u, consumer.PendingRequestCount()); - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, new MessageLoop::QuitTask); + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, new MessageLoop::QuitTask); } void GeolocationAccessTokenStoreTest::DoTestStepAndWaitForResults( @@ -93,7 +93,7 @@ void GeolocationAccessTokenStoreTest::DoTestStepAndWaitForResults( token_to_expect_ = token_to_expect; token_to_set_ = token_to_set; - ChromeThread::PostTask( + BrowserThread::PostTask( kExpectedClientThreadId, FROM_HERE, NewRunnableFunction( &StartTestStepFromClientThread, &token_store_, &request_consumer_, NewCallback(this, @@ -103,7 +103,7 @@ void GeolocationAccessTokenStoreTest::DoTestStepAndWaitForResults( void GeolocationAccessTokenStoreTest::OnAccessTokenStoresLoaded( AccessTokenStore::AccessTokenSet access_token_set) { - ASSERT_TRUE(ChromeThread::CurrentlyOn(kExpectedClientThreadId)) + ASSERT_TRUE(BrowserThread::CurrentlyOn(kExpectedClientThreadId)) << "Callback from token factory should be from the same thread as the " "LoadAccessTokenStores request was made on"; EXPECT_TRUE(token_to_set_ || token_to_expect_) << "No work to do?"; @@ -121,14 +121,14 @@ void GeolocationAccessTokenStoreTest::OnAccessTokenStoresLoaded( NewChromePrefsAccessTokenStore(); store->SaveAccessToken(ref_url_, *token_to_set_); } - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, new MessageLoop::QuitTask); + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, new MessageLoop::QuitTask); } IN_PROC_BROWSER_TEST_F(GeolocationAccessTokenStoreTest, SetAcrossInstances) { const string16 ref_token1 = ASCIIToUTF16("jksdfo90,'s#\"#1*("); const string16 ref_token2 = ASCIIToUTF16("\1\2\3\4\5\6\7\10\11\12=023"); - ASSERT_TRUE(ChromeThread::CurrentlyOn(ChromeThread::UI)); + ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::UI)); DoTestStepAndWaitForResults(kRefServerUrl1, NULL, &ref_token1); // Check it was set, and change to new value. @@ -144,7 +144,7 @@ IN_PROC_BROWSER_TEST_F(GeolocationAccessTokenStoreTest, SetAcrossInstances) { } IN_PROC_BROWSER_TEST_F(GeolocationAccessTokenStoreTest, CancelRequest) { - ChromeThread::PostTask( + BrowserThread::PostTask( kExpectedClientThreadId, FROM_HERE, NewRunnableFunction( RunCancelTestInClientTread)); ui_test_utils::RunMessageLoop(); diff --git a/chrome/browser/geolocation/core_location_data_provider_mac.h b/chrome/browser/geolocation/core_location_data_provider_mac.h index 8eafd3c..ffe6a6a 100644 --- a/chrome/browser/geolocation/core_location_data_provider_mac.h +++ b/chrome/browser/geolocation/core_location_data_provider_mac.h @@ -37,7 +37,7 @@ class CoreLocationDataProviderMac ~CoreLocationDataProviderMac(); private: - // These must execute in ChromeThread::UI + // These must execute in BrowserThread::UI void StartUpdatingTask(); void StopUpdatingTask(); // This must execute in the origin thread (IO thread) @@ -47,7 +47,7 @@ class CoreLocationDataProviderMac scoped_nsobject<CoreLocationWrapperMac> wrapper_; // The LocationProviderBase class that should receive position data CoreLocationProviderMac* provider_; - ChromeThread::ID origin_thread_id_; + BrowserThread::ID origin_thread_id_; }; #endif diff --git a/chrome/browser/geolocation/core_location_data_provider_mac.mm b/chrome/browser/geolocation/core_location_data_provider_mac.mm index ae8e749..b20230e 100644 --- a/chrome/browser/geolocation/core_location_data_provider_mac.mm +++ b/chrome/browser/geolocation/core_location_data_provider_mac.mm @@ -81,7 +81,7 @@ enum { // successful call (to avoid |bundle_| being double initialized) - (BOOL)locationDataAvailable; -// These should always be called from ChromeThread::UI +// These should always be called from BrowserThread::UI - (void)startLocation; - (void)stopLocation; @@ -183,9 +183,9 @@ enum { @end CoreLocationDataProviderMac::CoreLocationDataProviderMac() { - if(!ChromeThread::GetCurrentThreadIdentifier(&origin_thread_id_)) + if(!BrowserThread::GetCurrentThreadIdentifier(&origin_thread_id_)) NOTREACHED() << - "CoreLocation data provider must be created in a valid ChromeThread."; + "CoreLocation data provider must be created in a valid BrowserThread."; provider_ = NULL; wrapper_.reset([[CoreLocationWrapperMac alloc] initWithDataProvider:this]); } @@ -202,7 +202,7 @@ bool CoreLocationDataProviderMac:: DCHECK(!provider_) << "StartUpdating called twice"; if(![wrapper_ locationDataAvailable]) return false; provider_ = provider; - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &CoreLocationDataProviderMac::StartUpdatingTask)); return true; } @@ -210,32 +210,32 @@ bool CoreLocationDataProviderMac:: // Clears provider_ so that any leftover messages from CoreLocation get ignored void CoreLocationDataProviderMac::StopUpdating() { provider_ = NULL; - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &CoreLocationDataProviderMac::StopUpdatingTask)); } void CoreLocationDataProviderMac::UpdatePosition(Geoposition *position) { - ChromeThread::PostTask(origin_thread_id_, FROM_HERE, + BrowserThread::PostTask(origin_thread_id_, FROM_HERE, NewRunnableMethod(this, &CoreLocationDataProviderMac::PositionUpdated, *position)); } -// Runs in ChromeThread::UI +// Runs in BrowserThread::UI void CoreLocationDataProviderMac::StartUpdatingTask() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); [wrapper_ startLocation]; } -// Runs in ChromeThread::UI +// Runs in BrowserThread::UI void CoreLocationDataProviderMac::StopUpdatingTask() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); [wrapper_ stopLocation]; } void CoreLocationDataProviderMac::PositionUpdated(Geoposition position) { - DCHECK(ChromeThread::CurrentlyOn(origin_thread_id_)); + DCHECK(BrowserThread::CurrentlyOn(origin_thread_id_)); if(provider_) provider_->SetPosition(&position); } diff --git a/chrome/browser/geolocation/geolocation_content_settings_map.cc b/chrome/browser/geolocation/geolocation_content_settings_map.cc index 2d4ac0e..f3500f1 100644 --- a/chrome/browser/geolocation/geolocation_content_settings_map.cc +++ b/chrome/browser/geolocation/geolocation_content_settings_map.cc @@ -34,7 +34,7 @@ const ContentSetting GeolocationContentSettingsMap::GeolocationContentSettingsMap(Profile* profile) : profile_(profile) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); } // static @@ -45,7 +45,7 @@ void GeolocationContentSettingsMap::RegisterUserPrefs(PrefService* prefs) { } ContentSetting GeolocationContentSettingsMap::GetDefaultContentSetting() const { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); const PrefService* prefs = profile_->GetPrefs(); const ContentSetting default_content_setting = IntToContentSetting( prefs->GetInteger(prefs::kGeolocationDefaultContentSetting)); @@ -56,7 +56,7 @@ ContentSetting GeolocationContentSettingsMap::GetDefaultContentSetting() const { ContentSetting GeolocationContentSettingsMap::GetContentSetting( const GURL& requesting_url, const GURL& embedding_url) const { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(requesting_url.is_valid() && embedding_url.is_valid()); GURL requesting_origin(requesting_url.GetOrigin()); GURL embedding_origin(embedding_url.GetOrigin()); @@ -85,7 +85,7 @@ ContentSetting GeolocationContentSettingsMap::GetContentSetting( GeolocationContentSettingsMap::AllOriginsSettings GeolocationContentSettingsMap::GetAllOriginsSettings() const { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); AllOriginsSettings content_settings; const DictionaryValue* all_settings_dictionary = profile_->GetPrefs()->GetDictionary(prefs::kGeolocationContentSettings); @@ -113,7 +113,7 @@ GeolocationContentSettingsMap::AllOriginsSettings void GeolocationContentSettingsMap::SetDefaultContentSetting( ContentSetting setting) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); profile_->GetPrefs()->SetInteger(prefs::kGeolocationDefaultContentSetting, setting == CONTENT_SETTING_DEFAULT ? kDefaultSetting : setting); @@ -123,7 +123,7 @@ void GeolocationContentSettingsMap::SetContentSetting( const GURL& requesting_url, const GURL& embedding_url, ContentSetting setting) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(requesting_url.is_valid()); DCHECK(embedding_url.is_valid() || embedding_url.is_empty()); GURL requesting_origin(requesting_url.GetOrigin()); @@ -165,7 +165,7 @@ void GeolocationContentSettingsMap::SetContentSetting( } void GeolocationContentSettingsMap::ResetToDefault() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); PrefService* prefs = profile_->GetPrefs(); prefs->ClearPref(prefs::kGeolocationDefaultContentSetting); diff --git a/chrome/browser/geolocation/geolocation_content_settings_map_unittest.cc b/chrome/browser/geolocation/geolocation_content_settings_map_unittest.cc index ae6cbaf..5148116 100644 --- a/chrome/browser/geolocation/geolocation_content_settings_map_unittest.cc +++ b/chrome/browser/geolocation/geolocation_content_settings_map_unittest.cc @@ -15,12 +15,12 @@ namespace { class GeolocationContentSettingsMapTests : public testing::Test { public: GeolocationContentSettingsMapTests() - : ui_thread_(ChromeThread::UI, &message_loop_) { + : ui_thread_(BrowserThread::UI, &message_loop_) { } protected: MessageLoop message_loop_; - ChromeThread ui_thread_; + BrowserThread ui_thread_; }; TEST_F(GeolocationContentSettingsMapTests, DefaultValues) { diff --git a/chrome/browser/geolocation/geolocation_dispatcher_host.cc b/chrome/browser/geolocation/geolocation_dispatcher_host.cc index b4d380b..94dbd55 100644 --- a/chrome/browser/geolocation/geolocation_dispatcher_host.cc +++ b/chrome/browser/geolocation/geolocation_dispatcher_host.cc @@ -91,7 +91,7 @@ GeolocationDispatcherHostImpl::~GeolocationDispatcherHostImpl() { bool GeolocationDispatcherHostImpl::OnMessageReceived( const IPC::Message& msg, bool* msg_was_ok) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); *msg_was_ok = true; bool handled = true; IPC_BEGIN_MESSAGE_MAP_EX(GeolocationDispatcherHostImpl, msg, *msg_was_ok) @@ -118,7 +118,7 @@ bool GeolocationDispatcherHostImpl::OnMessageReceived( void GeolocationDispatcherHostImpl::OnLocationUpdate( const Geoposition& geoposition) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); for (std::set<int>::iterator it = geolocation_renderer_ids_.begin(); it != geolocation_renderer_ids_.end(); ++it) { IPC::Message* message = @@ -129,20 +129,20 @@ void GeolocationDispatcherHostImpl::OnLocationUpdate( } void GeolocationDispatcherHostImpl::OnRegisterDispatcher(int render_view_id) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK_EQ(0u, geolocation_renderer_ids_.count(render_view_id)); geolocation_renderer_ids_.insert(render_view_id); } void GeolocationDispatcherHostImpl::OnUnregisterDispatcher(int render_view_id) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK_EQ(1u, geolocation_renderer_ids_.count(render_view_id)); geolocation_renderer_ids_.erase(render_view_id); } void GeolocationDispatcherHostImpl::OnRequestPermission( int render_view_id, int bridge_id, const GURL& requesting_frame) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DLOG(INFO) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" << render_view_id << ":" << bridge_id; geolocation_permission_context_->RequestGeolocationPermission( @@ -152,7 +152,7 @@ void GeolocationDispatcherHostImpl::OnRequestPermission( void GeolocationDispatcherHostImpl::OnCancelPermissionRequest( int render_view_id, int bridge_id, const GURL& requesting_frame) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DLOG(INFO) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" << render_view_id << ":" << bridge_id; geolocation_permission_context_->CancelGeolocationPermissionRequest( @@ -166,7 +166,7 @@ void GeolocationDispatcherHostImpl::OnStartUpdating( // WebKit sends the startupdating request before checking permissions, to // optimize the no-location-available case and reduce latency in the success // case (location lookup happens in parallel with the permission request). - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DLOG(INFO) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" << render_view_id << ":" << bridge_id; bridge_update_options_[std::make_pair(render_view_id, bridge_id)] = @@ -179,7 +179,7 @@ void GeolocationDispatcherHostImpl::OnStartUpdating( void GeolocationDispatcherHostImpl::OnStopUpdating( int render_view_id, int bridge_id) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DLOG(INFO) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" << render_view_id << ":" << bridge_id; if (bridge_update_options_.erase(std::make_pair(render_view_id, bridge_id))) @@ -190,7 +190,7 @@ void GeolocationDispatcherHostImpl::OnStopUpdating( void GeolocationDispatcherHostImpl::OnSuspend( int render_view_id, int bridge_id) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DLOG(INFO) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" << render_view_id << ":" << bridge_id; // TODO(bulach): connect this with GeolocationArbitrator. @@ -198,14 +198,14 @@ void GeolocationDispatcherHostImpl::OnSuspend( void GeolocationDispatcherHostImpl::OnResume( int render_view_id, int bridge_id) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DLOG(INFO) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" << render_view_id << ":" << bridge_id; // TODO(bulach): connect this with GeolocationArbitrator. } void GeolocationDispatcherHostImpl::RefreshGeolocationObserverOptions() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (bridge_update_options_.empty()) { if (location_provider_) { location_provider_->RemoveObserver(this); diff --git a/chrome/browser/geolocation/geolocation_exceptions_table_model_unittest.cc b/chrome/browser/geolocation/geolocation_exceptions_table_model_unittest.cc index 66d1168..207ceb7 100644 --- a/chrome/browser/geolocation/geolocation_exceptions_table_model_unittest.cc +++ b/chrome/browser/geolocation/geolocation_exceptions_table_model_unittest.cc @@ -20,7 +20,7 @@ const GURL kUrl2("http://www.example2.com"); class GeolocationExceptionsTableModelTest : public RenderViewHostTestHarness { public: GeolocationExceptionsTableModelTest() - : ui_thread_(ChromeThread::UI, MessageLoop::current()) {} + : ui_thread_(BrowserThread::UI, MessageLoop::current()) {} virtual ~GeolocationExceptionsTableModelTest() {} @@ -50,7 +50,7 @@ class GeolocationExceptionsTableModelTest : public RenderViewHostTestHarness { } protected: - ChromeThread ui_thread_; + BrowserThread ui_thread_; scoped_ptr<GeolocationExceptionsTableModel> model_; }; diff --git a/chrome/browser/geolocation/geolocation_permission_context.cc b/chrome/browser/geolocation/geolocation_permission_context.cc index dd63132..43bf1b9 100644 --- a/chrome/browser/geolocation/geolocation_permission_context.cc +++ b/chrome/browser/geolocation/geolocation_permission_context.cc @@ -247,7 +247,7 @@ void GeolocationInfoBarQueueController::CancelInfoBarRequest( void GeolocationInfoBarQueueController::OnInfoBarClosed( int render_process_id, int render_view_id, int bridge_id) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); for (PendingInfoBarRequests::iterator i = pending_infobar_requests_.begin(); i != pending_infobar_requests_.end(); ++i) { if (i->Equals(render_process_id, render_view_id, bridge_id)) { @@ -261,7 +261,7 @@ void GeolocationInfoBarQueueController::OnInfoBarClosed( void GeolocationInfoBarQueueController::OnPermissionSet( int render_process_id, int render_view_id, int bridge_id, const GURL& requesting_frame, const GURL& embedder, bool allowed) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // Persist the permission. ContentSetting content_setting = allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; @@ -350,15 +350,15 @@ GeolocationPermissionContext::~GeolocationPermissionContext() { void GeolocationPermissionContext::RequestGeolocationPermission( int render_process_id, int render_view_id, int bridge_id, const GURL& requesting_frame) { - if (!ChromeThread::CurrentlyOn(ChromeThread::UI)) { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &GeolocationPermissionContext::RequestGeolocationPermission, render_process_id, render_view_id, bridge_id, requesting_frame)); return; } - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); ExtensionsService* extensions = profile_->GetExtensionsService(); if (extensions) { @@ -423,7 +423,7 @@ void GeolocationPermissionContext::CancelGeolocationPermissionRequest( void GeolocationPermissionContext::StartUpdatingRequested( int render_process_id, int render_view_id, int bridge_id, const GURL& requesting_frame) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); // Note we cannot store the arbitrator as a member as it is not thread safe. GeolocationProvider* provider = GeolocationProvider::GetInstance(); @@ -446,7 +446,7 @@ void GeolocationPermissionContext::StopUpdatingRequested( void GeolocationPermissionContext::NotifyPermissionSet( int render_process_id, int render_view_id, int bridge_id, const GURL& requesting_frame, bool allowed) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); TabContents* tab_contents = tab_util::GetTabContentsByID(render_process_id, render_view_id); @@ -465,8 +465,8 @@ void GeolocationPermissionContext::NotifyPermissionSet( new ViewMsg_Geolocation_PermissionSet(render_view_id, bridge_id, allowed)); if (allowed) { - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableMethod(this, &GeolocationPermissionContext::NotifyArbitratorPermissionGranted, requesting_frame)); @@ -475,21 +475,21 @@ void GeolocationPermissionContext::NotifyPermissionSet( void GeolocationPermissionContext::NotifyArbitratorPermissionGranted( const GURL& requesting_frame) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); GeolocationProvider::GetInstance()->OnPermissionGranted(requesting_frame); } void GeolocationPermissionContext::CancelPendingInfoBarRequest( int render_process_id, int render_view_id, int bridge_id) { - if (!ChromeThread::CurrentlyOn(ChromeThread::UI)) { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &GeolocationPermissionContext::CancelPendingInfoBarRequest, render_process_id, render_view_id, bridge_id)); return; } - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); geolocation_infobar_queue_controller_->CancelInfoBarRequest( render_process_id, render_view_id, bridge_id); } diff --git a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc index 29c1cb3..b5200b4 100644 --- a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc +++ b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc @@ -56,7 +56,7 @@ class GeolocationPermissionContextTests : public RenderViewHostTestHarness { public: GeolocationPermissionContextTests() : RenderViewHostTestHarness(), - ui_thread_(ChromeThread::UI, MessageLoop::current()), + ui_thread_(BrowserThread::UI, MessageLoop::current()), tab_contents_with_pending_infobar_(NULL) { } @@ -150,7 +150,7 @@ class GeolocationPermissionContextTests : public RenderViewHostTestHarness { } protected: - ChromeThread ui_thread_; + BrowserThread ui_thread_; TestTabContentsWithPendingInfoBar* tab_contents_with_pending_infobar_; scoped_refptr<GeolocationPermissionContext> geolocation_permission_context_; ScopedVector<TestTabContentsWithPendingInfoBar> extra_tabs_; diff --git a/chrome/browser/geolocation/geolocation_settings_state_unittest.cc b/chrome/browser/geolocation/geolocation_settings_state_unittest.cc index 157c9b1..3c1fd0a 100644 --- a/chrome/browser/geolocation/geolocation_settings_state_unittest.cc +++ b/chrome/browser/geolocation/geolocation_settings_state_unittest.cc @@ -15,12 +15,12 @@ namespace { class GeolocationSettingsStateTests : public testing::Test { public: GeolocationSettingsStateTests() - : ui_thread_(ChromeThread::UI, &message_loop_) { + : ui_thread_(BrowserThread::UI, &message_loop_) { } protected: MessageLoop message_loop_; - ChromeThread ui_thread_; + BrowserThread ui_thread_; }; TEST_F(GeolocationSettingsStateTests, ClearOnNewOrigin) { diff --git a/chrome/browser/geolocation/gps_location_provider_unittest_linux.cc b/chrome/browser/geolocation/gps_location_provider_unittest_linux.cc index 917c9c7..ab5089a 100644 --- a/chrome/browser/geolocation/gps_location_provider_unittest_linux.cc +++ b/chrome/browser/geolocation/gps_location_provider_unittest_linux.cc @@ -67,7 +67,7 @@ class GeolocationGpsProviderLinuxTests : public testing::Test { protected: MessageLoop message_loop_; - ChromeThread ui_thread_; + BrowserThread ui_thread_; LocaionProviderListenerLoopQuitter location_listener_; scoped_ptr<GpsLocationProviderLinux> provider_; }; @@ -129,7 +129,7 @@ MockLibGps::~MockLibGps() { } GeolocationGpsProviderLinuxTests::GeolocationGpsProviderLinuxTests() - : ui_thread_(ChromeThread::IO, &message_loop_), + : ui_thread_(BrowserThread::IO, &message_loop_), provider_(new GpsLocationProviderLinux(NewMockLibGps)) { provider_->RegisterListener(&location_listener_); } diff --git a/chrome/browser/google/google_update.cc b/chrome/browser/google/google_update.cc index ee7547d..b46afc6 100644 --- a/chrome/browser/google/google_update.cc +++ b/chrome/browser/google/google_update.cc @@ -212,8 +212,8 @@ GoogleUpdate::~GoogleUpdate() { void GoogleUpdate::CheckForUpdate(bool install_if_newer, Window* window) { // We need to shunt this request over to InitiateGoogleUpdateCheck and have // it run in the file thread. - ChromeThread::PostTask( - ChromeThread::FILE, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::FILE, FROM_HERE, NewRunnableMethod( this, &GoogleUpdate::InitiateGoogleUpdateCheck, install_if_newer, window, MessageLoop::current())); diff --git a/chrome/browser/google/google_url_tracker_unittest.cc b/chrome/browser/google/google_url_tracker_unittest.cc index 08ec605..937c909 100644 --- a/chrome/browser/google/google_url_tracker_unittest.cc +++ b/chrome/browser/google/google_url_tracker_unittest.cc @@ -79,7 +79,7 @@ class GoogleURLTrackerTest : public testing::Test { original_default_request_context_ = Profile::GetDefaultRequestContext(); Profile::set_default_request_context(NULL); message_loop_ = new MessageLoop(MessageLoop::TYPE_IO); - io_thread_ = new ChromeThread(ChromeThread::IO, message_loop_); + io_thread_ = new BrowserThread(BrowserThread::IO, message_loop_); network_change_notifier_.reset(net::NetworkChangeNotifier::CreateMock()); testing_profile_.reset(new TestingProfile); TestingBrowserProcess* testing_browser_process = @@ -228,7 +228,7 @@ class GoogleURLTrackerTest : public testing::Test { private: MessageLoop* message_loop_; - ChromeThread* io_thread_; + BrowserThread* io_thread_; scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; scoped_ptr<TestingProfile> testing_profile_; diff --git a/chrome/browser/gtk/bookmark_bar_gtk_unittest.cc b/chrome/browser/gtk/bookmark_bar_gtk_unittest.cc index c74aac8cf..ccddaf5 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk_unittest.cc +++ b/chrome/browser/gtk/bookmark_bar_gtk_unittest.cc @@ -25,8 +25,8 @@ class EmptyTabstripOriginProvider : public TabstripOriginProvider { class BookmarkBarGtkUnittest : public ::testing::Test { protected: BookmarkBarGtkUnittest() - : ui_thread_(ChromeThread::UI, &message_loop_), - file_thread_(ChromeThread::FILE, &message_loop_) { + : ui_thread_(BrowserThread::UI, &message_loop_), + file_thread_(BrowserThread::FILE, &message_loop_) { } virtual void SetUp() { @@ -49,8 +49,8 @@ class BookmarkBarGtkUnittest : public ::testing::Test { } MessageLoopForUI message_loop_; - ChromeThread ui_thread_; - ChromeThread file_thread_; + BrowserThread ui_thread_; + BrowserThread file_thread_; scoped_ptr<TestingProfile> profile_; scoped_ptr<Browser> browser_; diff --git a/chrome/browser/gtk/bookmark_editor_gtk_unittest.cc b/chrome/browser/gtk/bookmark_editor_gtk_unittest.cc index 291f66f..992dca0 100644 --- a/chrome/browser/gtk/bookmark_editor_gtk_unittest.cc +++ b/chrome/browser/gtk/bookmark_editor_gtk_unittest.cc @@ -28,8 +28,8 @@ using bookmark_utils::GetTitleFromTreeIter; class BookmarkEditorGtkTest : public testing::Test { public: BookmarkEditorGtkTest() - : ui_thread_(ChromeThread::UI, &message_loop_), - file_thread_(ChromeThread::FILE, &message_loop_), + : ui_thread_(BrowserThread::UI, &message_loop_), + file_thread_(BrowserThread::FILE, &message_loop_), model_(NULL) { } @@ -49,8 +49,8 @@ class BookmarkEditorGtkTest : public testing::Test { protected: MessageLoopForUI message_loop_; - ChromeThread ui_thread_; - ChromeThread file_thread_; + BrowserThread ui_thread_; + BrowserThread file_thread_; BookmarkModel* model_; scoped_ptr<TestingProfile> profile_; diff --git a/chrome/browser/gtk/certificate_dialogs.cc b/chrome/browser/gtk/certificate_dialogs.cc index 82a312ec..8103f65 100644 --- a/chrome/browser/gtk/certificate_dialogs.cc +++ b/chrome/browser/gtk/certificate_dialogs.cc @@ -44,8 +44,8 @@ class Writer : public Task { }; void WriteFileOnFileThread(const FilePath& path, const std::string& data) { - ChromeThread::PostTask( - ChromeThread::FILE, FROM_HERE, new Writer(path, data)); + BrowserThread::PostTask( + BrowserThread::FILE, FROM_HERE, new Writer(path, data)); } std::string WrapAt64(const std::string &str) { diff --git a/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc index bc4fc83..137b8ea 100644 --- a/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc +++ b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc @@ -42,7 +42,7 @@ CreateApplicationShortcutsDialogGtk::CreateApplicationShortcutsDialogGtk( TabContents* tab_contents) : tab_contents_(tab_contents), error_dialog_(NULL) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // Will be balanced by Release later. AddRef(); @@ -148,7 +148,7 @@ CreateApplicationShortcutsDialogGtk::CreateApplicationShortcutsDialogGtk( } CreateApplicationShortcutsDialogGtk::~CreateApplicationShortcutsDialogGtk() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); gtk_widget_destroy(create_dialog_); @@ -160,14 +160,14 @@ CreateApplicationShortcutsDialogGtk::~CreateApplicationShortcutsDialogGtk() { void CreateApplicationShortcutsDialogGtk::OnCreateDialogResponse( GtkWidget* widget, int response) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (response == GTK_RESPONSE_ACCEPT) { shortcut_info_.create_on_desktop = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(desktop_checkbox_)); shortcut_info_.create_in_applications_menu = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(menu_checkbox_)); - ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE, + BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, NewRunnableMethod(this, &CreateApplicationShortcutsDialogGtk::CreateDesktopShortcut, shortcut_info_)); @@ -186,7 +186,7 @@ void CreateApplicationShortcutsDialogGtk::OnErrorDialogResponse( void CreateApplicationShortcutsDialogGtk::CreateDesktopShortcut( const ShellIntegration::ShortcutInfo& shortcut_info) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); scoped_ptr<base::Environment> env(base::Environment::Create()); @@ -197,14 +197,14 @@ void CreateApplicationShortcutsDialogGtk::CreateDesktopShortcut( shortcut_template); Release(); } else { - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &CreateApplicationShortcutsDialogGtk::ShowErrorDialog)); } } void CreateApplicationShortcutsDialogGtk::ShowErrorDialog() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // Hide the create dialog so that the user can no longer interact with it. gtk_widget_hide(create_dialog_); diff --git a/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h index d0d39dc..f45e152 100644 --- a/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h +++ b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h @@ -21,7 +21,7 @@ class TabContents; class CreateApplicationShortcutsDialogGtk : public base::RefCountedThreadSafe<CreateApplicationShortcutsDialogGtk, - ChromeThread::DeleteOnUIThread> { + BrowserThread::DeleteOnUIThread> { public: // Displays the dialog box to create application shortcuts for |tab_contents|. static void Show(GtkWindow* parent, TabContents* tab_contents); diff --git a/chrome/browser/gtk/dialogs_gtk.cc b/chrome/browser/gtk/dialogs_gtk.cc index e5aebbf..48a6820 100644 --- a/chrome/browser/gtk/dialogs_gtk.cc +++ b/chrome/browser/gtk/dialogs_gtk.cc @@ -152,8 +152,8 @@ FilePath* SelectFileDialogImpl::last_opened_path_ = NULL; // static SelectFileDialog* SelectFileDialog::Create(Listener* listener) { - DCHECK(!ChromeThread::CurrentlyOn(ChromeThread::IO)); - DCHECK(!ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::FILE)); return new SelectFileDialogImpl(listener); } diff --git a/chrome/browser/gtk/options/content_exceptions_window_gtk_unittest.cc b/chrome/browser/gtk/options/content_exceptions_window_gtk_unittest.cc index ecfbaba..764e991 100644 --- a/chrome/browser/gtk/options/content_exceptions_window_gtk_unittest.cc +++ b/chrome/browser/gtk/options/content_exceptions_window_gtk_unittest.cc @@ -13,7 +13,7 @@ using ::testing::ElementsAre; class ContentExceptionsWindowGtkUnittest : public testing::Test { public: ContentExceptionsWindowGtkUnittest() - : ui_thread_(ChromeThread::UI, &message_loop_), + : ui_thread_(BrowserThread::UI, &message_loop_), host_content_settings_map_(profile_.GetHostContentSettingsMap()), window_(NULL) { } @@ -112,7 +112,7 @@ class ContentExceptionsWindowGtkUnittest : public testing::Test { private: MessageLoop message_loop_; - ChromeThread ui_thread_; + BrowserThread ui_thread_; TestingProfile profile_; HostContentSettingsMap* host_content_settings_map_; diff --git a/chrome/browser/gtk/options/cookies_view_unittest.cc b/chrome/browser/gtk/options/cookies_view_unittest.cc index 2a71eea6..76461a1 100644 --- a/chrome/browser/gtk/options/cookies_view_unittest.cc +++ b/chrome/browser/gtk/options/cookies_view_unittest.cc @@ -22,7 +22,7 @@ class CookiesViewTest : public testing::Test { public: - CookiesViewTest() : io_thread_(ChromeThread::IO, &message_loop_) { + CookiesViewTest() : io_thread_(BrowserThread::IO, &message_loop_) { } virtual ~CookiesViewTest() { @@ -198,7 +198,7 @@ class CookiesViewTest : public testing::Test { protected: MessageLoop message_loop_; - ChromeThread io_thread_; + BrowserThread io_thread_; scoped_ptr<TestingProfile> profile_; scoped_refptr<MockBrowsingDataDatabaseHelper> diff --git a/chrome/browser/gtk/repost_form_warning_gtk.cc b/chrome/browser/gtk/repost_form_warning_gtk.cc index a53aef4..bf2b2fc 100644 --- a/chrome/browser/gtk/repost_form_warning_gtk.cc +++ b/chrome/browser/gtk/repost_form_warning_gtk.cc @@ -82,7 +82,7 @@ void RepostFormWarningGtk::OnCancel(GtkWidget* widget) { void RepostFormWarningGtk::OnHierarchyChanged(GtkWidget* root, GtkWidget* previous_toplevel) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel(cancel_))) { return; } diff --git a/chrome/browser/history/history.cc b/chrome/browser/history/history.cc index 6fb9c15..db4ebf8 100644 --- a/chrome/browser/history/history.cc +++ b/chrome/browser/history/history.cc @@ -117,7 +117,7 @@ class HistoryService::BackendDelegate : public HistoryBackend::Delegate { // static const history::StarID HistoryService::kBookmarkBarID = 1; -// The history thread is intentionally not a ChromeThread because the +// The history thread is intentionally not a BrowserThread because the // sync integration unit tests depend on being able to create more than one // history thread. HistoryService::HistoryService() diff --git a/chrome/browser/history/history_browsertest.cc b/chrome/browser/history/history_browsertest.cc index 0d9e1e2..b35e727 100644 --- a/chrome/browser/history/history_browsertest.cc +++ b/chrome/browser/history/history_browsertest.cc @@ -49,8 +49,8 @@ class HistoryEnumerator : public HistoryService::URLEnumerator { if (!history) return; - ChromeThread::PostTask( - ChromeThread::UI, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(history, &HistoryService::IterateURLs, this)); ui_test_utils::RunMessageLoop(); @@ -61,8 +61,8 @@ class HistoryEnumerator : public HistoryService::URLEnumerator { } virtual void OnComplete(bool success) { - ChromeThread::PostTask( - ChromeThread::UI, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, new MessageLoop::QuitTask()); } @@ -104,12 +104,12 @@ class HistoryBrowserTest : public InProcessBrowserTest { CancelableRequestConsumerTSimple<int> request_consumer; scoped_refptr<HistoryDBTask> task(new WaitForHistoryTask()); HistoryService* history = GetHistoryService(); - ChromeThread::PostTask(ChromeThread::UI, - FROM_HERE, - NewRunnableMethod(history, - &HistoryService::ScheduleDBTask, - task.get(), - &request_consumer)); + BrowserThread::PostTask(BrowserThread::UI, + FROM_HERE, + NewRunnableMethod(history, + &HistoryService::ScheduleDBTask, + task.get(), + &request_consumer)); ui_test_utils::RunMessageLoop(); } diff --git a/chrome/browser/history/top_sites.cc b/chrome/browser/history/top_sites.cc index c9f4a94..52946f3 100644 --- a/chrome/browser/history/top_sites.cc +++ b/chrome/browser/history/top_sites.cc @@ -85,7 +85,7 @@ void TopSites::Init(const FilePath& db_name) { return; } - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, NewRunnableMethod( + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, NewRunnableMethod( this, &TopSites::ReadDatabase)); // Start the one-shot timer. @@ -94,7 +94,7 @@ void TopSites::Init(const FilePath& db_name) { } void TopSites::ReadDatabase() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); std::map<GURL, Images> thumbnails; DCHECK(db_.get()); @@ -169,7 +169,7 @@ bool TopSites::SetPageThumbnailEncoded(const GURL& url, size_t index = found->second; MostVisitedURL& most_visited = top_sites_[index]; - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, NewRunnableMethod( + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, NewRunnableMethod( this, &TopSites::WriteThumbnailToDB, most_visited, index, top_images_[most_visited.url])); return true; @@ -179,7 +179,7 @@ void TopSites::WriteThumbnailToDB(const MostVisitedURL& url, int url_rank, const Images& thumbnail) { DCHECK(db_.get()); - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); db_->SetPageThumbnail(url, url_rank, thumbnail); } @@ -389,7 +389,7 @@ std::string TopSites::GetURLHash(const GURL& url) { } void TopSites::UpdateMostVisited(MostVisitedURLList most_visited) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); std::vector<size_t> added; // Indices into most_visited. std::vector<size_t> deleted; // Indices into top_sites_. @@ -518,7 +518,7 @@ void TopSites::GenerateCanonicalURLs() { } void TopSites::StoreMostVisited(MostVisitedURLList* most_visited) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); MostVisitedURLList filtered_urls; PendingCallbackSet callbacks; { @@ -750,11 +750,11 @@ bool TopSites::GetPinnedURLAtIndex(size_t index, GURL* url) { void TopSites::DeleteTopSites(scoped_refptr<TopSites>& ptr) { if (!ptr.get() || !MessageLoop::current()) return; - if (ChromeThread::IsWellKnownThread(ChromeThread::UI)) { + if (BrowserThread::IsWellKnownThread(BrowserThread::UI)) { ptr = NULL; } else { // Need to roll our own UI thread. - ChromeThread ui_loop(ChromeThread::UI, MessageLoop::current()); + BrowserThread ui_loop(BrowserThread::UI, MessageLoop::current()); ptr = NULL; MessageLoop::current()->RunAllPending(); } @@ -779,7 +779,7 @@ void TopSites::OnTopSitesAvailable( CancelableRequestProvider::Handle handle, MostVisitedURLList pages) { AddPrepopulatedPages(&pages); - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, NewRunnableMethod( + BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, NewRunnableMethod( this, &TopSites::UpdateMostVisited, pages)); } @@ -838,8 +838,9 @@ void TopSites::Observe(NotificationType type, Details<history::URLsDeletedDetails> deleted_details(details); if (deleted_details->all_history) { top_sites_.clear(); - ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, - NewRunnableMethod(this, &TopSites::ResetDatabase)); + BrowserThread::PostTask( + BrowserThread::DB, FROM_HERE, + NewRunnableMethod(this, &TopSites::ResetDatabase)); } else { std::set<size_t> indices_to_delete; // Indices into top_sites_. std::set<GURL>::iterator it; @@ -884,7 +885,7 @@ void TopSites::Observe(NotificationType type, } void TopSites::ResetDatabase() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); db_.reset(new TopSitesDatabaseImpl()); file_util::Delete(db_path_, false); if (!db_->Init(db_path_)) { diff --git a/chrome/browser/history/top_sites.h b/chrome/browser/history/top_sites.h index c491066..bf110a8 100644 --- a/chrome/browser/history/top_sites.h +++ b/chrome/browser/history/top_sites.h @@ -50,7 +50,7 @@ typedef std::vector<MostVisitedURL> MostVisitedURLList; // the UI thread is busy. class TopSites : public base::RefCountedThreadSafe<TopSites, - ChromeThread::DeleteOnUIThread>, + BrowserThread::DeleteOnUIThread>, public NotificationObserver, public CancelableRequestProvider { public: @@ -142,7 +142,7 @@ class TopSites : void ClearProfile(); private: - friend struct ChromeThread::DeleteOnThread<ChromeThread::UI>; + friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>; friend class DeleteTask<TopSites>; friend class TopSitesTest; FRIEND_TEST_ALL_PREFIXES(TopSitesTest, GetMostVisited); diff --git a/chrome/browser/history/top_sites_unittest.cc b/chrome/browser/history/top_sites_unittest.cc index c327647..24bb4a2 100644 --- a/chrome/browser/history/top_sites_unittest.cc +++ b/chrome/browser/history/top_sites_unittest.cc @@ -301,7 +301,7 @@ static void AppendMostVisitedURLWithRedirect( } TEST_F(TopSitesTest, GetCanonicalURL) { - ChromeThread db_loop(ChromeThread::DB, MessageLoop::current()); + BrowserThread db_loop(BrowserThread::DB, MessageLoop::current()); // Have two chains: // google.com -> www.google.com // news.google.com (no redirects) @@ -368,7 +368,7 @@ TEST_F(TopSitesTest, DiffMostVisited) { } TEST_F(TopSitesTest, SetPageThumbnail) { - ChromeThread db_loop(ChromeThread::DB, MessageLoop::current()); + BrowserThread db_loop(BrowserThread::DB, MessageLoop::current()); GURL url1a("http://google.com/"); GURL url1b("http://www.google.com/"); GURL url2("http://images.google.com/"); @@ -416,7 +416,7 @@ TEST_F(TopSitesTest, SetPageThumbnail) { } TEST_F(TopSitesTest, GetPageThumbnail) { - ChromeThread db_loop(ChromeThread::DB, MessageLoop::current()); + BrowserThread db_loop(BrowserThread::DB, MessageLoop::current()); MostVisitedURLList url_list; MostVisitedURL url1 = {GURL("http://asdf.com")}; url1.redirects.push_back(url1.url); @@ -460,7 +460,7 @@ TEST_F(TopSitesTest, GetPageThumbnail) { } TEST_F(TopSitesTest, GetMostVisited) { - ChromeThread db_loop(ChromeThread::DB, MessageLoop::current()); + BrowserThread db_loop(BrowserThread::DB, MessageLoop::current()); GURL news("http://news.google.com/"); GURL google("http://google.com/"); @@ -484,7 +484,7 @@ TEST_F(TopSitesTest, GetMostVisited) { } TEST_F(TopSitesTest, MockDatabase) { - ChromeThread db_loop(ChromeThread::DB, MessageLoop::current()); + BrowserThread db_loop(BrowserThread::DB, MessageLoop::current()); MockTopSitesDatabaseImpl* db = new MockTopSitesDatabaseImpl; // |db| is destroyed when the top_sites is destroyed in TearDown. top_sites().db_.reset(db); @@ -639,7 +639,7 @@ TEST_F(TopSitesTest, TopSitesDB) { // Test TopSites with a real database. TEST_F(TopSitesTest, RealDatabase) { - ChromeThread db_loop(ChromeThread::DB, MessageLoop::current()); + BrowserThread db_loop(BrowserThread::DB, MessageLoop::current()); TopSitesDatabaseImpl* db = new TopSitesDatabaseImpl; ASSERT_TRUE(db->Init(file_name())); @@ -781,7 +781,7 @@ TEST_F(TopSitesTest, RealDatabase) { } TEST_F(TopSitesTest, DeleteNotifications) { - ChromeThread db_loop(ChromeThread::DB, MessageLoop::current()); + BrowserThread db_loop(BrowserThread::DB, MessageLoop::current()); GURL google1_url("http://google.com"); GURL google2_url("http://google.com/redirect"); GURL google3_url("http://www.google.com"); @@ -843,7 +843,7 @@ TEST_F(TopSitesTest, DeleteNotifications) { } TEST_F(TopSitesTest, PinnedURLsDeleted) { - ChromeThread db_loop(ChromeThread::DB, MessageLoop::current()); + BrowserThread db_loop(BrowserThread::DB, MessageLoop::current()); GURL google1_url("http://google.com"); GURL google2_url("http://google.com/redirect"); GURL google3_url("http://www.google.com"); @@ -932,7 +932,7 @@ TEST_F(TopSitesTest, GetUpdateDelay) { } TEST_F(TopSitesTest, Migration) { - ChromeThread db_loop(ChromeThread::DB, MessageLoop::current()); + BrowserThread db_loop(BrowserThread::DB, MessageLoop::current()); GURL google1_url("http://google.com"); string16 google_title(ASCIIToUTF16("Google")); GURL news_url("http://news.google.com"); @@ -955,7 +955,7 @@ TEST_F(TopSitesTest, Migration) { } TEST_F(TopSitesTest, QueueingRequestsForTopSites) { - ChromeThread db_loop(ChromeThread::DB, MessageLoop::current()); + BrowserThread db_loop(BrowserThread::DB, MessageLoop::current()); CancelableRequestConsumer c1; CancelableRequestConsumer c2; CancelableRequestConsumer c3; @@ -1020,7 +1020,7 @@ TEST_F(TopSitesTest, QueueingRequestsForTopSites) { } TEST_F(TopSitesTest, CancelingRequestsForTopSites) { - ChromeThread db_loop(ChromeThread::DB, MessageLoop::current()); + BrowserThread db_loop(BrowserThread::DB, MessageLoop::current()); CancelableRequestConsumer c1; CancelableRequestConsumer c2; top_sites().GetMostVisitedURLs( @@ -1067,7 +1067,7 @@ TEST_F(TopSitesTest, CancelingRequestsForTopSites) { } TEST_F(TopSitesTest, AddTemporaryThumbnail) { - ChromeThread db_loop(ChromeThread::DB, MessageLoop::current()); + BrowserThread db_loop(BrowserThread::DB, MessageLoop::current()); GURL unknown_url("http://news.google.com/"); GURL invalid_url("chrome://thumb/http://google.com/"); GURL url1a("http://google.com/"); @@ -1110,7 +1110,7 @@ TEST_F(TopSitesTest, AddTemporaryThumbnail) { } TEST_F(TopSitesTest, Blacklisting) { - ChromeThread db_loop(ChromeThread::DB, MessageLoop::current()); + BrowserThread db_loop(BrowserThread::DB, MessageLoop::current()); MostVisitedURLList pages; MostVisitedURL url, url1; url.url = GURL("http://bbc.com/"); @@ -1204,7 +1204,7 @@ TEST_F(TopSitesTest, Blacklisting) { } TEST_F(TopSitesTest, PinnedURLs) { - ChromeThread db_loop(ChromeThread::DB, MessageLoop::current()); + BrowserThread db_loop(BrowserThread::DB, MessageLoop::current()); MostVisitedURLList pages; MostVisitedURL url, url1; url.url = GURL("http://bbc.com/"); @@ -1289,7 +1289,7 @@ TEST_F(TopSitesTest, PinnedURLs) { } TEST_F(TopSitesTest, BlacklistingAndPinnedURLs) { - ChromeThread db_loop(ChromeThread::DB, MessageLoop::current()); + BrowserThread db_loop(BrowserThread::DB, MessageLoop::current()); MostVisitedURLList pages; CancelableRequestConsumer c; top_sites().GetMostVisitedURLs( diff --git a/chrome/browser/importer/firefox3_importer.cc b/chrome/browser/importer/firefox3_importer.cc index 110f2b6..93bba8f 100644 --- a/chrome/browser/importer/firefox3_importer.cc +++ b/chrome/browser/importer/firefox3_importer.cc @@ -37,7 +37,7 @@ using webkit_glue::PasswordForm; Firefox3Importer::Firefox3Importer() { #if defined(OS_LINUX) - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); locale_ = g_browser_process->GetApplicationLocale(); #endif } @@ -49,7 +49,7 @@ void Firefox3Importer::StartImport(importer::ProfileInfo profile_info, uint16 items, ImporterBridge* bridge) { #if defined(OS_LINUX) - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); #endif bridge_ = bridge; source_path_ = profile_info.source_path; diff --git a/chrome/browser/importer/importer.cc b/chrome/browser/importer/importer.cc index 88f4491..7766c12 100644 --- a/chrome/browser/importer/importer.cc +++ b/chrome/browser/importer/importer.cc @@ -233,7 +233,7 @@ void ImporterHost::InvokeTaskIfDone() { if (waiting_for_bookmarkbar_model_ || !registrar_.IsEmpty() || !is_source_readable_) return; - ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE, task_); + BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, task_); } void ImporterHost::ImportItemStarted(importer::ImportItem item) { @@ -396,10 +396,10 @@ ExternalProcessImporterClient::~ExternalProcessImporterClient() { void ExternalProcessImporterClient::Start() { AddRef(); // balanced in Cleanup. - ChromeThread::ID thread_id; - CHECK(ChromeThread::GetCurrentThreadIdentifier(&thread_id)); - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + BrowserThread::ID thread_id; + CHECK(BrowserThread::GetCurrentThreadIdentifier(&thread_id)); + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableMethod(this, &ExternalProcessImporterClient::StartProcessOnIOThread, g_browser_process->resource_dispatcher_host(), thread_id)); @@ -407,7 +407,7 @@ void ExternalProcessImporterClient::Start() { void ExternalProcessImporterClient::StartProcessOnIOThread( ResourceDispatcherHost* rdh, - ChromeThread::ID thread_id) { + BrowserThread::ID thread_id) { profile_import_process_host_ = new ProfileImportProcessHost(rdh, this, thread_id); profile_import_process_host_->StartProfileImportProcess(profile_info_, @@ -420,8 +420,8 @@ void ExternalProcessImporterClient::Cancel() { cancelled_ = true; if (profile_import_process_host_) { - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableMethod(this, &ExternalProcessImporterClient::CancelImportProcessOnIOThread)); } @@ -484,8 +484,8 @@ void ExternalProcessImporterClient::OnImportItemFinished(int item_data) { importer::ImportItem import_item = static_cast<importer::ImportItem>(item_data); bridge_->NotifyItemEnded(import_item); - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableMethod(this, &ExternalProcessImporterClient::NotifyItemFinishedOnIOThread, import_item)); diff --git a/chrome/browser/importer/importer.h b/chrome/browser/importer/importer.h index 14be8c2..4887138 100644 --- a/chrome/browser/importer/importer.h +++ b/chrome/browser/importer/importer.h @@ -315,7 +315,7 @@ class ExternalProcessImporterClient // Creates a new ProfileImportProcessHost, which launches the import process. virtual void StartProcessOnIOThread(ResourceDispatcherHost* rdh, - ChromeThread::ID thread_id); + BrowserThread::ID thread_id); // Called by the ExternalProcessImporterHost on import cancel. virtual void Cancel(); diff --git a/chrome/browser/importer/importer_bridge.cc b/chrome/browser/importer/importer_bridge.cc index 3a95080..0a6d4a5 100644 --- a/chrome/browser/importer/importer_bridge.cc +++ b/chrome/browser/importer/importer_bridge.cc @@ -34,24 +34,24 @@ void InProcessImporterBridge::AddBookmarkEntries( const std::vector<ProfileWriter::BookmarkEntry>& bookmarks, const std::wstring& first_folder_name, int options) { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod( writer_, &ProfileWriter::AddBookmarkEntry, bookmarks, first_folder_name, options)); } void InProcessImporterBridge::AddHomePage(const GURL &home_page) { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(writer_, &ProfileWriter::AddHomepage, home_page)); } #if defined(OS_WIN) void InProcessImporterBridge::AddIE7PasswordInfo( const IE7PasswordInfo password_info) { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(writer_, &ProfileWriter::AddIE7PasswordInfo, password_info)); } @@ -59,16 +59,16 @@ void InProcessImporterBridge::AddIE7PasswordInfo( void InProcessImporterBridge::SetFavIcons( const std::vector<history::ImportedFavIconUsage>& fav_icons) { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(writer_, &ProfileWriter::AddFavicons, fav_icons)); } void InProcessImporterBridge::SetHistoryItems( const std::vector<history::URLRow> &rows, history::VisitSource visit_source) { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(writer_, &ProfileWriter::AddHistoryPage, rows, visit_source)); } @@ -77,8 +77,8 @@ void InProcessImporterBridge::SetKeywords( const std::vector<TemplateURL*>& template_urls, int default_keyword_index, bool unique_on_host_and_path) { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod( writer_, &ProfileWriter::AddKeywords, template_urls, default_keyword_index, unique_on_host_and_path)); @@ -87,32 +87,32 @@ void InProcessImporterBridge::SetKeywords( void InProcessImporterBridge::SetPasswordForm( const webkit_glue::PasswordForm& form) { LOG(ERROR) << "IPImporterBridge::SetPasswordForm"; - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(writer_, &ProfileWriter::AddPasswordForm, form)); } void InProcessImporterBridge::NotifyItemStarted(importer::ImportItem item) { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(host_, &ImporterHost::ImportItemStarted, item)); } void InProcessImporterBridge::NotifyItemEnded(importer::ImportItem item) { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(host_, &ImporterHost::ImportItemEnded, item)); } void InProcessImporterBridge::NotifyStarted() { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(host_, &ImporterHost::ImportStarted)); } void InProcessImporterBridge::NotifyEnded() { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(host_, &ImporterHost::ImportEnded)); } diff --git a/chrome/browser/importer/importer_unittest.cc b/chrome/browser/importer/importer_unittest.cc index 879d7cb..cdc4693 100644 --- a/chrome/browser/importer/importer_unittest.cc +++ b/chrome/browser/importer/importer_unittest.cc @@ -63,8 +63,8 @@ using webkit_glue::PasswordForm; class ImporterTest : public testing::Test { public: ImporterTest() - : ui_thread_(ChromeThread::UI, &message_loop_), - file_thread_(ChromeThread::FILE, &message_loop_) {} + : ui_thread_(BrowserThread::UI, &message_loop_), + file_thread_(BrowserThread::FILE, &message_loop_) {} protected: virtual void SetUp() { // Creates a new profile in a new subdirectory in the temp directory. @@ -127,8 +127,8 @@ class ImporterTest : public testing::Test { } MessageLoopForUI message_loop_; - ChromeThread ui_thread_; - ChromeThread file_thread_; + BrowserThread ui_thread_; + BrowserThread file_thread_; FilePath test_path_; FilePath profile_path_; FilePath app_path_; diff --git a/chrome/browser/importer/toolbar_importer.cc b/chrome/browser/importer/toolbar_importer.cc index ad9ad61..51aa1c9 100644 --- a/chrome/browser/importer/toolbar_importer.cc +++ b/chrome/browser/importer/toolbar_importer.cc @@ -123,11 +123,11 @@ void Toolbar5Importer::Cancel() { // If we are conducting network operations, post a message to the importer // thread for synchronization. - if (ChromeThread::CurrentlyOn(ChromeThread::UI)) { + if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { EndImport(); } else { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &Toolbar5Importer::Cancel)); } } |