diff options
Diffstat (limited to 'chrome')
28 files changed, 115 insertions, 115 deletions
diff --git a/chrome/browser/shell_integration.cc b/chrome/browser/shell_integration.cc index c51ed25..445153d 100644 --- a/chrome/browser/shell_integration.cc +++ b/chrome/browser/shell_integration.cc @@ -75,16 +75,16 @@ ShellIntegration::DefaultBrowserWorker::DefaultBrowserWorker( void ShellIntegration::DefaultBrowserWorker::StartCheckDefaultBrowser() { observer_->SetDefaultBrowserUIState(STATE_PROCESSING); - ChromeThread::PostTask( - ChromeThread::FILE, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::FILE, FROM_HERE, NewRunnableMethod( this, &DefaultBrowserWorker::ExecuteCheckDefaultBrowser)); } void ShellIntegration::DefaultBrowserWorker::StartSetAsDefaultBrowser() { observer_->SetDefaultBrowserUIState(STATE_PROCESSING); - ChromeThread::PostTask( - ChromeThread::FILE, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::FILE, FROM_HERE, NewRunnableMethod( this, &DefaultBrowserWorker::ExecuteSetAsDefaultBrowser)); } @@ -99,31 +99,31 @@ void ShellIntegration::DefaultBrowserWorker::ObserverDestroyed() { // DefaultBrowserWorker, private: void ShellIntegration::DefaultBrowserWorker::ExecuteCheckDefaultBrowser() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); DefaultBrowserState state = ShellIntegration::IsDefaultBrowser(); - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod( this, &DefaultBrowserWorker::CompleteCheckDefaultBrowser, state)); } void ShellIntegration::DefaultBrowserWorker::CompleteCheckDefaultBrowser( DefaultBrowserState state) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); UpdateUI(state); } void ShellIntegration::DefaultBrowserWorker::ExecuteSetAsDefaultBrowser() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); ShellIntegration::SetAsDefaultBrowser(); - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod( this, &DefaultBrowserWorker::CompleteSetAsDefaultBrowser)); } void ShellIntegration::DefaultBrowserWorker::CompleteSetAsDefaultBrowser() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (observer_) { // Set as default completed, check again to make sure it stuck... StartCheckDefaultBrowser(); diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc index 427d4ad..cc4aeab 100644 --- a/chrome/browser/shell_integration_linux.cc +++ b/chrome/browser/shell_integration_linux.cc @@ -213,7 +213,7 @@ bool ShellIntegration::SetAsDefaultBrowser() { // static ShellIntegration::DefaultBrowserState ShellIntegration::IsDefaultBrowser() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); scoped_ptr<base::Environment> env(base::Environment::Create()); @@ -249,7 +249,7 @@ bool ShellIntegration::IsFirefoxDefaultBrowser() { // static bool ShellIntegration::GetDesktopShortcutTemplate( base::Environment* env, std::string* output) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); std::vector<FilePath> search_paths; @@ -370,7 +370,7 @@ void ShellIntegration::CreateDesktopShortcut( const ShortcutInfo& shortcut_info, const std::string& shortcut_template) { // TODO(phajdan.jr): Report errors from this function, possibly as infobars. - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); FilePath shortcut_filename = GetDesktopShortcutFilename(shortcut_info.url); if (shortcut_filename.empty()) diff --git a/chrome/browser/shell_integration_unittest.cc b/chrome/browser/shell_integration_unittest.cc index 9ea7021..e8087f6 100644 --- a/chrome/browser/shell_integration_unittest.cc +++ b/chrome/browser/shell_integration_unittest.cc @@ -77,7 +77,7 @@ TEST(ShellIntegrationTest, GetDesktopShortcutTemplate) { const char kTestData2[] = "a different testing string"; MessageLoop message_loop; - ChromeThread file_thread(ChromeThread::FILE, &message_loop); + BrowserThread file_thread(BrowserThread::FILE, &message_loop); { ScopedTempDir temp_dir; diff --git a/chrome/browser/shell_integration_win.cc b/chrome/browser/shell_integration_win.cc index 46c05a9..a1a8e98 100644 --- a/chrome/browser/shell_integration_win.cc +++ b/chrome/browser/shell_integration_win.cc @@ -96,7 +96,7 @@ class MigrateChromiumShortcutsTask : public Task { void MigrateChromiumShortcutsTask::Run() { // This should run on the file thread. - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); MigrateWin7Shortcuts(); } @@ -410,6 +410,6 @@ void ShellIntegration::MigrateChromiumShortcuts() { if (win_util::GetWinVersion() < win_util::WINVERSION_WIN7) return; - ChromeThread::PostTask( - ChromeThread::FILE, FROM_HERE, new MigrateChromiumShortcutsTask()); + BrowserThread::PostTask( + BrowserThread::FILE, FROM_HERE, new MigrateChromiumShortcutsTask()); } diff --git a/chrome/browser/spellcheck_host.cc b/chrome/browser/spellcheck_host.cc index ceead6b..2d4bef545 100644 --- a/chrome/browser/spellcheck_host.cc +++ b/chrome/browser/spellcheck_host.cc @@ -53,7 +53,7 @@ SpellCheckHost::SpellCheckHost(SpellCheckHostObserver* observer, use_platform_spellchecker_(false), request_context_getter_(request_context_getter) { DCHECK(observer_); - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); FilePath personal_file_directory; PathService::Get(chrome::DIR_USER_DATA, &personal_file_directory); @@ -79,12 +79,12 @@ void SpellCheckHost::Initialize() { return; } - ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE, + BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, NewRunnableMethod(this, &SpellCheckHost::InitializeDictionaryLocation)); } void SpellCheckHost::UnsetObserver() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); observer_ = NULL; request_context_getter_ = NULL; @@ -92,10 +92,10 @@ void SpellCheckHost::UnsetObserver() { } void SpellCheckHost::AddWord(const std::string& word) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); custom_words_.push_back(word); - ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE, + BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, NewRunnableMethod(this, &SpellCheckHost::WriteWordToCustomDictionary, word)); NotificationService::current()->Notify( @@ -146,7 +146,7 @@ int SpellCheckHost::GetSpellCheckLanguages( } void SpellCheckHost::InitializeDictionaryLocation() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); #if defined(OS_WIN) // Check if the dictionary exists in the fallback location. If so, use it @@ -162,7 +162,7 @@ void SpellCheckHost::InitializeDictionaryLocation() { } void SpellCheckHost::InitializeInternal() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); if (!observer_) return; @@ -177,7 +177,7 @@ void SpellCheckHost::InitializeInternal() { request_context_getter_) { // We download from the ui thread because we need to know that // |request_context_getter_| is still valid before initiating the download. - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &SpellCheckHost::DownloadDictionary)); return; } @@ -194,27 +194,27 @@ void SpellCheckHost::InitializeInternal() { custom_words_.push_back(list_of_words[i]); } - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &SpellCheckHost::InformObserverOfInitialization)); } void SpellCheckHost::InitializeOnFileThread() { - DCHECK(!ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::FILE)); - ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE, + BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, NewRunnableMethod(this, &SpellCheckHost::Initialize)); } void SpellCheckHost::InformObserverOfInitialization() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (observer_) observer_->SpellCheckHostInitialized(); } void SpellCheckHost::DownloadDictionary() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!request_context_getter_) { InitializeOnFileThread(); @@ -235,7 +235,7 @@ void SpellCheckHost::DownloadDictionary() { } void SpellCheckHost::WriteWordToCustomDictionary(const std::string& word) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); // Stored in UTF-8. std::string word_to_add(word + "\n"); @@ -252,7 +252,7 @@ void SpellCheckHost::OnURLFetchComplete(const URLFetcher* source, const ResponseCookies& cookies, const std::string& data) { DCHECK(source); - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); fetcher_.reset(); if ((response_code / 100) != 2) { @@ -273,12 +273,12 @@ void SpellCheckHost::OnURLFetchComplete(const URLFetcher* source, } data_ = data; - ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE, + BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, NewRunnableMethod(this, &SpellCheckHost::SaveDictionaryData)); } void SpellCheckHost::SaveDictionaryData() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); size_t bytes_written = file_util::WriteFile(bdict_file_path_, data_.data(), data_.length()); @@ -299,7 +299,7 @@ void SpellCheckHost::SaveDictionaryData() { file_util::Delete(bdict_file_path_, false); // To avoid trying to load a partially saved dictionary, shortcut the // Initialize() call. - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &SpellCheckHost::InformObserverOfInitialization)); return; diff --git a/chrome/browser/spellcheck_host.h b/chrome/browser/spellcheck_host.h index 452ea6a..de25a71 100644 --- a/chrome/browser/spellcheck_host.h +++ b/chrome/browser/spellcheck_host.h @@ -21,7 +21,7 @@ class SpellCheckHostObserver; class URLRequestContextGetter; class SpellCheckHost : public base::RefCountedThreadSafe<SpellCheckHost, - ChromeThread::DeleteOnFileThread>, + BrowserThread::DeleteOnFileThread>, public URLFetcher::Delegate { public: SpellCheckHost(SpellCheckHostObserver* observer, diff --git a/chrome/browser/transport_security_persister.cc b/chrome/browser/transport_security_persister.cc index 5ffaf80..7e80f37 100644 --- a/chrome/browser/transport_security_persister.cc +++ b/chrome/browser/transport_security_persister.cc @@ -22,7 +22,7 @@ TransportSecurityPersister::~TransportSecurityPersister() { void TransportSecurityPersister::Initialize( net::TransportSecurityState* state, const FilePath& profile_path) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); transport_security_state_ = state; state_file_ = profile_path.Append(FILE_PATH_LITERAL("TransportSecurity")); @@ -30,24 +30,24 @@ void TransportSecurityPersister::Initialize( Task* task = NewRunnableMethod(this, &TransportSecurityPersister::Load); - ChromeThread::PostDelayedTask(ChromeThread::FILE, FROM_HERE, task, 1000); + BrowserThread::PostDelayedTask(BrowserThread::FILE, FROM_HERE, task, 1000); } void TransportSecurityPersister::Load() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); std::string state; if (!file_util::ReadFileToString(state_file_, &state)) return; - ChromeThread::PostTask(ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, NewRunnableMethod(this, &TransportSecurityPersister::CompleteLoad, state)); } void TransportSecurityPersister::CompleteLoad(const std::string& state) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); bool dirty = false; if (!transport_security_state_->Deserialise(state, &dirty)) { @@ -60,7 +60,7 @@ void TransportSecurityPersister::CompleteLoad(const std::string& state) { void TransportSecurityPersister::StateIsDirty( net::TransportSecurityState* state) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK(state == transport_security_state_); if (!save_coalescer_.empty()) @@ -72,20 +72,20 @@ void TransportSecurityPersister::StateIsDirty( } void TransportSecurityPersister::Save() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); std::string state; if (!transport_security_state_->Serialise(&state)) return; - ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE, + BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, NewRunnableMethod(this, &TransportSecurityPersister::CompleteSave, state)); } void TransportSecurityPersister::CompleteSave(const std::string& state) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); file_util::WriteFile(state_file_, state.data(), state.size()); } diff --git a/chrome/browser/ui_thread_helpers.h b/chrome/browser/ui_thread_helpers.h index 90e2c4e..f748469 100644 --- a/chrome/browser/ui_thread_helpers.h +++ b/chrome/browser/ui_thread_helpers.h @@ -14,7 +14,7 @@ class Location; namespace ui_thread_helpers { -// This can be used in place of ChromeThread::PostTask(ChromeThread::UI, ...). +// This can be used in place of BrowserThread::PostTask(BrowserThread::UI, ...). // The purpose of this function is to be able to execute Chrome work alongside // native work when a message loop is running nested or, in the case of Mac, // in a different mode. Currently this is used for updating the HostZoomMap diff --git a/chrome/browser/ui_thread_helpers_linux.cc b/chrome/browser/ui_thread_helpers_linux.cc index 41721c3..9ee9822 100644 --- a/chrome/browser/ui_thread_helpers_linux.cc +++ b/chrome/browser/ui_thread_helpers_linux.cc @@ -12,7 +12,7 @@ namespace ui_thread_helpers { bool PostTaskWhileRunningMenu(const tracked_objects::Location& from_here, Task* task) { // TODO(rsesek): Implementing Linux behavior may fix http://crbug.com/48240 - return ChromeThread::PostTask(ChromeThread::UI, from_here, task); + return BrowserThread::PostTask(BrowserThread::UI, from_here, task); } } // namespace ui_thread_helpers diff --git a/chrome/browser/ui_thread_helpers_win.cc b/chrome/browser/ui_thread_helpers_win.cc index 170ecdb..b7d9b3ba 100644 --- a/chrome/browser/ui_thread_helpers_win.cc +++ b/chrome/browser/ui_thread_helpers_win.cc @@ -11,7 +11,7 @@ namespace ui_thread_helpers { bool PostTaskWhileRunningMenu(const tracked_objects::Location& from_here, Task* task) { - return ChromeThread::PostTask(ChromeThread::UI, from_here, task); + return BrowserThread::PostTask(BrowserThread::UI, from_here, task); } } // namespace ui_thread_helpers diff --git a/chrome/browser/upgrade_detector.cc b/chrome/browser/upgrade_detector.cc index f19a6f6..d09896a 100644 --- a/chrome/browser/upgrade_detector.cc +++ b/chrome/browser/upgrade_detector.cc @@ -63,11 +63,11 @@ const int kNotifyUserAfterMs = 0; // because we don't want to block the UI thread while launching a background // process and reading its output; on the Mac, checking for an upgrade // requires reading a file. -const ChromeThread::ID kDetectUpgradeTaskID = +const BrowserThread::ID kDetectUpgradeTaskID = #if defined(OS_POSIX) - ChromeThread::FILE; + BrowserThread::FILE; #else - ChromeThread::UI; + BrowserThread::UI; #endif // This task checks the currently running version of Chrome against the @@ -82,13 +82,13 @@ class DetectUpgradeTask : public Task { virtual ~DetectUpgradeTask() { if (upgrade_detected_task_) { // This has to get deleted on the same thread it was created. - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, - new DeleteTask<Task>(upgrade_detected_task_)); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + new DeleteTask<Task>(upgrade_detected_task_)); } } virtual void Run() { - DCHECK(ChromeThread::CurrentlyOn(kDetectUpgradeTaskID)); + DCHECK(BrowserThread::CurrentlyOn(kDetectUpgradeTaskID)); using installer::Version; scoped_ptr<Version> installed_version; @@ -137,8 +137,8 @@ class DetectUpgradeTask : public Task { // restart in this case as well. See http://crbug.com/46547 if (!installed_version.get() || installed_version->IsHigherThan(running_version.get())) { - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, - upgrade_detected_task_); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + upgrade_detected_task_); upgrade_detected_task_ = NULL; } } @@ -179,12 +179,12 @@ void UpgradeDetector::CheckForUpgrade() { method_factory_.RevokeAll(); Task* callback_task = method_factory_.NewRunnableMethod(&UpgradeDetector::UpgradeDetected); - ChromeThread::PostTask(kDetectUpgradeTaskID, FROM_HERE, - new DetectUpgradeTask(callback_task)); + BrowserThread::PostTask(kDetectUpgradeTaskID, FROM_HERE, + new DetectUpgradeTask(callback_task)); } void UpgradeDetector::UpgradeDetected() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // Stop the recurring timer (that is checking for changes). detect_upgrade_timer_.Stop(); diff --git a/chrome/browser/user_style_sheet_watcher.cc b/chrome/browser/user_style_sheet_watcher.cc index a8789fd..458f0d5 100644 --- a/chrome/browser/user_style_sheet_watcher.cc +++ b/chrome/browser/user_style_sheet_watcher.cc @@ -86,7 +86,7 @@ void UserStyleSheetLoader::OnFilePathChanged(const FilePath& path) { } void UserStyleSheetLoader::LoadStyleSheet(const FilePath& style_sheet_file) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); // We keep the user style sheet in a subdir so we can watch for changes // to the file. FilePath style_sheet_dir = style_sheet_file.DirName(); @@ -110,13 +110,13 @@ void UserStyleSheetLoader::LoadStyleSheet(const FilePath& style_sheet_file) { style_sheet_url = GURL(kDataUrlPrefix + css_base64); } } - ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &UserStyleSheetLoader::SetStyleSheet, style_sheet_url)); } void UserStyleSheetLoader::SetStyleSheet(const GURL& url) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); has_loaded_ = true; user_style_sheet_ = url; @@ -138,8 +138,8 @@ UserStyleSheetWatcher::~UserStyleSheetWatcher() { void UserStyleSheetWatcher::Init() { // Make sure we run on the file thread. - if (!ChromeThread::CurrentlyOn(ChromeThread::FILE)) { - ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE, + if (!BrowserThread::CurrentlyOn(BrowserThread::FILE)) { + BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, NewRunnableMethod(this, &UserStyleSheetWatcher::Init)); return; } diff --git a/chrome/browser/user_style_sheet_watcher.h b/chrome/browser/user_style_sheet_watcher.h index a322837..82f8c43 100644 --- a/chrome/browser/user_style_sheet_watcher.h +++ b/chrome/browser/user_style_sheet_watcher.h @@ -21,7 +21,7 @@ class UserStyleSheetLoader; // whenever the file changes. class UserStyleSheetWatcher : public base::RefCountedThreadSafe<UserStyleSheetWatcher, - ChromeThread::DeleteOnUIThread>, + BrowserThread::DeleteOnUIThread>, public NotificationObserver { public: explicit UserStyleSheetWatcher(const FilePath& profile_path); diff --git a/chrome/browser/user_style_sheet_watcher_unittest.cc b/chrome/browser/user_style_sheet_watcher_unittest.cc index 78c31f2..0cc008a 100644 --- a/chrome/browser/user_style_sheet_watcher_unittest.cc +++ b/chrome/browser/user_style_sheet_watcher_unittest.cc @@ -26,8 +26,8 @@ TEST(UserStyleSheetWatcherTest, StyleLoad) { scoped_refptr<UserStyleSheetWatcher> style_sheet_watcher = new UserStyleSheetWatcher(dir.path()); MessageLoop loop; - ChromeThread ui_thread(ChromeThread::UI, &loop); - ChromeThread file_thread(ChromeThread::FILE, &loop); + BrowserThread ui_thread(BrowserThread::UI, &loop); + BrowserThread file_thread(BrowserThread::FILE, &loop); style_sheet_watcher->Init(); loop.RunAllPending(); diff --git a/chrome/browser/utility_process_host.cc b/chrome/browser/utility_process_host.cc index 74afd4d..22495f8 100644 --- a/chrome/browser/utility_process_host.cc +++ b/chrome/browser/utility_process_host.cc @@ -18,7 +18,7 @@ UtilityProcessHost::UtilityProcessHost(ResourceDispatcherHost* rdh, Client* client, - ChromeThread::ID client_thread_id) + BrowserThread::ID client_thread_id) : BrowserChildProcessHost(UTILITY_PROCESS, rdh), client_(client), client_thread_id_(client_thread_id), @@ -154,13 +154,13 @@ bool UtilityProcessHost::StartProcess(const FilePath& exposed_dir) { } void UtilityProcessHost::OnMessageReceived(const IPC::Message& message) { - ChromeThread::PostTask( + BrowserThread::PostTask( client_thread_id_, FROM_HERE, NewRunnableMethod(client_.get(), &Client::OnMessageReceived, message)); } void UtilityProcessHost::OnProcessCrashed() { - ChromeThread::PostTask( + BrowserThread::PostTask( client_thread_id_, FROM_HERE, NewRunnableMethod(client_.get(), &Client::OnProcessCrashed)); } diff --git a/chrome/browser/utility_process_host.h b/chrome/browser/utility_process_host.h index 8aadf35..cbe3aca 100644 --- a/chrome/browser/utility_process_host.h +++ b/chrome/browser/utility_process_host.h @@ -104,7 +104,7 @@ class UtilityProcessHost : public BrowserChildProcessHost { }; UtilityProcessHost(ResourceDispatcherHost* rdh, Client* client, - ChromeThread::ID client_thread_id); + BrowserThread::ID client_thread_id); virtual ~UtilityProcessHost(); // Start a process to unpack the extension at the given path. The process @@ -163,7 +163,7 @@ class UtilityProcessHost : public BrowserChildProcessHost { // A pointer to our client interface, who will be informed of progress. scoped_refptr<Client> client_; - ChromeThread::ID client_thread_id_; + BrowserThread::ID client_thread_id_; // True when running in batch mode, i.e., StartBatchMode() has been called // and the utility process will run until EndBatchMode(). bool is_batch_mode_; diff --git a/chrome/browser/visitedlink_master.cc b/chrome/browser/visitedlink_master.cc index 6eec909..52509e4 100644 --- a/chrome/browser/visitedlink_master.cc +++ b/chrome/browser/visitedlink_master.cc @@ -529,8 +529,8 @@ bool VisitedLinkMaster::WriteFullTable() { hash_table_, table_length_ * sizeof(Fingerprint)); // The hash table may have shrunk, so make sure this is the end. - ChromeThread::PostTask( - ChromeThread::FILE, FROM_HERE, new AsyncSetEndOfFile(file_)); + BrowserThread::PostTask( + BrowserThread::FILE, FROM_HERE, new AsyncSetEndOfFile(file_)); return true; } @@ -728,8 +728,8 @@ void VisitedLinkMaster::FreeURLTable() { if (!file_) return; - ChromeThread::PostTask( - ChromeThread::FILE, FROM_HERE, new AsyncCloseHandle(file_)); + BrowserThread::PostTask( + BrowserThread::FILE, FROM_HERE, new AsyncCloseHandle(file_)); } bool VisitedLinkMaster::ResizeTableIfNecessary() { @@ -909,8 +909,8 @@ void VisitedLinkMaster::WriteToFile(FILE* file, posted_asynchronous_operation_ = true; #endif - ChromeThread::PostTask( - ChromeThread::FILE, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::FILE, FROM_HERE, new AsyncWriter(file, offset, data, data_size)); } @@ -986,8 +986,8 @@ void VisitedLinkMaster::TableBuilder::OnComplete(bool success) { // Marshal to the main thread to notify the VisitedLinkMaster that the // rebuild is complete. - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &TableBuilder::OnCompleteMainThread)); } diff --git a/chrome/browser/visitedlink_unittest.cc b/chrome/browser/visitedlink_unittest.cc index f07e80f..d5eece3 100644 --- a/chrome/browser/visitedlink_unittest.cc +++ b/chrome/browser/visitedlink_unittest.cc @@ -74,8 +74,8 @@ class TrackingVisitedLinkEventListener : public VisitedLinkMaster::Listener { class VisitedLinkTest : public testing::Test { protected: VisitedLinkTest() - : ui_thread_(ChromeThread::UI, &message_loop_), - file_thread_(ChromeThread::FILE, &message_loop_) {} + : ui_thread_(BrowserThread::UI, &message_loop_), + file_thread_(BrowserThread::FILE, &message_loop_) {} // Initialize the history system. This should be called before InitVisited(). bool InitHistory() { history_service_ = new HistoryService; @@ -177,8 +177,8 @@ class VisitedLinkTest : public testing::Test { ScopedTempDir temp_dir_; MessageLoop message_loop_; - ChromeThread ui_thread_; - ChromeThread file_thread_; + BrowserThread ui_thread_; + BrowserThread file_thread_; // Filenames for the services; FilePath history_dir_; @@ -582,7 +582,7 @@ class VisitedLinkEventsTest : public RenderViewHostTestHarness { public: VisitedLinkEventsTest() : RenderViewHostTestHarness(), - file_thread_(ChromeThread::FILE, &message_loop_) {} + file_thread_(BrowserThread::FILE, &message_loop_) {} ~VisitedLinkEventsTest() { // This ends up using the file thread to schedule the delete. profile_.reset(); @@ -613,7 +613,7 @@ class VisitedLinkEventsTest : public RenderViewHostTestHarness { private: scoped_ptr<VisitedLinkEventListener> event_listener_; - ChromeThread file_thread_; + BrowserThread file_thread_; DISALLOW_COPY_AND_ASSIGN(VisitedLinkEventsTest); }; diff --git a/chrome/common/net/test_url_fetcher_factory.h b/chrome/common/net/test_url_fetcher_factory.h index b34c0a1..a831e3a 100644 --- a/chrome/common/net/test_url_fetcher_factory.h +++ b/chrome/common/net/test_url_fetcher_factory.h @@ -22,7 +22,7 @@ // // TestURLFetcher requires a MessageLoop: // MessageLoopForUI message_loop; // // And io_thread to release URLRequestContextGetter in URLFetcher::Core. -// ChromeThread io_thread(ChromeThread::IO, &message_loop); +// BrowserThread io_thread(BrowserThread::IO, &message_loop); // // Create and register factory. // TestURLFetcherFactory factory; // URLFetcher::set_factory(&factory); diff --git a/chrome/common/notification_service.cc b/chrome/common/notification_service.cc index cd92bb3..f04f554 100644 --- a/chrome/common/notification_service.cc +++ b/chrome/common/notification_service.cc @@ -66,7 +66,7 @@ void NotificationService::RemoveObserver(NotificationObserver* observer, // the wrong thread, and as a result another thread's NotificationService // has its deleted pointer in its map. A garbge object will be called in the // future. - // NOTE: when this check shows crashes, use ChromeThread::DeleteOnIOThread or + // NOTE: when this check shows crashes, use BrowserThread::DeleteOnIOThread or // other variants as the trait on the object. CHECK(HasKey(observers_[type.value], source)); diff --git a/chrome/test/browser_with_test_window_test.cc b/chrome/test/browser_with_test_window_test.cc index 814046d..9813dfd 100644 --- a/chrome/test/browser_with_test_window_test.cc +++ b/chrome/test/browser_with_test_window_test.cc @@ -17,7 +17,7 @@ #include "chrome/test/testing_profile.h" BrowserWithTestWindowTest::BrowserWithTestWindowTest() - : ui_thread_(ChromeThread::UI, message_loop()), + : ui_thread_(BrowserThread::UI, message_loop()), rph_factory_(), rvh_factory_(&rph_factory_) { #if defined(OS_WIN) diff --git a/chrome/test/browser_with_test_window_test.h b/chrome/test/browser_with_test_window_test.h index c57a2f9..22db146 100644 --- a/chrome/test/browser_with_test_window_test.h +++ b/chrome/test/browser_with_test_window_test.h @@ -90,7 +90,7 @@ class BrowserWithTestWindowTest : public testing::Test { // We need to create a MessageLoop, otherwise a bunch of things fails. MessageLoopForUI ui_loop_; - ChromeThread ui_thread_; + BrowserThread ui_thread_; scoped_ptr<TestingProfile> profile_; scoped_ptr<TestBrowserWindow> window_; diff --git a/chrome/test/in_process_browser_test.cc b/chrome/test/in_process_browser_test.cc index 0c9b957..a44a99a 100644 --- a/chrome/test/in_process_browser_test.cc +++ b/chrome/test/in_process_browser_test.cc @@ -308,8 +308,8 @@ void InProcessBrowserTest::RunTestOnMainThreadLoop() { } pool.Recycle(); - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, NewRunnableFunction(chrome_browser_net::SetUrlRequestMocksEnabled, true)); browser_ = CreateBrowser(profile); diff --git a/chrome/test/live_sync/live_autofill_sync_test.h b/chrome/test/live_sync/live_autofill_sync_test.h index 48c1db2..f591488 100644 --- a/chrome/test/live_sync/live_autofill_sync_test.h +++ b/chrome/test/live_sync/live_autofill_sync_test.h @@ -54,9 +54,9 @@ class GetAllAutofillEntries done_event_(false, false) {} void Init() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); - ChromeThread::PostTask( - ChromeThread::DB, + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + BrowserThread::PostTask( + BrowserThread::DB, FROM_HERE, NewRunnableMethod(this, &GetAllAutofillEntries::Run)); done_event_.Wait(); @@ -70,7 +70,7 @@ class GetAllAutofillEntries friend class base::RefCountedThreadSafe<GetAllAutofillEntries>; void Run() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); web_data_service_->GetDatabase()->GetAllAutofillEntries(&entries_); done_event_.Signal(); } diff --git a/chrome/test/live_sync/live_sync_test.cc b/chrome/test/live_sync/live_sync_test.cc index 807390c..d9f1f32 100644 --- a/chrome/test/live_sync/live_sync_test.cc +++ b/chrome/test/live_sync/live_sync_test.cc @@ -385,8 +385,8 @@ void LiveSyncTest::DisableNetwork(Profile* profile) { void LiveSyncTest::SetProxyConfig(URLRequestContextGetter* context_getter, const net::ProxyConfig& proxy_config) { base::WaitableEvent done(false, false); - ChromeThread::PostTask( - ChromeThread::IO, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, new SetProxyConfigTask(&done, context_getter, diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc index 45362d6..7fdae5e 100644 --- a/chrome/test/testing_profile.cc +++ b/chrome/test/testing_profile.cc @@ -112,7 +112,7 @@ class BookmarkLoadObserver : public BookmarkModelObserver { // Used to return a dummy context (normally the context is on the IO thread). // The one here can be run on the main test thread. Note that this can lead to -// a leak if your test does not have a ChromeThread::IO in it because +// a leak if your test does not have a BrowserThread::IO in it because // URLRequestContextGetter is defined as a ReferenceCounted object with a // special trait that deletes it on the IO thread. class TestURLRequestContextGetter : public URLRequestContextGetter { @@ -123,7 +123,7 @@ class TestURLRequestContextGetter : public URLRequestContextGetter { return context_.get(); } virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() { - return ChromeThread::GetMessageLoopProxyForThread(ChromeThread::IO); + return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); } private: @@ -148,7 +148,7 @@ class TestExtensionURLRequestContextGetter : public URLRequestContextGetter { return context_.get(); } virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() { - return ChromeThread::GetMessageLoopProxyForThread(ChromeThread::IO); + return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); } private: @@ -466,7 +466,7 @@ NTPResourceCache* TestingProfile::GetNTPResourceCache() { } DesktopNotificationService* TestingProfile::GetDesktopNotificationService() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!desktop_notification_service_.get()) { desktop_notification_service_.reset(new DesktopNotificationService( this, NULL)); diff --git a/chrome/test/thread_observer_helper.h b/chrome/test/thread_observer_helper.h index 3a6dbcd..2ba46cf 100644 --- a/chrome/test/thread_observer_helper.h +++ b/chrome/test/thread_observer_helper.h @@ -18,12 +18,12 @@ template <class T, typename Traits> class ThreadObserverHelper : public base::RefCountedThreadSafe<T, Traits> { public: - explicit ThreadObserverHelper(ChromeThread::ID id) + explicit ThreadObserverHelper(BrowserThread::ID id) : id_(id), done_event_(false, false) {} void Init() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); - ChromeThread::PostTask( + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + BrowserThread::PostTask( id_, FROM_HERE, NewRunnableMethod(this, &ThreadObserverHelper::RegisterObserversTask)); @@ -31,7 +31,7 @@ class ThreadObserverHelper : public base::RefCountedThreadSafe<T, Traits> { } virtual ~ThreadObserverHelper() { - DCHECK(ChromeThread::CurrentlyOn(id_)); + DCHECK(BrowserThread::CurrentlyOn(id_)); registrar_.RemoveAll(); } @@ -49,23 +49,23 @@ class ThreadObserverHelper : public base::RefCountedThreadSafe<T, Traits> { private: void RegisterObserversTask() { - DCHECK(ChromeThread::CurrentlyOn(id_)); + DCHECK(BrowserThread::CurrentlyOn(id_)); RegisterObservers(); done_event_.Signal(); } - ChromeThread::ID id_; + BrowserThread::ID id_; base::WaitableEvent done_event_; }; class DBThreadObserverHelper; typedef ThreadObserverHelper< DBThreadObserverHelper, - ChromeThread::DeleteOnDBThread> DBThreadObserverHelperBase; + BrowserThread::DeleteOnDBThread> DBThreadObserverHelperBase; class DBThreadObserverHelper : public DBThreadObserverHelperBase { public: - DBThreadObserverHelper() : DBThreadObserverHelperBase(ChromeThread::DB) {} + DBThreadObserverHelper() : DBThreadObserverHelperBase(BrowserThread::DB) {} }; #endif // CHROME_TEST_THREAD_OBSERVER_HELPER_H__ diff --git a/chrome/test/thread_test_helper.h b/chrome/test/thread_test_helper.h index 8dd7a8c..ea5c923 100644 --- a/chrome/test/thread_test_helper.h +++ b/chrome/test/thread_test_helper.h @@ -17,7 +17,7 @@ // executed. class ThreadTestHelper : public base::RefCountedThreadSafe<ThreadTestHelper> { public: - explicit ThreadTestHelper(ChromeThread::ID thread_id) + explicit ThreadTestHelper(BrowserThread::ID thread_id) : test_result_(false), thread_id_(thread_id), done_event_(false, false) { @@ -25,7 +25,7 @@ class ThreadTestHelper : public base::RefCountedThreadSafe<ThreadTestHelper> { // True if RunTest() was successfully executed on the target thread. bool Run() WARN_UNUSED_RESULT { - if (!ChromeThread::PostTask(thread_id_, FROM_HERE, NewRunnableMethod( + if (!BrowserThread::PostTask(thread_id_, FROM_HERE, NewRunnableMethod( this, &ThreadTestHelper::RunInThread))) { return false; } @@ -50,7 +50,7 @@ class ThreadTestHelper : public base::RefCountedThreadSafe<ThreadTestHelper> { } bool test_result_; - ChromeThread::ID thread_id_; + BrowserThread::ID thread_id_; base::WaitableEvent done_event_; DISALLOW_COPY_AND_ASSIGN(ThreadTestHelper); |