diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-11 02:45:52 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-11 02:45:52 +0000 |
commit | f8b3ef8aab85985cb74d748112a1a3ec8e2b7ed8 (patch) | |
tree | 3bca9c7a2c36af1c29ae37e0668be3ee1849356a | |
parent | ad27b85ef15c7446744911b776a733842f8e9206 (diff) | |
download | chromium_src-f8b3ef8aab85985cb74d748112a1a3ec8e2b7ed8.zip chromium_src-f8b3ef8aab85985cb74d748112a1a3ec8e2b7ed8.tar.gz chromium_src-f8b3ef8aab85985cb74d748112a1a3ec8e2b7ed8.tar.bz2 |
Rename ChromeThread to BrowserThread Part15:
- Rename entries in more 40 files under chrome/browser.
BUG=56926
TEST=trybots
Review URL: http://codereview.chromium.org/3704001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62130 0039d316-1c4b-4281-b951-d872f2087c98
38 files changed, 236 insertions, 235 deletions
diff --git a/chrome/browser/file_path_watcher_mac.cc b/chrome/browser/file_path_watcher_mac.cc index b95992c..ddcfd41 100644 --- a/chrome/browser/file_path_watcher_mac.cc +++ b/chrome/browser/file_path_watcher_mac.cc @@ -68,7 +68,7 @@ void FSEventsCallback(ConstFSEventStreamRef stream, void* event_watcher, size_t num_events, void* event_paths, const FSEventStreamEventFlags flags[], const FSEventStreamEventId event_ids[]) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); FilePathWatcherImpl* watcher = reinterpret_cast<FilePathWatcherImpl*>(event_watcher); @@ -87,12 +87,12 @@ void FSEventsCallback(ConstFSEventStreamRef stream, if (root_changed) { // Resetting the event stream from within the callback fails (FSEvents spews // bad file descriptor errors), so post a task to do the reset. - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod(watcher, &FilePathWatcherImpl::UpdateEventStream, root_change_at)); } - ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE, + BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, NewRunnableMethod(watcher, &FilePathWatcherImpl::OnFilePathChanged)); } @@ -104,7 +104,7 @@ FilePathWatcherImpl::FilePathWatcherImpl() } void FilePathWatcherImpl::OnFilePathChanged() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); DCHECK(!target_.empty()); base::PlatformFileInfo file_info; @@ -156,7 +156,7 @@ bool FilePathWatcherImpl::Watch(const FilePath& path, first_notification_ = base::Time::Now(); } - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &FilePathWatcherImpl::UpdateEventStream, start_event)); @@ -165,8 +165,8 @@ bool FilePathWatcherImpl::Watch(const FilePath& path, void FilePathWatcherImpl::Cancel() { // Switch to the UI thread if necessary, so we can tear down the event stream. - if (!ChromeThread::CurrentlyOn(ChromeThread::UI)) { - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, + if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &FilePathWatcherImpl::Cancel)); return; } @@ -177,7 +177,7 @@ void FilePathWatcherImpl::Cancel() { } void FilePathWatcherImpl::UpdateEventStream(FSEventStreamEventId start_event) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // It can happen that the watcher gets canceled while tasks that call this // function are still in flight, so abort if this situation is detected. @@ -211,14 +211,14 @@ void FilePathWatcherImpl::UpdateEventStream(FSEventStreamEventId start_event) { FSEventStreamScheduleWithRunLoop(fsevent_stream_, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); if (!FSEventStreamStart(fsevent_stream_)) { - ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE, + BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, NewRunnableMethod(delegate_.get(), &FilePathWatcher::Delegate::OnError)); } } void FilePathWatcherImpl::DestroyEventStream() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); FSEventStreamStop(fsevent_stream_); FSEventStreamInvalidate(fsevent_stream_); FSEventStreamRelease(fsevent_stream_); diff --git a/chrome/browser/file_path_watcher_unittest.cc b/chrome/browser/file_path_watcher_unittest.cc index 82dfe99..c01a2af 100644 --- a/chrome/browser/file_path_watcher_unittest.cc +++ b/chrome/browser/file_path_watcher_unittest.cc @@ -105,13 +105,13 @@ class FilePathWatcherTest : public testing::Test { // Implementation of FilePathWatcher on Mac requires UI loop. FilePathWatcherTest() : loop_(MessageLoop::TYPE_UI), - ui_thread_(ChromeThread::UI, &loop_) { + ui_thread_(BrowserThread::UI, &loop_) { } protected: virtual void SetUp() { // Create a separate file thread in order to test proper thread usage. - file_thread_.reset(new ChromeThread(ChromeThread::FILE)); + file_thread_.reset(new BrowserThread(BrowserThread::FILE)); file_thread_->Start(); temp_dir_.reset(new ScopedTempDir); ASSERT_TRUE(temp_dir_->CreateUniqueTempDir()); @@ -139,7 +139,7 @@ class FilePathWatcherTest : public testing::Test { FilePathWatcher::Delegate* delegate) { base::WaitableEvent completion(false, false); bool result; - ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE, + BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, new SetupWatchTask(target, watcher, delegate, &result, &completion)); completion.Wait(); ASSERT_TRUE(result); @@ -168,8 +168,8 @@ class FilePathWatcherTest : public testing::Test { } MessageLoop loop_; - ChromeThread ui_thread_; - scoped_ptr<ChromeThread> file_thread_; + BrowserThread ui_thread_; + scoped_ptr<BrowserThread> file_thread_; scoped_ptr<ScopedTempDir> temp_dir_; }; @@ -281,7 +281,7 @@ TEST_F(FilePathWatcherTest, DestroyWithPendingNotification) { FilePathWatcher* watcher = new FilePathWatcher; SetupWatch(test_file(), watcher, delegate.get()); ASSERT_TRUE(WriteFile(test_file(), "content")); - ChromeThread::DeleteSoon(ChromeThread::FILE, FROM_HERE, watcher); + BrowserThread::DeleteSoon(BrowserThread::FILE, FROM_HERE, watcher); // Success if there is no crash or DCHECK when running the callback. WaitForEvents(delegate.get()); } diff --git a/chrome/browser/file_path_watcher_win.cc b/chrome/browser/file_path_watcher_win.cc index 71622f9..61879e7 100644 --- a/chrome/browser/file_path_watcher_win.cc +++ b/chrome/browser/file_path_watcher_win.cc @@ -78,8 +78,8 @@ bool FilePathWatcherImpl::Watch(const FilePath& path, void FilePathWatcherImpl::Cancel() { // Switch to the file thread if necessary so we can stop |watcher_|. - if (!ChromeThread::CurrentlyOn(ChromeThread::FILE)) { - ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE, + if (!BrowserThread::CurrentlyOn(BrowserThread::FILE)) { + BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, NewRunnableMethod(this, &FilePathWatcherImpl::Cancel)); return; } diff --git a/chrome/browser/gpu_process_host.cc b/chrome/browser/gpu_process_host.cc index c7bc4c3..4c099d8 100644 --- a/chrome/browser/gpu_process_host.cc +++ b/chrome/browser/gpu_process_host.cc @@ -148,9 +148,9 @@ void GpuProcessHost::OnMessageReceived(const IPC::Message& message) { } else { // Need to transfer this message to the UI thread and the // GpuProcessHostUIShim for dispatching via its message router. - ChromeThread::PostTask(ChromeThread::UI, - FROM_HERE, - new RouteOnUIThreadTask(message)); + BrowserThread::PostTask(BrowserThread::UI, + FROM_HERE, + new RouteOnUIThreadTask(message)); } } @@ -232,8 +232,8 @@ void GetViewXIDDispatcher(gfx::NativeViewId id, IPC::Message* reply_msg) { GpuHostMsg_GetViewXID::WriteReplyParams(reply_msg, xid); // Have to reply from IO thread. - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableFunction(&SendDelayedReply, reply_msg)); } @@ -242,8 +242,8 @@ void GetViewXIDDispatcher(gfx::NativeViewId id, IPC::Message* reply_msg) { void GpuProcessHost::OnGetViewXID(gfx::NativeViewId id, IPC::Message *reply_msg) { // Have to request a permanent overlay from UI thread. - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableFunction(&GetViewXIDDispatcher, id, reply_msg)); } @@ -282,8 +282,8 @@ class SetIOSurfaceDispatcher : public Task { void GpuProcessHost::OnAcceleratedSurfaceSetIOSurface( const GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params& params) { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, new SetIOSurfaceDispatcher(params)); } @@ -323,8 +323,8 @@ void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped( int32 renderer_id, int32 render_view_id, gfx::PluginWindowHandle window) { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, new BuffersSwappedDispatcher(renderer_id, render_view_id, window)); } #endif diff --git a/chrome/browser/gpu_process_host_ui_shim.cc b/chrome/browser/gpu_process_host_ui_shim.cc index 07ad263..3bc7004 100644 --- a/chrome/browser/gpu_process_host_ui_shim.cc +++ b/chrome/browser/gpu_process_host_ui_shim.cc @@ -44,9 +44,9 @@ int32 GpuProcessHostUIShim::NewRenderWidgetHostView( } bool GpuProcessHostUIShim::Send(IPC::Message* msg) { - ChromeThread::PostTask(ChromeThread::IO, - FROM_HERE, - new SendOnIOThreadTask(msg)); + BrowserThread::PostTask(BrowserThread::IO, + FROM_HERE, + new SendOnIOThreadTask(msg)); return true; } @@ -68,9 +68,9 @@ void GpuProcessHostUIShim::OnMessageReceived(const IPC::Message& message) { } void GpuProcessHostUIShim::CollectGraphicsInfoAsynchronously() { - DCHECK(!ChromeThread::CurrentlyOn(ChromeThread::IO)); - ChromeThread::PostTask( - ChromeThread::IO, + DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO)); + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, new SendOnIOThreadTask(new GpuMsg_CollectGraphicsInfo())); } diff --git a/chrome/browser/host_content_settings_map.cc b/chrome/browser/host_content_settings_map.cc index 4ac9f405..19c3672 100644 --- a/chrome/browser/host_content_settings_map.cc +++ b/chrome/browser/host_content_settings_map.cc @@ -449,7 +449,7 @@ void HostContentSettingsMap::SetDefaultContentSetting( ContentSettingsType content_type, ContentSetting setting) { DCHECK(kTypeNames[content_type] != NULL); // Don't call this for Geolocation. - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); PrefService* prefs = profile_->GetPrefs(); // The default settings may not be directly modified for OTR sessions. @@ -489,7 +489,7 @@ void HostContentSettingsMap::SetContentSetting( const std::string& resource_identifier, ContentSetting setting) { DCHECK(kTypeNames[content_type] != NULL); // Don't call this for Geolocation. - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_NE(RequiresResourceIdentifier(content_type), resource_identifier.empty()); @@ -667,7 +667,7 @@ bool HostContentSettingsMap::RequiresResourceIdentifier( } void HostContentSettingsMap::SetBlockThirdPartyCookies(bool block) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // This setting may not be directly modified for OTR sessions. Instead, it // is synced to the main profile's setting. @@ -689,7 +689,7 @@ void HostContentSettingsMap::SetBlockThirdPartyCookies(bool block) { } void HostContentSettingsMap::SetBlockNonsandboxedPlugins(bool block) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // This setting may not be directly modified for OTR sessions. Instead, it // is synced to the main profile's setting. @@ -717,7 +717,7 @@ void HostContentSettingsMap::SetBlockNonsandboxedPlugins(bool block) { } void HostContentSettingsMap::ResetToDefaults() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); { AutoLock auto_lock(lock_); @@ -745,7 +745,7 @@ void HostContentSettingsMap::ResetToDefaults() { void HostContentSettingsMap::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (NotificationType::PREF_CHANGED == type) { if (updating_preferences_) @@ -907,7 +907,7 @@ void HostContentSettingsMap::NotifyObservers( } void HostContentSettingsMap::UnregisterObservers() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!profile_) return; pref_change_registrar_.RemoveAll(); diff --git a/chrome/browser/host_content_settings_map.h b/chrome/browser/host_content_settings_map.h index 52e4f9e..191463c 100644 --- a/chrome/browser/host_content_settings_map.h +++ b/chrome/browser/host_content_settings_map.h @@ -31,7 +31,7 @@ class Profile; class HostContentSettingsMap : public NotificationObserver, public base::RefCountedThreadSafe<HostContentSettingsMap, - ChromeThread::DeleteOnUIThread> { + BrowserThread::DeleteOnUIThread> { public: // A hostname pattern. See |IsValid| for a description of possible patterns. class Pattern { diff --git a/chrome/browser/host_content_settings_map_unittest.cc b/chrome/browser/host_content_settings_map_unittest.cc index 4d79ffc..5bf5894 100644 --- a/chrome/browser/host_content_settings_map_unittest.cc +++ b/chrome/browser/host_content_settings_map_unittest.cc @@ -64,11 +64,12 @@ class StubSettingsObserver : public NotificationObserver { class HostContentSettingsMapTest : public testing::Test { public: - HostContentSettingsMapTest() : ui_thread_(ChromeThread::UI, &message_loop_) {} + HostContentSettingsMapTest() : ui_thread_(BrowserThread::UI, &message_loop_) { + } protected: MessageLoop message_loop_; - ChromeThread ui_thread_; + BrowserThread ui_thread_; }; TEST_F(HostContentSettingsMapTest, DefaultValues) { diff --git a/chrome/browser/host_zoom_map.cc b/chrome/browser/host_zoom_map.cc index 5aa8336..786c51a 100644 --- a/chrome/browser/host_zoom_map.cc +++ b/chrome/browser/host_zoom_map.cc @@ -98,7 +98,7 @@ double HostZoomMap::GetZoomLevel(const GURL& url) const { } void HostZoomMap::SetZoomLevel(const GURL& url, double level) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!profile_) return; @@ -151,7 +151,7 @@ double HostZoomMap::GetTemporaryZoomLevel(int render_process_id, void HostZoomMap::SetTemporaryZoomLevel(int render_process_id, int render_view_id, double level) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!profile_) return; @@ -185,7 +185,7 @@ void HostZoomMap::SetTemporaryZoomLevel(int render_process_id, } void HostZoomMap::ResetToDefaults() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!profile_) return; @@ -213,7 +213,7 @@ void HostZoomMap::Observe( NotificationType type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); switch (type.value) { case NotificationType::PROFILE_DESTROYED: diff --git a/chrome/browser/host_zoom_map_unittest.cc b/chrome/browser/host_zoom_map_unittest.cc index 5899165..b9f2bc0f 100644 --- a/chrome/browser/host_zoom_map_unittest.cc +++ b/chrome/browser/host_zoom_map_unittest.cc @@ -28,7 +28,7 @@ class HostZoomMapTest : public testing::Test { public: static const double kZoomLevel; HostZoomMapTest() - : ui_thread_(ChromeThread::UI, &message_loop_), + : ui_thread_(BrowserThread::UI, &message_loop_), prefs_(profile_.GetPrefs()), per_host_zoom_levels_pref_(prefs::kPerHostZoomLevels), url_("http://example.com/test"), @@ -45,7 +45,7 @@ class HostZoomMapTest : public testing::Test { } MessageLoopForUI message_loop_; - ChromeThread ui_thread_; + BrowserThread ui_thread_; TestingProfile profile_; PrefService* prefs_; std::string per_host_zoom_levels_pref_; // For the observe matcher. diff --git a/chrome/browser/idbbindingutilities_browsertest.cc b/chrome/browser/idbbindingutilities_browsertest.cc index c32a9ae..40a2c09 100644 --- a/chrome/browser/idbbindingutilities_browsertest.cc +++ b/chrome/browser/idbbindingutilities_browsertest.cc @@ -69,34 +69,34 @@ class IDBKeyPathHelper : public UtilityProcessHost::Client { } void CreateUtilityProcess(ResourceDispatcherHost* resource_dispatcher_host) { - if (!ChromeThread::CurrentlyOn(ChromeThread::IO)) { - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableMethod(this, &IDBKeyPathHelper::CreateUtilityProcess, resource_dispatcher_host)); return; } - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); utility_process_host_ = new UtilityProcessHost(resource_dispatcher_host, this, - ChromeThread::IO); + BrowserThread::IO); utility_process_host_->StartBatchMode(); - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, - new MessageLoop::QuitTask()); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + new MessageLoop::QuitTask()); } void DestroyUtilityProcess() { - if (!ChromeThread::CurrentlyOn(ChromeThread::IO)) { - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableMethod(this, &IDBKeyPathHelper::DestroyUtilityProcess)); return; } - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); utility_process_host_->EndBatchMode(); utility_process_host_ = NULL; - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, - new MessageLoop::QuitTask()); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + new MessageLoop::QuitTask()); } void SetExpected(int expected_id, @@ -110,14 +110,14 @@ class IDBKeyPathHelper : public UtilityProcessHost::Client { void CheckValuesForKeyPath( int id, const std::vector<SerializedScriptValue>& serialized_values, const string16& key_path) { - if (!ChromeThread::CurrentlyOn(ChromeThread::IO)) { - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableMethod(this, &IDBKeyPathHelper::CheckValuesForKeyPath, id, serialized_values, key_path)); return; } - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); bool ret = utility_process_host_->StartIDBKeysFromValuesAndKeyPath( id, serialized_values, key_path); @@ -140,14 +140,14 @@ class IDBKeyPathHelper : public UtilityProcessHost::Client { ASSERT_EQ(expected_values_[pos].number(), i->number()); } } - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, - new MessageLoop::QuitTask()); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + new MessageLoop::QuitTask()); } virtual void OnIDBKeysFromValuesAndKeyPathFailed(int id) { EXPECT_TRUE(value_for_key_path_failed_); - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, - new MessageLoop::QuitTask()); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + new MessageLoop::QuitTask()); } private: diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index b76e895..a58689b 100644 --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc @@ -113,7 +113,7 @@ class LoggingNetworkChangeObserver DISABLE_RUNNABLE_METHOD_REFCOUNT(IOThread); IOThread::IOThread() - : BrowserProcessSubThread(ChromeThread::IO), + : BrowserProcessSubThread(BrowserThread::IO), globals_(NULL), speculative_interceptor_(NULL), predictor_(NULL) {} @@ -126,7 +126,7 @@ IOThread::~IOThread() { } IOThread::Globals* IOThread::globals() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); return globals_; } @@ -137,7 +137,7 @@ void IOThread::InitNetworkPredictor( const chrome_common_net::UrlList& startup_urls, ListValue* referral_list, bool preconnect_enabled) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); message_loop()->PostTask( FROM_HERE, NewRunnableMethod( @@ -148,7 +148,7 @@ void IOThread::InitNetworkPredictor( } void IOThread::ChangedToOnTheRecord() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); message_loop()->PostTask( FROM_HERE, NewRunnableMethod( @@ -276,7 +276,7 @@ void IOThread::InitNetworkPredictorOnIOThread( const chrome_common_net::UrlList& startup_urls, ListValue* referral_list, bool preconnect_enabled) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); CHECK(!predictor_); chrome_browser_net::EnablePredictor(prefetching_enabled); @@ -296,7 +296,7 @@ void IOThread::InitNetworkPredictorOnIOThread( } void IOThread::ChangedToOnTheRecordOnIOThread() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (predictor_) { // Destroy all evidence of our OTR session. diff --git a/chrome/browser/jankometer.cc b/chrome/browser/jankometer.cc index d4a70a2..bb711ef0 100644 --- a/chrome/browser/jankometer.cc +++ b/chrome/browser/jankometer.cc @@ -346,8 +346,8 @@ void InstallJankometer(const CommandLine& parsed_command_line) { "IO", TimeDelta::FromMilliseconds(kMaxIOMessageDelayMs), io_watchdog_enabled)); - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableMethod(io_observer->get(), &IOJankObserver::AttachToCurrentThread)); } diff --git a/chrome/browser/jumplist_win.cc b/chrome/browser/jumplist_win.cc index 43b7bfe..4747357 100644 --- a/chrome/browser/jumplist_win.cc +++ b/chrome/browser/jumplist_win.cc @@ -770,8 +770,8 @@ void JumpList::OnFavIconDataAvailable( // Finished Loading all fav icons needed by the application JumpList. // We create a JumpListUpdateTask that creates icon files, and we post it to // the file thread. - ChromeThread::PostTask( - ChromeThread::FILE, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::FILE, FROM_HERE, new JumpListUpdateTask(app_id_.c_str(), icon_dir_, most_visited_pages_, recently_closed_pages_)); diff --git a/chrome/browser/login_prompt.cc b/chrome/browser/login_prompt.cc index f8074e0..54b2c4f 100644 --- a/chrome/browser/login_prompt.cc +++ b/chrome/browser/login_prompt.cc @@ -83,8 +83,8 @@ LoginHandler::LoginHandler(net::AuthChallengeInfo* auth_info, AddRef(); // matched by LoginHandler::ReleaseSoon(). - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &LoginHandler::AddObservers)); if (!ResourceDispatcherHost::RenderViewForRequest( @@ -106,7 +106,7 @@ void LoginHandler::SetPasswordManager(PasswordManager* password_manager) { } TabContents* LoginHandler::GetTabContentsForLogin() const { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); return tab_util::GetTabContentsByID(render_process_host_id_, tab_contents_id_); @@ -124,15 +124,15 @@ void LoginHandler::SetAuth(const std::wstring& username, password_manager_->ProvisionallySavePassword(password_form_); } - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &LoginHandler::CloseContentsDeferred)); - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod( this, &LoginHandler::NotifyAuthSupplied, username, password)); - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableMethod( this, &LoginHandler::SetAuthDeferred, username, password)); } @@ -141,19 +141,19 @@ void LoginHandler::CancelAuth() { if (WasAuthHandled(true)) return; - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &LoginHandler::CloseContentsDeferred)); - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &LoginHandler::NotifyAuthCancelled)); - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableMethod(this, &LoginHandler::CancelAuthDeferred)); } void LoginHandler::OnRequestCancelled() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)) << + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)) << "Why is OnRequestCancelled called from the UI thread?"; // Reference is no longer valid. @@ -164,7 +164,7 @@ void LoginHandler::OnRequestCancelled() { } void LoginHandler::AddObservers() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); registrar_.Add(this, NotificationType::AUTH_SUPPLIED, NotificationService::AllSources()); @@ -173,7 +173,7 @@ void LoginHandler::AddObservers() { } void LoginHandler::RemoveObservers() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); registrar_.Remove(this, NotificationType::AUTH_SUPPLIED, NotificationService::AllSources()); @@ -186,7 +186,7 @@ void LoginHandler::RemoveObservers() { void LoginHandler::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(type == NotificationType::AUTH_SUPPLIED || type == NotificationType::AUTH_CANCELLED); @@ -233,7 +233,7 @@ void LoginHandler::SetDialog(ConstrainedWindow* dialog) { } void LoginHandler::NotifyAuthNeeded() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (WasAuthHandled(false)) return; @@ -251,7 +251,7 @@ void LoginHandler::NotifyAuthNeeded() { } void LoginHandler::NotifyAuthCancelled() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(WasAuthHandled(false)); TabContents* requesting_contents = GetTabContentsForLogin(); @@ -269,7 +269,7 @@ void LoginHandler::NotifyAuthCancelled() { void LoginHandler::NotifyAuthSupplied(const std::wstring& username, const std::wstring& password) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(WasAuthHandled(false)); TabContents* requesting_contents = GetTabContentsForLogin(); @@ -287,20 +287,20 @@ void LoginHandler::NotifyAuthSupplied(const std::wstring& username, void LoginHandler::ReleaseSoon() { if (!WasAuthHandled(true)) { - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableMethod(this, &LoginHandler::CancelAuthDeferred)); - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &LoginHandler::NotifyAuthCancelled)); } - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &LoginHandler::RemoveObservers)); // Delete this object once all InvokeLaters have been called. - ChromeThread::ReleaseSoon(ChromeThread::IO, FROM_HERE, this); + BrowserThread::ReleaseSoon(BrowserThread::IO, FROM_HERE, this); } // Returns whether authentication had been handled (SetAuth or CancelAuth). @@ -316,7 +316,7 @@ bool LoginHandler::WasAuthHandled(bool set_handled) { // Calls SetAuth from the IO loop. void LoginHandler::SetAuthDeferred(const std::wstring& username, const std::wstring& password) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (request_) { request_->SetAuth(WideToUTF16Hack(username), WideToUTF16Hack(password)); @@ -326,7 +326,7 @@ void LoginHandler::SetAuthDeferred(const std::wstring& username, // Calls CancelAuth from the IO loop. void LoginHandler::CancelAuthDeferred() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (request_) { request_->CancelAuth(); @@ -338,7 +338,7 @@ void LoginHandler::CancelAuthDeferred() { // Closes the view_contents from the UI loop. void LoginHandler::CloseContentsDeferred() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // The hosting ConstrainedWindow may have been freed. if (dialog_) @@ -440,8 +440,8 @@ class LoginDialogTask : public Task { LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info, URLRequest* request) { LoginHandler* handler = LoginHandler::Create(auth_info, request); - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, new LoginDialogTask( + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, new LoginDialogTask( request->url(), auth_info, handler)); return handler; } diff --git a/chrome/browser/login_prompt_gtk.cc b/chrome/browser/login_prompt_gtk.cc index a9cfb4b..1d77ab1 100644 --- a/chrome/browser/login_prompt_gtk.cc +++ b/chrome/browser/login_prompt_gtk.cc @@ -46,7 +46,7 @@ class LoginHandlerGtk : public LoginHandler, // LoginModelObserver implementation. virtual void OnAutofillDataAvailable(const std::wstring& username, const std::wstring& password) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // NOTE: Would be nice to use gtk_entry_get_text_length, but it is fairly // new and not always in our GTK version. @@ -62,7 +62,7 @@ class LoginHandlerGtk : public LoginHandler, // LoginHandler: virtual void BuildViewForPasswordManager(PasswordManager* manager, std::wstring explanation) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); root_.Own(gtk_vbox_new(FALSE, gtk_util::kContentAreaBorder)); GtkWidget* label = gtk_label_new(WideToUTF8(explanation).c_str()); @@ -119,7 +119,7 @@ class LoginHandlerGtk : public LoginHandler, } virtual void DeleteDelegate() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // The constrained window is going to delete itself; clear our pointer. SetDialog(NULL); @@ -160,7 +160,7 @@ void LoginHandlerGtk::OnCancelClicked(GtkWidget* sender) { void LoginHandlerGtk::OnPromptHierarchyChanged(GtkWidget* sender, GtkWidget* previous_toplevel) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel(ok_))) return; diff --git a/chrome/browser/login_prompt_mac.mm b/chrome/browser/login_prompt_mac.mm index a211af6..36a113c 100644 --- a/chrome/browser/login_prompt_mac.mm +++ b/chrome/browser/login_prompt_mac.mm @@ -46,7 +46,7 @@ class LoginHandlerMac : public LoginHandler, // LoginModelObserver implementation. virtual void OnAutofillDataAvailable(const std::wstring& username, const std::wstring& password) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); [sheet_controller_ autofillLogin:base::SysWideToNSString(username) password:base::SysWideToNSString(password)]; @@ -55,7 +55,7 @@ class LoginHandlerMac : public LoginHandler, // LoginHandler: virtual void BuildViewForPasswordManager(PasswordManager* manager, std::wstring explanation) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // Load nib here instead of in constructor. sheet_controller_ = [[[LoginHandlerSheet alloc] @@ -79,7 +79,7 @@ class LoginHandlerMac : public LoginHandler, // Overridden from ConstrainedWindowMacDelegate: virtual void DeleteDelegate() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // The constrained window is going to delete itself; clear our pointer. SetDialog(NULL); @@ -95,13 +95,13 @@ class LoginHandlerMac : public LoginHandler, void OnLoginPressed(const std::wstring& username, const std::wstring& password) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); SetAuth(username, password); } void OnCancelPressed() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); CancelAuth(); } diff --git a/chrome/browser/login_prompt_win.cc b/chrome/browser/login_prompt_win.cc index e82899d..673facd 100644 --- a/chrome/browser/login_prompt_win.cc +++ b/chrome/browser/login_prompt_win.cc @@ -59,7 +59,7 @@ class LoginHandlerWin : public LoginHandler, } virtual void WindowClosing() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); TabContents* tab = GetTabContentsForLogin(); if (tab) @@ -72,7 +72,7 @@ class LoginHandlerWin : public LoginHandler, } virtual void DeleteDelegate() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // The constrained window is going to delete itself; clear our pointer. SetDialog(NULL); @@ -82,14 +82,14 @@ class LoginHandlerWin : public LoginHandler, } virtual bool Cancel() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); CancelAuth(); return true; } virtual bool Accept() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); SetAuth(login_view_->GetUsername(), login_view_->GetPassword()); return true; @@ -103,7 +103,7 @@ class LoginHandlerWin : public LoginHandler, virtual void BuildViewForPasswordManager(PasswordManager* manager, std::wstring explanation) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); TabContents* tab_contents = GetTabContentsForLogin(); bool should_focus_view = !tab_contents->delegate() || diff --git a/chrome/browser/mach_broker_mac.cc b/chrome/browser/mach_broker_mac.cc index 6c24541..589e812 100644 --- a/chrome/browser/mach_broker_mac.cc +++ b/chrome/browser/mach_broker_mac.cc @@ -132,8 +132,8 @@ void MachBroker::PrepareForFork() { if (!listener_thread_started_) { listener_thread_started_ = true; - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, new RegisterNotificationTask(this)); + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, new RegisterNotificationTask(this)); // Intentional leak. This thread is never joined or reaped. PlatformThread::CreateNonJoinable(0, new MachListenerThreadDelegate(this)); diff --git a/chrome/browser/memory_details.cc b/chrome/browser/memory_details.cc index db257e0..a6c063f 100644 --- a/chrome/browser/memory_details.cc +++ b/chrome/browser/memory_details.cc @@ -38,18 +38,18 @@ // void MemoryDetails::StartFetch() { - DCHECK(!ChromeThread::CurrentlyOn(ChromeThread::IO)); - DCHECK(!ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::FILE)); // In order to process this request, we need to use the plugin information. // However, plugin process information is only available from the IO thread. - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnIOThread)); } void MemoryDetails::CollectChildInfoOnIOThread() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); std::vector<ProcessMemoryInformation> child_info; @@ -66,13 +66,13 @@ void MemoryDetails::CollectChildInfoOnIOThread() { } // Now go do expensive memory lookups from the file thread. - ChromeThread::PostTask( - ChromeThread::FILE, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::FILE, FROM_HERE, NewRunnableMethod(this, &MemoryDetails::CollectProcessData, child_info)); } void MemoryDetails::CollectChildInfoOnUIThread() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); #if defined(OS_LINUX) const pid_t zygote_pid = Singleton<ZygoteHost>()->pid(); diff --git a/chrome/browser/memory_details_linux.cc b/chrome/browser/memory_details_linux.cc index 232deaf..19b9b28 100644 --- a/chrome/browser/memory_details_linux.cc +++ b/chrome/browser/memory_details_linux.cc @@ -200,7 +200,7 @@ static void GetAllChildren(const std::vector<Process>& processes, void MemoryDetails::CollectProcessData( std::vector<ProcessMemoryInformation> child_info) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); std::vector<Process> processes; GetProcesses(&processes); @@ -266,7 +266,7 @@ void MemoryDetails::CollectProcessData( } // Finally return to the browser thread. - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnUIThread)); } diff --git a/chrome/browser/memory_details_mac.cc b/chrome/browser/memory_details_mac.cc index 26b9fbf..881fdae 100644 --- a/chrome/browser/memory_details_mac.cc +++ b/chrome/browser/memory_details_mac.cc @@ -86,7 +86,7 @@ void MemoryDetails::CollectProcessData( std::vector<ProcessMemoryInformation> child_info) { // This must be run on the file thread to avoid jank (|ProcessInfoSnapshot| // runs /bin/ps, which isn't instantaneous). - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); // Clear old data. for (size_t index = 0; index < MAX_BROWSERS; index++) @@ -183,8 +183,8 @@ void MemoryDetails::CollectProcessData( } // Finally return to the browser thread. - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnUIThread)); } diff --git a/chrome/browser/memory_details_win.cc b/chrome/browser/memory_details_win.cc index 1e6d985..08329b7 100644 --- a/chrome/browser/memory_details_win.cc +++ b/chrome/browser/memory_details_win.cc @@ -64,7 +64,7 @@ ProcessData* MemoryDetails::ChromeBrowser() { void MemoryDetails::CollectProcessData( std::vector<ProcessMemoryInformation> child_info) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); // Clear old data. for (int index = 0; index < arraysize(g_process_template); index++) @@ -156,7 +156,7 @@ void MemoryDetails::CollectProcessData( } while (::Process32Next(snapshot, &process_entry)); // Finally return to the browser thread. - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnUIThread)); } diff --git a/chrome/browser/memory_purger.cc b/chrome/browser/memory_purger.cc index 9117811..d1431da 100644 --- a/chrome/browser/memory_purger.cc +++ b/chrome/browser/memory_purger.cc @@ -129,7 +129,7 @@ void MemoryPurger::PurgeBrowser() { profile->GetWebKitContext()->PurgeMemory(); } - ChromeThread::PostTask(ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, NewRunnableMethod(purge_memory_io_helper.get(), &PurgeMemoryIOHelper::PurgeMemoryOnIOThread)); diff --git a/chrome/browser/platform_util_chromeos.cc b/chrome/browser/platform_util_chromeos.cc index 229563b..f08acf8 100644 --- a/chrome/browser/platform_util_chromeos.cc +++ b/chrome/browser/platform_util_chromeos.cc @@ -29,7 +29,7 @@ static const std::string kGmailComposeUrl = // Opens file browser on UI thread. void OpenFileBrowserOnUIThread(const FilePath& dir) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); Profile* profile; profile = BrowserList::GetLastActive()->profile(); @@ -48,11 +48,11 @@ void ShowItemInFolder(const FilePath& full_path) { if (!file_util::DirectoryExists(dir)) return; - if (ChromeThread::CurrentlyOn(ChromeThread::UI)) { + if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { OpenFileBrowserOnUIThread(dir); } else { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableFunction(&OpenFileBrowserOnUIThread, dir)); } } @@ -71,9 +71,9 @@ void OpenItem(const FilePath& full_path) { std::string path; path = "file://"; path.append(full_path.value()); - if (!ChromeThread::CurrentlyOn(ChromeThread::UI)) { - bool result = ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { + bool result = BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableFunction(&OpenItem, full_path)); DCHECK(result); return; @@ -97,8 +97,8 @@ void OpenItem(const FilePath& full_path) { } // Unknwon file type. Show an error message to user. - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableFunction( &SimpleErrorBox, static_cast<gfx::NativeWindow>(NULL), @@ -117,8 +117,8 @@ void OpenExternal(const GURL& url) { if (url.SchemeIs("mailto")) { std::string string_url = kGmailComposeUrl; string_url.append(url.spec()); - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, NewRunnableFunction(OpenURL, string_url)); + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableFunction(OpenURL, string_url)); } } diff --git a/chrome/browser/plugin_exceptions_table_model_unittest.cc b/chrome/browser/plugin_exceptions_table_model_unittest.cc index 1940bde..813083c 100644 --- a/chrome/browser/plugin_exceptions_table_model_unittest.cc +++ b/chrome/browser/plugin_exceptions_table_model_unittest.cc @@ -53,7 +53,7 @@ class MockTableModelObserver : public TableModelObserver { class PluginExceptionsTableModelTest : public testing::Test { public: PluginExceptionsTableModelTest() - : ui_thread_(ChromeThread::UI, &message_loop_), + : ui_thread_(BrowserThread::UI, &message_loop_), command_line_(CommandLine::ForCurrentProcess(), *CommandLine::ForCurrentProcess()) {} @@ -137,7 +137,7 @@ class PluginExceptionsTableModelTest : public testing::Test { protected: MessageLoop message_loop_; - ChromeThread ui_thread_; + BrowserThread ui_thread_; scoped_ptr<TestingProfile> profile_; scoped_ptr<MockPluginExceptionsTableModel> table_model_; diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc index 093b975..a9d1e3d 100644 --- a/chrome/browser/plugin_process_host.cc +++ b/chrome/browser/plugin_process_host.cc @@ -123,22 +123,22 @@ PluginProcessHost::~PluginProcessHost() { for (window_index = plugin_fullscreen_windows_set_.begin(); window_index != plugin_fullscreen_windows_set_.end(); window_index++) { - if (ChromeThread::CurrentlyOn(ChromeThread::UI)) { + if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { mac_util::ReleaseFullScreen(mac_util::kFullScreenModeHideAll); } else { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableFunction(mac_util::ReleaseFullScreen, mac_util::kFullScreenModeHideAll)); } } // If the plugin hid the cursor, reset that. if (!plugin_cursor_visible_) { - if (ChromeThread::CurrentlyOn(ChromeThread::UI)) { + if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { mac_util::SetCursorVisibility(true); } else { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableFunction(mac_util::SetCursorVisibility, true)); } @@ -254,7 +254,7 @@ bool PluginProcessHost::Init(const WebPluginInfo& info, } void PluginProcessHost::ForceShutdown() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); Send(new PluginProcessMsg_NotifyRenderersOfPendingShutdown()); BrowserChildProcessHost::ForceShutdown(); } @@ -464,7 +464,7 @@ void PluginProcessHost::OnGetPluginFinderUrl(std::string* plugin_finder_url) { void PluginProcessHost::OnPluginMessage( const std::vector<uint8>& data) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); ChromePluginLib *chrome_plugin = ChromePluginLib::Find(info_.path); if (chrome_plugin) { diff --git a/chrome/browser/plugin_process_host_mac.cc b/chrome/browser/plugin_process_host_mac.cc index 8182a3c..0ed0565 100644 --- a/chrome/browser/plugin_process_host_mac.cc +++ b/chrome/browser/plugin_process_host_mac.cc @@ -42,8 +42,8 @@ void PluginProcessHost::OnPluginShowWindow(uint32 window_id, // the main display, hide the menubar so that it has the whole screen. // (but only if we haven't already seen this fullscreen window, since // otherwise our refcounting can get skewed). - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableFunction(mac_util::RequestFullScreen, mac_util::kFullScreenModeHideAll)); } @@ -75,27 +75,27 @@ void PluginProcessHost::OnPluginHideWindow(uint32 window_id, plugin_fullscreen_windows_set_.erase(window_id); pid_t plugin_pid = browser_needs_activation ? -1 : handle(); browser_needs_activation = false; - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableFunction(ReleasePluginFullScreen, plugin_pid)); } if (browser_needs_activation) { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableFunction(mac_util::ActivateProcess, base::GetCurrentProcId())); } } void PluginProcessHost::OnAppActivation() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); // If our plugin process has any modal windows up, we need to bring it forward // so that they act more like an in-process modal window would. if (!plugin_modal_windows_set_.empty()) { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableFunction(mac_util::ActivateProcess, handle())); } } @@ -103,8 +103,8 @@ void PluginProcessHost::OnAppActivation() { void PluginProcessHost::OnPluginSetCursorVisibility(bool visible) { if (plugin_cursor_visible_ != visible) { plugin_cursor_visible_ = visible; - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableFunction(mac_util::SetCursorVisibility, visible)); } diff --git a/chrome/browser/plugin_service.cc b/chrome/browser/plugin_service.cc index 0bc7aed..e42c2ae 100644 --- a/chrome/browser/plugin_service.cc +++ b/chrome/browser/plugin_service.cc @@ -43,7 +43,7 @@ #if defined(OS_MACOSX) static void NotifyPluginsOfActivation() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::PLUGIN_PROCESS); !iter.Done(); ++iter) { @@ -57,14 +57,14 @@ static void NotifyPluginsOfActivation() { bool PluginService::enable_chrome_plugins_ = true; void LoadPluginsFromDiskHook() { - DCHECK(!ChromeThread::CurrentlyOn(ChromeThread::UI) && - !ChromeThread::CurrentlyOn(ChromeThread::IO)) << + DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI) && + !BrowserThread::CurrentlyOn(BrowserThread::IO)) << "Can't load plugins on the IO/UI threads since it's very slow."; } // static void PluginService::InitGlobalInstance(Profile* profile) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); NPAPI::PluginList::Singleton()->SetPluginLoadHook(LoadPluginsFromDiskHook); @@ -196,7 +196,7 @@ const std::string& PluginService::GetUILocale() { PluginProcessHost* PluginService::FindPluginProcess( const FilePath& plugin_path) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (plugin_path.value().empty()) { NOTREACHED() << "should only be called if we have a plugin to load"; @@ -215,7 +215,7 @@ PluginProcessHost* PluginService::FindPluginProcess( PluginProcessHost* PluginService::FindOrStartPluginProcess( const FilePath& plugin_path) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); PluginProcessHost *plugin_host = FindPluginProcess(plugin_path); if (plugin_host) @@ -245,7 +245,7 @@ void PluginService::OpenChannelToPlugin( const std::string& mime_type, const std::string& locale, IPC::Message* reply_msg) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); bool allow_wildcard = true; WebPluginInfo info; FilePath plugin_path; @@ -315,9 +315,9 @@ void PluginService::Observe(NotificationType type, bool plugins_changed = false; for (size_t i = 0; i < extension->plugins().size(); ++i) { const Extension::PluginInfo& plugin = extension->plugins()[i]; - ChromeThread::PostTask(ChromeThread::IO, FROM_HERE, - NewRunnableFunction(&ForceShutdownPlugin, - plugin.path)); + BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, + NewRunnableFunction(&ForceShutdownPlugin, + plugin.path)); NPAPI::PluginList::Singleton()->RefreshPlugins(); NPAPI::PluginList::Singleton()->RemoveExtraPluginPath(plugin.path); plugins_changed = true; @@ -331,8 +331,8 @@ void PluginService::Observe(NotificationType type, #if defined(OS_MACOSX) case NotificationType::APP_ACTIVATED: { - ChromeThread::PostTask(ChromeThread::IO, FROM_HERE, - NewRunnableFunction(&NotifyPluginsOfActivation)); + BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, + NewRunnableFunction(&NotifyPluginsOfActivation)); break; } #endif diff --git a/chrome/browser/power_save_blocker_common.cc b/chrome/browser/power_save_blocker_common.cc index 47efe55..44c8619 100644 --- a/chrome/browser/power_save_blocker_common.cc +++ b/chrome/browser/power_save_blocker_common.cc @@ -35,14 +35,14 @@ void PowerSaveBlocker::Disable() { void PowerSaveBlocker::PostAdjustBlockCount(int delta) { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableFunction(&PowerSaveBlocker::AdjustBlockCount, delta)); } // Called only from UI thread. void PowerSaveBlocker::AdjustBlockCount(int delta) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); bool was_blocking = (blocker_count_ != 0); diff --git a/chrome/browser/power_save_blocker_win.cc b/chrome/browser/power_save_blocker_win.cc index f7d3d8c..5d409fa 100644 --- a/chrome/browser/power_save_blocker_win.cc +++ b/chrome/browser/power_save_blocker_win.cc @@ -10,7 +10,7 @@ // Runs on UI thread only. void PowerSaveBlocker::ApplyBlock(bool blocking) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DWORD flags = ES_CONTINUOUS; diff --git a/chrome/browser/process_singleton_linux.cc b/chrome/browser/process_singleton_linux.cc index da80b2b..36cced1 100644 --- a/chrome/browser/process_singleton_linux.cc +++ b/chrome/browser/process_singleton_linux.cc @@ -601,7 +601,7 @@ void ProcessSingleton::LinuxWatcher::OnFileCanReadWithoutBlocking(int fd) { } void ProcessSingleton::LinuxWatcher::StartListening(int socket) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); // Watch for client connections on this socket. MessageLoopForIO* ml = MessageLoopForIO::current(); ml->AddDestructionObserver(this); @@ -978,7 +978,7 @@ bool ProcessSingleton::Create() { if (listen(sock, 5) < 0) NOTREACHED() << "listen failed: " << safe_strerror(errno); - // Normally we would use ChromeThread, but the IO thread hasn't started yet. + // Normally we would use BrowserThread, but the IO thread hasn't started yet. // Using g_browser_process, we start the thread so we can listen on the // socket. MessageLoop* ml = g_browser_process->io_thread()->message_loop(); diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index b7f59fd..1d0502c 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -140,8 +140,8 @@ class OffTheRecordProfileImpl : public Profile, CleanupRequestContext(extensions_request_context_); // Clean up all DB files/directories - ChromeThread::PostTask( - ChromeThread::FILE, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::FILE, FROM_HERE, NewRunnableMethod( db_tracker_.get(), &webkit_database::DatabaseTracker::DeleteIncognitoDBDirectory)); @@ -177,8 +177,8 @@ class OffTheRecordProfileImpl : public Profile, virtual ChromeAppCacheService* GetAppCacheService() { if (!appcache_service_) { appcache_service_ = new ChromeAppCacheService; - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableMethod(appcache_service_.get(), &ChromeAppCacheService::InitializeOnIOThread, GetPath(), IsOffTheRecord(), @@ -551,8 +551,8 @@ class OffTheRecordProfileImpl : public Profile, virtual ChromeBlobStorageContext* GetBlobStorageContext() { if (!blob_storage_context_) { blob_storage_context_ = new ChromeBlobStorageContext(); - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableMethod( blob_storage_context_.get(), &ChromeBlobStorageContext::InitializeOnIOThread)); diff --git a/chrome/browser/profile_impl.cc b/chrome/browser/profile_impl.cc index 899e068daa..779cb4d 100644 --- a/chrome/browser/profile_impl.cc +++ b/chrome/browser/profile_impl.cc @@ -338,8 +338,8 @@ ProfileImpl::ProfileImpl(const FilePath& path) extension_info_map_ = new ExtensionInfoMap(); // Log the profile size after a reasonable startup delay. - ChromeThread::PostDelayedTask(ChromeThread::FILE, FROM_HERE, - new ProfileSizeTask(path_), 112000); + BrowserThread::PostDelayedTask(BrowserThread::FILE, FROM_HERE, + new ProfileSizeTask(path_), 112000); } void ProfileImpl::InitExtensions() { @@ -583,8 +583,8 @@ Profile* ProfileImpl::GetOriginalProfile() { ChromeAppCacheService* ProfileImpl::GetAppCacheService() { if (!appcache_service_) { appcache_service_ = new ChromeAppCacheService; - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableMethod(appcache_service_.get(), &ChromeAppCacheService::InitializeOnIOThread, GetPath(), IsOffTheRecord(), @@ -765,16 +765,16 @@ void ProfileImpl::RegisterExtensionWithRequestContexts(Extension* extension) { // AddRef to ensure the data lives until the other thread gets it. Balanced in // OnNewExtensions. extension->static_data()->AddRef(); - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableMethod(extension_info_map_.get(), &ExtensionInfoMap::AddExtension, extension->static_data())); } void ProfileImpl::UnregisterExtensionWithRequestContexts(Extension* extension) { - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableMethod(extension_info_map_.get(), &ExtensionInfoMap::RemoveExtension, extension->id())); @@ -1168,7 +1168,7 @@ WebKitContext* ProfileImpl::GetWebKitContext() { } DesktopNotificationService* ProfileImpl::GetDesktopNotificationService() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!desktop_notification_service_.get()) { desktop_notification_service_.reset(new DesktopNotificationService( this, g_browser_process->notification_ui_manager())); @@ -1259,8 +1259,8 @@ void ProfileImpl::InitCloudPrintProxyService() { ChromeBlobStorageContext* ProfileImpl::GetBlobStorageContext() { if (!blob_storage_context_) { blob_storage_context_ = new ChromeBlobStorageContext(); - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableMethod(blob_storage_context_.get(), &ChromeBlobStorageContext::InitializeOnIOThread)); } diff --git a/chrome/browser/profile_import_process_host.cc b/chrome/browser/profile_import_process_host.cc index 7cc58b3..26e4ec1 100644 --- a/chrome/browser/profile_import_process_host.cc +++ b/chrome/browser/profile_import_process_host.cc @@ -18,7 +18,7 @@ ProfileImportProcessHost::ProfileImportProcessHost( ResourceDispatcherHost* resource_dispatcher, ImportProcessClient* import_process_client, - ChromeThread::ID thread_id) + BrowserThread::ID thread_id) : BrowserChildProcessHost(PROFILE_IMPORT_PROCESS, resource_dispatcher), import_process_client_(import_process_client), thread_id_(thread_id) { @@ -30,7 +30,7 @@ ProfileImportProcessHost::~ProfileImportProcessHost() { bool ProfileImportProcessHost::StartProfileImportProcess( const importer::ProfileInfo& profile_info, int items, bool import_to_bookmark_bar) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (!StartProcess()) return false; @@ -59,14 +59,14 @@ bool ProfileImportProcessHost::StartProfileImportProcess( } bool ProfileImportProcessHost::CancelProfileImportProcess() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); Send(new ProfileImportProcessMsg_CancelImport()); return true; } bool ProfileImportProcessHost::ReportImportItemFinished( importer::ImportItem item) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); Send(new ProfileImportProcessMsg_ReportImportItemFinished(item)); return true; } @@ -119,8 +119,8 @@ bool ProfileImportProcessHost::StartProcess() { } void ProfileImportProcessHost::OnMessageReceived(const IPC::Message& message) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); - ChromeThread::PostTask( + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + BrowserThread::PostTask( thread_id_, FROM_HERE, NewRunnableMethod(import_process_client_.get(), &ImportProcessClient::OnMessageReceived, @@ -128,8 +128,8 @@ void ProfileImportProcessHost::OnMessageReceived(const IPC::Message& message) { } void ProfileImportProcessHost::OnProcessCrashed() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); - ChromeThread::PostTask( + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + BrowserThread::PostTask( thread_id_, FROM_HERE, NewRunnableMethod(import_process_client_.get(), &ImportProcessClient::OnProcessCrashed)); diff --git a/chrome/browser/profile_import_process_host.h b/chrome/browser/profile_import_process_host.h index 22e0026..a6fc0bb 100644 --- a/chrome/browser/profile_import_process_host.h +++ b/chrome/browser/profile_import_process_host.h @@ -97,7 +97,7 @@ class ProfileImportProcessHost : public BrowserChildProcessHost { // ProfileImportProcessHost spawns tasks on this thread for the client. ProfileImportProcessHost(ResourceDispatcherHost* resource_dispatcher, ImportProcessClient* import_process_client, - ChromeThread::ID thread_id); + BrowserThread::ID thread_id); virtual ~ProfileImportProcessHost(); // |profile_info|, |items|, and |import_to_bookmark_bar| are all needed by @@ -136,7 +136,7 @@ class ProfileImportProcessHost : public BrowserChildProcessHost { scoped_refptr<ImportProcessClient> import_process_client_; // The thread where the import_process_client_ lives. - ChromeThread::ID thread_id_; + BrowserThread::ID thread_id_; DISALLOW_COPY_AND_ASSIGN(ProfileImportProcessHost); }; diff --git a/chrome/browser/profile_manager.cc b/chrome/browser/profile_manager.cc index 35aa664..fb6605a 100644 --- a/chrome/browser/profile_manager.cc +++ b/chrome/browser/profile_manager.cc @@ -199,8 +199,8 @@ void ProfileManager::OnSuspend() { DCHECK(CalledOnValidThread()); for (const_iterator i(begin()); i != end(); ++i) { - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableFunction(&ProfileManager::SuspendProfile, *i)); } } @@ -208,8 +208,8 @@ void ProfileManager::OnSuspend() { void ProfileManager::OnResume() { DCHECK(CalledOnValidThread()); for (const_iterator i(begin()); i != end(); ++i) { - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableFunction(&ProfileManager::ResumeProfile, *i)); } } @@ -238,7 +238,7 @@ void ProfileManager::Observe( void ProfileManager::SuspendProfile(Profile* profile) { DCHECK(profile); - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); for (URLRequestJobTracker::JobIterator i = g_url_request_job_tracker.begin(); i != g_url_request_job_tracker.end(); ++i) @@ -250,7 +250,7 @@ void ProfileManager::SuspendProfile(Profile* profile) { void ProfileManager::ResumeProfile(Profile* profile) { DCHECK(profile); - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); profile->GetRequestContext()->GetURLRequestContext()-> http_transaction_factory()->Suspend(false); } diff --git a/chrome/browser/profile_manager_unittest.cc b/chrome/browser/profile_manager_unittest.cc index 73219b6..abfc6f1 100644 --- a/chrome/browser/profile_manager_unittest.cc +++ b/chrome/browser/profile_manager_unittest.cc @@ -21,7 +21,7 @@ class ProfileManagerTest : public testing::Test { protected: - ProfileManagerTest() : ui_thread_(ChromeThread::UI, &message_loop_) { + ProfileManagerTest() : ui_thread_(BrowserThread::UI, &message_loop_) { } virtual void SetUp() { @@ -40,7 +40,7 @@ class ProfileManagerTest : public testing::Test { } MessageLoopForUI message_loop_; - ChromeThread ui_thread_; + BrowserThread ui_thread_; // the path to temporary directory used to contain the test operations FilePath test_dir_; |