summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-09 12:42:18 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-09 12:42:18 +0000
commitca4b5fa384e6ac932826d178f374d0d23e1296af (patch)
tree2bfcc573f6fb02e9b6f861eb55ac68e51cd07dd8 /chrome
parentd8660e5d5b34ee34f1a0ca04a7a1758cf528ced1 (diff)
downloadchromium_src-ca4b5fa384e6ac932826d178f374d0d23e1296af.zip
chromium_src-ca4b5fa384e6ac932826d178f374d0d23e1296af.tar.gz
chromium_src-ca4b5fa384e6ac932826d178f374d0d23e1296af.tar.bz2
Rename ChromeThread to BrowserThread Part10:
- Rename entries under download and extensions. BUG=56926 TEST=trybots Review URL: http://codereview.chromium.org/3685001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62081 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/download/base_file.cc20
-rw-r--r--chrome/browser/download/base_file_unittest.cc6
-rw-r--r--chrome/browser/download/download_file.cc14
-rw-r--r--chrome/browser/download/download_file_manager.cc70
-rw-r--r--chrome/browser/download/download_item.cc14
-rw-r--r--chrome/browser/download/download_manager.cc62
-rw-r--r--chrome/browser/download/download_manager.h2
-rw-r--r--chrome/browser/download/download_manager_unittest.cc6
-rw-r--r--chrome/browser/download/download_prefs.cc4
-rw-r--r--chrome/browser/download/download_request_limiter.cc14
-rw-r--r--chrome/browser/download/download_request_limiter_unittest.cc5
-rw-r--r--chrome/browser/download/download_util.cc6
-rw-r--r--chrome/browser/download/drag_download_file.cc8
-rw-r--r--chrome/browser/download/drag_download_util.cc8
-rw-r--r--chrome/browser/download/save_file.cc4
-rw-r--r--chrome/browser/download/save_file_manager.cc98
-rw-r--r--chrome/browser/download/save_package.cc46
-rw-r--r--chrome/browser/extensions/autoupdate_interceptor.cc8
-rw-r--r--chrome/browser/extensions/crx_installer.cc56
-rw-r--r--chrome/browser/extensions/extension_cookies_api.cc40
-rw-r--r--chrome/browser/extensions/extension_data_deleter.cc20
-rw-r--r--chrome/browser/extensions/extension_data_deleter.h2
-rw-r--r--chrome/browser/extensions/extension_function_dispatcher.cc4
-rw-r--r--chrome/browser/extensions/extension_icon_manager_unittest.cc12
-rw-r--r--chrome/browser/extensions/extension_info_map.cc2
-rw-r--r--chrome/browser/extensions/extension_info_map_unittest.cc8
-rw-r--r--chrome/browser/extensions/extension_menu_manager_unittest.cc2
-rw-r--r--chrome/browser/extensions/extension_updater.cc32
-rw-r--r--chrome/browser/extensions/extension_updater_unittest.cc26
-rw-r--r--chrome/browser/extensions/extensions_service.cc94
-rw-r--r--chrome/browser/extensions/extensions_service.h2
-rw-r--r--chrome/browser/extensions/extensions_service_unittest.cc22
-rw-r--r--chrome/browser/extensions/extensions_service_unittest.h10
-rw-r--r--chrome/browser/extensions/extensions_ui.cc12
-rw-r--r--chrome/browser/extensions/file_reader.cc4
-rw-r--r--chrome/browser/extensions/file_reader_unittest.cc4
-rw-r--r--chrome/browser/extensions/image_loading_tracker.cc20
-rw-r--r--chrome/browser/extensions/image_loading_tracker_unittest.cc12
-rw-r--r--chrome/browser/extensions/pack_extension_job.cc10
-rw-r--r--chrome/browser/extensions/pack_extension_job.h2
-rw-r--r--chrome/browser/extensions/sandboxed_extension_unpacker.cc14
-rw-r--r--chrome/browser/extensions/sandboxed_extension_unpacker.h2
-rw-r--r--chrome/browser/extensions/test_extension_prefs.cc2
-rw-r--r--chrome/browser/extensions/user_script_listener.cc30
-rw-r--r--chrome/browser/extensions/user_script_master.cc8
-rw-r--r--chrome/browser/extensions/user_script_master.h2
-rw-r--r--chrome/browser/extensions/user_script_master_unittest.cc6
47 files changed, 428 insertions, 427 deletions
diff --git a/chrome/browser/download/base_file.cc b/chrome/browser/download/base_file.cc
index f50c1f1..4911d22 100644
--- a/chrome/browser/download/base_file.cc
+++ b/chrome/browser/download/base_file.cc
@@ -29,18 +29,18 @@ BaseFile::BaseFile(const FilePath& full_path,
file_stream_(file_stream),
bytes_so_far_(received_bytes),
power_save_blocker_(true) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
}
BaseFile::~BaseFile() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
if (in_progress())
Cancel();
Close();
}
bool BaseFile::Initialize() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
if (!full_path_.empty() ||
download_util::CreateTemporaryFileForDownload(&full_path_))
return Open();
@@ -48,7 +48,7 @@ bool BaseFile::Initialize() {
}
bool BaseFile::AppendDataToFile(const char* data, size_t data_len) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
if (!file_stream_.get())
return false;
@@ -65,7 +65,7 @@ bool BaseFile::AppendDataToFile(const char* data, size_t data_len) {
}
bool BaseFile::Rename(const FilePath& new_path, bool is_final_rename) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
// Save the information whether the download is in progress because
// it will be overwritten by closing the file.
@@ -129,19 +129,19 @@ bool BaseFile::Rename(const FilePath& new_path, bool is_final_rename) {
}
void BaseFile::Cancel() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
Close();
if (!full_path_.empty())
file_util::Delete(full_path_, false);
}
void BaseFile::Finish() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
Close();
}
void BaseFile::AnnotateWithSourceInformation() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
#if defined(OS_WIN)
// Sets the Zone to tell Windows that this file comes from the internet.
// We ignore the return value because a failure is not fatal.
@@ -155,7 +155,7 @@ void BaseFile::AnnotateWithSourceInformation() {
}
bool BaseFile::Open() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DCHECK(!full_path_.empty());
// Create a new file steram if it is not provided.
@@ -183,7 +183,7 @@ bool BaseFile::Open() {
}
void BaseFile::Close() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
if (file_stream_.get()) {
#if defined(OS_CHROMEOS)
// Currently we don't really care about the return value, since if it fails
diff --git a/chrome/browser/download/base_file_unittest.cc b/chrome/browser/download/base_file_unittest.cc
index 3c135aa..8138da8 100644
--- a/chrome/browser/download/base_file_unittest.cc
+++ b/chrome/browser/download/base_file_unittest.cc
@@ -18,7 +18,7 @@ const char kTestData3[] = "Final line.";
class BaseFileTest : public testing::Test {
public:
- BaseFileTest() : file_thread_(ChromeThread::FILE, &message_loop_) {
+ BaseFileTest() : file_thread_(BrowserThread::FILE, &message_loop_) {
}
virtual void SetUp() {
@@ -39,7 +39,7 @@ class BaseFileTest : public testing::Test {
EXPECT_EQ(expected_data_, disk_data);
}
- // Make sure the mock ChromeThread outlives the BaseFile to satisfy
+ // Make sure the mock BrowserThread outlives the BaseFile to satisfy
// thread checks inside it.
base_file_.reset();
}
@@ -67,7 +67,7 @@ class BaseFileTest : public testing::Test {
// Mock file thread to satisfy debug checks in BaseFile.
MessageLoop message_loop_;
- ChromeThread file_thread_;
+ BrowserThread file_thread_;
};
// Test the most basic scenario: just create the object and do a sanity check
diff --git a/chrome/browser/download/download_file.cc b/chrome/browser/download/download_file.cc
index 6bf41c7..292c30f 100644
--- a/chrome/browser/download/download_file.cc
+++ b/chrome/browser/download/download_file.cc
@@ -21,24 +21,24 @@ DownloadFile::DownloadFile(const DownloadCreateInfo* info,
child_id_(info->child_id),
request_id_(info->request_id),
download_manager_(download_manager) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
}
DownloadFile::~DownloadFile() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
}
void DownloadFile::DeleteCrDownload() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
FilePath crdownload = download_util::GetCrDownloadPath(full_path_);
file_util::Delete(crdownload, false);
}
void DownloadFile::CancelDownloadRequest(ResourceDispatcherHost* rdh) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableFunction(&download_util::CancelDownloadRequest,
rdh,
child_id_,
@@ -46,6 +46,6 @@ void DownloadFile::CancelDownloadRequest(ResourceDispatcherHost* rdh) {
}
DownloadManager* DownloadFile::GetDownloadManager() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
return download_manager_.get();
}
diff --git a/chrome/browser/download/download_file_manager.cc b/chrome/browser/download/download_file_manager.cc
index fc94314..b053adc 100644
--- a/chrome/browser/download/download_file_manager.cc
+++ b/chrome/browser/download/download_file_manager.cc
@@ -37,7 +37,7 @@ const int kUpdatePeriodMs = 500;
DownloadManager* DownloadManagerForRenderViewHost(int render_process_id,
int render_view_id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
TabContents* contents = tab_util::GetTabContentsByID(render_process_id,
render_view_id);
@@ -62,27 +62,27 @@ DownloadFileManager::~DownloadFileManager() {
}
void DownloadFileManager::Shutdown() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(this, &DownloadFileManager::OnShutdown));
}
void DownloadFileManager::OnShutdown() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
StopUpdateTimer();
STLDeleteValues(&downloads_);
}
void DownloadFileManager::CreateDownloadFile(
DownloadCreateInfo* info, DownloadManager* download_manager) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
scoped_ptr<DownloadFile> download_file(
new DownloadFile(info, download_manager));
if (!download_file->Initialize()) {
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableFunction(&download_util::CancelDownloadRequest,
resource_dispatcher_host_,
info->child_id,
@@ -97,21 +97,21 @@ void DownloadFileManager::CreateDownloadFile(
info->path = info->save_info.file_path;
// The file is now ready, we can un-pause the request and start saving data.
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this, &DownloadFileManager::ResumeDownloadRequest,
info->child_id, info->request_id));
StartUpdateTimer();
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(download_manager,
&DownloadManager::StartDownload, info));
}
void DownloadFileManager::ResumeDownloadRequest(int child_id, int request_id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// This balances the pause in DownloadResourceHandler::OnResponseStarted.
resource_dispatcher_host_->PauseRequest(child_id, request_id, false);
@@ -123,7 +123,7 @@ DownloadFile* DownloadFileManager::GetDownloadFile(int id) {
}
void DownloadFileManager::StartUpdateTimer() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
if (!update_timer_.IsRunning()) {
update_timer_.Start(base::TimeDelta::FromMilliseconds(kUpdatePeriodMs),
this, &DownloadFileManager::UpdateInProgressDownloads);
@@ -131,19 +131,19 @@ void DownloadFileManager::StartUpdateTimer() {
}
void DownloadFileManager::StopUpdateTimer() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
update_timer_.Stop();
}
void DownloadFileManager::UpdateInProgressDownloads() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
for (DownloadFileMap::iterator i = downloads_.begin();
i != downloads_.end(); ++i) {
int id = i->first;
DownloadFile* download_file = i->second;
DownloadManager* manager = download_file->GetDownloadManager();
if (manager) {
- ChromeThread::PostTask(ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
NewRunnableMethod(manager, &DownloadManager::UpdateDownload,
id, download_file->bytes_so_far()));
}
@@ -153,19 +153,19 @@ void DownloadFileManager::UpdateInProgressDownloads() {
// Called on the IO thread once the ResourceDispatcherHost has decided that a
// request is a download.
int DownloadFileManager::GetNextId() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
return next_id_++;
}
void DownloadFileManager::StartDownload(DownloadCreateInfo* info) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(info);
DownloadManager* manager = DownloadManagerForRenderViewHost(
info->child_id, info->render_view_id);
if (!manager) {
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableFunction(&download_util::CancelDownloadRequest,
resource_dispatcher_host_,
info->child_id,
@@ -174,7 +174,7 @@ void DownloadFileManager::StartDownload(DownloadCreateInfo* info) {
return;
}
- ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(this, &DownloadFileManager::CreateDownloadFile,
info, manager));
}
@@ -185,7 +185,7 @@ void DownloadFileManager::StartDownload(DownloadCreateInfo* info) {
// thread gets the cancel message: we just delete the data since the
// DownloadFile has been deleted.
void DownloadFileManager::UpdateDownload(int id, DownloadBuffer* buffer) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
std::vector<DownloadBuffer::Contents> contents;
{
AutoLock auto_lock(buffer->lock);
@@ -203,7 +203,7 @@ void DownloadFileManager::UpdateDownload(int id, DownloadBuffer* buffer) {
}
void DownloadFileManager::OnResponseCompleted(int id, DownloadBuffer* buffer) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
delete buffer;
DownloadFileMap::iterator it = downloads_.find(id);
if (it != downloads_.end()) {
@@ -212,8 +212,8 @@ void DownloadFileManager::OnResponseCompleted(int id, DownloadBuffer* buffer) {
DownloadManager* download_manager = download->GetDownloadManager();
if (download_manager) {
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(
download_manager, &DownloadManager::OnAllDataSaved,
id, download->bytes_so_far()));
@@ -235,7 +235,7 @@ void DownloadFileManager::OnResponseCompleted(int id, DownloadBuffer* buffer) {
// run on the download thread. Since this message has been sent from the UI
// thread, the download may have already completed and won't exist in our map.
void DownloadFileManager::CancelDownload(int id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DownloadFileMap::iterator it = downloads_.find(id);
if (it != downloads_.end()) {
DownloadFile* download = it->second;
@@ -252,7 +252,7 @@ void DownloadFileManager::CancelDownload(int id) {
}
void DownloadFileManager::OnDownloadManagerShutdown(DownloadManager* manager) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DCHECK(manager);
std::set<DownloadFile*> to_remove;
@@ -280,7 +280,7 @@ void DownloadFileManager::OnDownloadManagerShutdown(DownloadManager* manager) {
void DownloadFileManager::OnIntermediateDownloadName(
int id, const FilePath& full_path, DownloadManager* download_manager)
{
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DownloadFileMap::iterator it = downloads_.find(id);
if (it == downloads_.end())
return;
@@ -307,7 +307,7 @@ void DownloadFileManager::OnFinalDownloadName(int id,
const FilePath& full_path,
bool need_delete_crdownload,
DownloadManager* manager) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DownloadFile* download = GetDownloadFile(id);
if (!download)
@@ -319,8 +319,8 @@ void DownloadFileManager::OnFinalDownloadName(int id,
// http://crbug.com/13120 for details.
download->AnnotateWithSourceInformation();
#endif
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(
manager, &DownloadManager::DownloadRenamedToFinalName, id,
full_path));
@@ -347,7 +347,7 @@ void DownloadFileManager::OnFinalDownloadName(int id,
// Called only from OnFinalDownloadName or OnIntermediateDownloadName
// on the FILE thread.
void DownloadFileManager::CancelDownloadOnRename(int id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DownloadFile* download = GetDownloadFile(id);
if (!download)
@@ -359,8 +359,8 @@ void DownloadFileManager::CancelDownloadOnRename(int id) {
return;
}
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(download_manager,
&DownloadManager::DownloadCancelled, id));
}
diff --git a/chrome/browser/download/download_item.cc b/chrome/browser/download/download_item.cc
index 787b8ad..b1788de 100644
--- a/chrome/browser/download/download_item.cc
+++ b/chrome/browser/download/download_item.cc
@@ -28,7 +28,7 @@ namespace {
const int kUpdateTimeMs = 1000;
void DeleteDownloadedFile(const FilePath& path) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
// Make sure we only delete files.
if (!file_util::DirectoryExists(path))
@@ -201,8 +201,8 @@ void DownloadItem::OpenDownload() {
// Mac OS X requires opening downloads on the UI thread.
platform_util::OpenItem(full_path());
#else
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableFunction(&platform_util::OpenItem, full_path()));
#endif
}
@@ -213,8 +213,8 @@ void DownloadItem::ShowDownloadInShell() {
// Mac needs to run this operation on the UI thread.
platform_util::ShowItemInFolder(full_path());
#else
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableFunction(&platform_util::ShowItemInFolder,
full_path()));
#endif
@@ -307,8 +307,8 @@ void DownloadItem::Remove(bool delete_on_disk) {
Cancel(true);
state_ = REMOVING;
if (delete_on_disk) {
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableFunction(&DeleteDownloadedFile, full_path_));
}
download_manager_->RemoveDownload(db_handle_);
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc
index b90feaf..7faa64a 100644
--- a/chrome/browser/download/download_manager.cc
+++ b/chrome/browser/download/download_manager.cc
@@ -73,7 +73,7 @@ void DownloadManager::Shutdown() {
FOR_EACH_OBSERVER(Observer, observers_, ManagerGoingDown());
if (file_manager_) {
- ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(file_manager_,
&DownloadFileManager::OnDownloadManagerShutdown,
this));
@@ -250,7 +250,7 @@ bool DownloadManager::Init(Profile* profile) {
// point. OnCreateDatabaseEntryComplete() handles that finalization of the the
// download creation as a callback from the history thread.
void DownloadManager::StartDownload(DownloadCreateInfo* info) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(info);
// Check whether this download is for an extension install or not.
@@ -302,8 +302,8 @@ void DownloadManager::StartDownload(DownloadCreateInfo* info) {
// the suggested path on the UI thread.
// We can only access preferences on the UI thread, so check the download path
// now and pass the value to the FILE thread.
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
this,
&DownloadManager::CheckIfSuggestedPathExists,
@@ -313,7 +313,7 @@ void DownloadManager::StartDownload(DownloadCreateInfo* info) {
void DownloadManager::CheckIfSuggestedPathExists(DownloadCreateInfo* info,
const FilePath& default_path) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DCHECK(info);
// Make sure the default download directory exists.
@@ -378,15 +378,15 @@ void DownloadManager::CheckIfSuggestedPathExists(DownloadCreateInfo* info,
info->suggested_path), "", 0);
}
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this,
&DownloadManager::OnPathExistenceAvailable,
info));
}
void DownloadManager::OnPathExistenceAvailable(DownloadCreateInfo* info) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(info);
if (info->prompt_user_for_save_location) {
@@ -417,7 +417,7 @@ void DownloadManager::OnPathExistenceAvailable(DownloadCreateInfo* info) {
void DownloadManager::CreateDownloadItem(DownloadCreateInfo* info,
const FilePath& target_path) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
scoped_ptr<DownloadCreateInfo> infop(info);
info->path = target_path;
@@ -434,8 +434,8 @@ void DownloadManager::CreateDownloadItem(DownloadCreateInfo* info,
// The download has already finished or the download is not safe.
// We can now rename the file to its final name (or its tentative name
// in dangerous download cases).
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
file_manager_, &DownloadFileManager::OnFinalDownloadName,
download->id(), target_path, !info->is_dangerous, this));
@@ -443,8 +443,8 @@ void DownloadManager::CreateDownloadItem(DownloadCreateInfo* info,
// The download hasn't finished and it is a safe download. We need to
// rename it to its intermediate '.crdownload' path.
FilePath download_path = download_util::GetCrDownloadPath(target_path);
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
file_manager_, &DownloadFileManager::OnIntermediateDownloadName,
download->id(), download_path, this));
@@ -519,8 +519,8 @@ void DownloadManager::OnAllDataSaved(int32 download_id, int64 size) {
if (download->safety_state() == DownloadItem::DANGEROUS_BUT_VALIDATED) {
// We first need to rename the downloaded file from its temporary name to
// its final name before we can continue.
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
this, &DownloadManager::ProceedWithFinishedDangerousDownload,
download->db_handle(),
@@ -529,8 +529,8 @@ void DownloadManager::OnAllDataSaved(int32 download_id, int64 size) {
}
if (download->need_final_rename()) {
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
file_manager_, &DownloadFileManager::OnFinalDownloadName,
download->id(), download->full_path(), false, this));
@@ -542,7 +542,7 @@ void DownloadManager::OnAllDataSaved(int32 download_id, int64 size) {
void DownloadManager::DownloadRenamedToFinalName(int download_id,
const FilePath& full_path) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DownloadItem* item = GetDownloadItem(download_id);
if (!item)
@@ -558,7 +558,7 @@ void DownloadManager::DownloadRenamedToFinalName(int download_id,
}
void DownloadManager::ContinueDownloadFinished(DownloadItem* download) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// If this was a dangerous download, it has now been approved and must be
// removed from dangerous_finished_ so it does not get deleted on shutdown.
@@ -590,8 +590,8 @@ void DownloadManager::ProceedWithFinishedDangerousDownload(
NOTREACHED();
}
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this, &DownloadManager::DangerousDownloadRenamed,
download_handle, success, new_path, uniquifier));
}
@@ -643,15 +643,15 @@ void DownloadManager::DownloadCancelledInternal(int download_id,
int render_process_id,
int request_id) {
// Cancel the network request. RDH is guaranteed to outlive the IO thread.
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableFunction(&download_util::CancelDownloadRequest,
g_browser_process->resource_dispatcher_host(),
render_process_id,
request_id));
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
file_manager_, &DownloadFileManager::CancelDownload, download_id));
}
@@ -665,8 +665,8 @@ void DownloadManager::PauseDownload(int32 download_id, bool pause) {
if (pause == download->is_paused())
return;
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this,
&DownloadManager::PauseDownloadRequest,
g_browser_process->resource_dispatcher_host(),
@@ -690,7 +690,7 @@ void DownloadManager::PauseDownloadRequest(ResourceDispatcherHost* rdh,
int render_process_id,
int request_id,
bool pause) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
rdh->PauseRequest(render_process_id, request_id, pause);
}
@@ -791,7 +791,7 @@ void DownloadManager::DownloadUrlToFile(const GURL& url,
const DownloadSaveInfo& save_info,
TabContents* tab_contents) {
DCHECK(tab_contents);
- ChromeThread::PostTask(ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
NewRunnableFunction(&download_util::DownloadUrl,
url,
referrer,
@@ -887,8 +887,8 @@ void DownloadManager::DangerousDownloadValidated(DownloadItem* download) {
if (download->state() != DownloadItem::COMPLETE)
return;
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
this, &DownloadManager::ProceedWithFinishedDangerousDownload,
download->db_handle(), download->full_path(),
diff --git a/chrome/browser/download/download_manager.h b/chrome/browser/download/download_manager.h
index 8cacf02..0a90816 100644
--- a/chrome/browser/download/download_manager.h
+++ b/chrome/browser/download/download_manager.h
@@ -60,7 +60,7 @@ struct DownloadSaveInfo;
// Browser's download manager: manages all downloads and destination view.
class DownloadManager
: public base::RefCountedThreadSafe<DownloadManager,
- ChromeThread::DeleteOnUIThread>,
+ BrowserThread::DeleteOnUIThread>,
public DownloadStatusUpdaterDelegate,
public SelectFileDialog::Listener {
// For testing.
diff --git a/chrome/browser/download/download_manager_unittest.cc b/chrome/browser/download/download_manager_unittest.cc
index af2a59a..a1fb8cb 100644
--- a/chrome/browser/download/download_manager_unittest.cc
+++ b/chrome/browser/download/download_manager_unittest.cc
@@ -37,7 +37,7 @@ class DownloadManagerTest : public testing::Test {
DownloadManagerTest()
: profile_(new TestingProfile()),
download_manager_(new MockDownloadManager(&download_status_updater_)),
- ui_thread_(ChromeThread::UI, &message_loop_) {
+ ui_thread_(BrowserThread::UI, &message_loop_) {
download_manager_->Init(profile_.get());
}
@@ -60,7 +60,7 @@ class DownloadManagerTest : public testing::Test {
scoped_refptr<DownloadManager> download_manager_;
scoped_refptr<DownloadFileManager> file_manager_;
MessageLoopForUI message_loop_;
- ChromeThread ui_thread_;
+ BrowserThread ui_thread_;
DownloadFileManager* file_manager() {
if (!file_manager_) {
@@ -213,7 +213,7 @@ TEST_F(DownloadManagerTest, DownloadRenameTest) {
using ::testing::Invoke;
using ::testing::Return;
- ChromeThread file_thread(ChromeThread::FILE, &message_loop_);
+ BrowserThread file_thread(BrowserThread::FILE, &message_loop_);
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kDownloadRenameCases); ++i) {
// |info| will be destroyed in download_manager_.
diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc
index 9639779..f37561d 100644
--- a/chrome/browser/download/download_prefs.cc
+++ b/chrome/browser/download/download_prefs.cc
@@ -53,8 +53,8 @@ void DownloadPrefs::RegisterUserPrefs(PrefService* prefs) {
#if defined(OS_CHROMEOS)
// Ensure that the download directory specified in the preferences exists.
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableFunction(&file_util::CreateDirectory, default_download_path));
#endif // defined(OS_CHROMEOS)
diff --git a/chrome/browser/download/download_request_limiter.cc b/chrome/browser/download/download_request_limiter.cc
index 472a2c5..8833699 100644
--- a/chrome/browser/download/download_request_limiter.cc
+++ b/chrome/browser/download/download_request_limiter.cc
@@ -192,9 +192,9 @@ void DownloadRequestLimiter::CanDownloadOnIOThread(int render_process_host_id,
Callback* callback) {
// This is invoked on the IO thread. Schedule the task to run on the UI
// thread so that we can query UI state.
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this, &DownloadRequestLimiter::CanDownload,
render_process_host_id, render_view_id, callback));
}
@@ -233,7 +233,7 @@ DownloadRequestLimiter::TabDownloadState* DownloadRequestLimiter::
void DownloadRequestLimiter::CanDownload(int render_process_host_id,
int render_view_id,
Callback* callback) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
TabContents* originating_tab =
tab_util::GetTabContentsByID(render_process_host_id, render_view_id);
@@ -296,14 +296,14 @@ void DownloadRequestLimiter::CanDownloadImpl(
void DownloadRequestLimiter::ScheduleNotification(Callback* callback,
bool allow) {
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
this, &DownloadRequestLimiter::NotifyCallback, callback, allow));
}
void DownloadRequestLimiter::NotifyCallback(Callback* callback, bool allow) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (allow)
callback->ContinueDownload();
else
diff --git a/chrome/browser/download/download_request_limiter_unittest.cc b/chrome/browser/download/download_request_limiter_unittest.cc
index cf0d90d..5d1cc3a 100644
--- a/chrome/browser/download/download_request_limiter_unittest.cc
+++ b/chrome/browser/download/download_request_limiter_unittest.cc
@@ -13,7 +13,8 @@ class DownloadRequestLimiterTest
: public RenderViewHostTestHarness,
public DownloadRequestLimiter::Callback {
public:
- DownloadRequestLimiterTest() : io_thread_(ChromeThread::IO, &message_loop_) {}
+ DownloadRequestLimiterTest() : io_thread_(BrowserThread::IO, &message_loop_) {
+ }
virtual void SetUp() {
RenderViewHostTestHarness::SetUp();
@@ -85,7 +86,7 @@ class DownloadRequestLimiterTest
// Number of times ShouldAllowDownload was invoked.
int ask_allow_count_;
- ChromeThread io_thread_;
+ BrowserThread io_thread_;
};
TEST_F(DownloadRequestLimiterTest, Allow) {
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index 9b121b5..f02cdc4 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -230,7 +230,7 @@ void GenerateSafeFileName(const std::string& mime_type, FilePath* file_name) {
void OpenChromeExtension(Profile* profile,
DownloadManager* download_manager,
const DownloadItem& download_item) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(download_item.is_extension_install());
// We don't support extensions in OTR mode.
@@ -683,7 +683,7 @@ void DownloadUrl(
int render_process_host_id,
int render_view_id,
URLRequestContextGetter* request_context_getter) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
URLRequestContext* context = request_context_getter->GetURLRequestContext();
context->set_referrer_charset(referrer_charset);
@@ -700,7 +700,7 @@ void DownloadUrl(
void CancelDownloadRequest(ResourceDispatcherHost* rdh,
int render_process_id,
int request_id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
rdh->CancelRequest(render_process_id, request_id, false);
}
diff --git a/chrome/browser/download/drag_download_file.cc b/chrome/browser/download/drag_download_file.cc
index ad99b75..3b01f0a 100644
--- a/chrome/browser/download/drag_download_file.cc
+++ b/chrome/browser/download/drag_download_file.cc
@@ -95,9 +95,9 @@ void DragDownloadFile::Stop() {
void DragDownloadFile::InitiateDownload() {
#if defined(OS_WIN)
// DownloadManager could only be invoked from the UI thread.
- if (!ChromeThread::CurrentlyOn(ChromeThread::UI)) {
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this,
&DragDownloadFile::InitiateDownload));
return;
@@ -193,7 +193,7 @@ void DragDownloadFile::AssertCurrentlyOnDragThread() {
void DragDownloadFile::AssertCurrentlyOnUIThread() {
// Only do the check on Windows where two threads are involved.
#if defined(OS_WIN)
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
#endif
}
diff --git a/chrome/browser/download/drag_download_util.cc b/chrome/browser/download/drag_download_util.cc
index 29fd84e..41527c2 100644
--- a/chrome/browser/download/drag_download_util.cc
+++ b/chrome/browser/download/drag_download_util.cc
@@ -92,14 +92,14 @@ void PromiseFileFinalizer::Cleanup() {
}
void PromiseFileFinalizer::OnDownloadCompleted(const FilePath& file_path) {
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this, &PromiseFileFinalizer::Cleanup));
}
void PromiseFileFinalizer::OnDownloadAborted() {
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this, &PromiseFileFinalizer::Cleanup));
}
diff --git a/chrome/browser/download/save_file.cc b/chrome/browser/download/save_file.cc
index 98667a3..58001cc 100644
--- a/chrome/browser/download/save_file.cc
+++ b/chrome/browser/download/save_file.cc
@@ -11,12 +11,12 @@
SaveFile::SaveFile(const SaveFileCreateInfo* info)
: BaseFile(FilePath(), info->url, GURL(), 0, linked_ptr<net::FileStream>()),
info_(info) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DCHECK(info);
DCHECK(info->path.empty());
}
SaveFile::~SaveFile() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
}
diff --git a/chrome/browser/download/save_file_manager.cc b/chrome/browser/download/save_file_manager.cc
index 00e9251..3040823 100644
--- a/chrome/browser/download/save_file_manager.cc
+++ b/chrome/browser/download/save_file_manager.cc
@@ -41,14 +41,14 @@ SaveFileManager::~SaveFileManager() {
// Called during the browser shutdown process to clean up any state (open files,
// timers) that live on the saving thread (file thread).
void SaveFileManager::Shutdown() {
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(this, &SaveFileManager::OnShutdown));
}
// Stop file thread operations.
void SaveFileManager::OnShutdown() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
STLDeleteValues(&save_file_map_);
}
@@ -64,14 +64,14 @@ SaveFile* SaveFileManager::LookupSaveFile(int save_id) {
// file a request from the file thread to the IO thread to generate a
// unique save ID.
int SaveFileManager::GetNextId() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
return next_id_++;
}
void SaveFileManager::RegisterStartingRequest(const GURL& save_url,
SavePackage* save_package) {
// Make sure it runs in the UI thread.
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
int tab_id = save_package->tab_id();
// Register this starting request.
@@ -84,7 +84,7 @@ void SaveFileManager::RegisterStartingRequest(const GURL& save_url,
SavePackage* SaveFileManager::UnregisterStartingRequest(
const GURL& save_url, int tab_id) {
// Make sure it runs in UI thread.
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
TabToStartingRequestsMap::iterator it = tab_starting_requests_.find(tab_id);
if (it != tab_starting_requests_.end()) {
@@ -107,7 +107,7 @@ SavePackage* SaveFileManager::UnregisterStartingRequest(
// Look up a SavePackage according to a save id.
SavePackage* SaveFileManager::LookupPackage(int save_id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
SavePackageMap::iterator it = packages_.find(save_id);
if (it != packages_.end())
return it->second;
@@ -123,15 +123,15 @@ void SaveFileManager::SaveURL(const GURL& url,
const FilePath& file_full_path,
URLRequestContextGetter* request_context_getter,
SavePackage* save_package) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Register a saving job.
RegisterStartingRequest(url, save_package);
if (save_source == SaveFileCreateInfo::SAVE_FILE_FROM_NET) {
DCHECK(url.is_valid());
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this,
&SaveFileManager::OnSaveURL,
url,
@@ -150,8 +150,8 @@ void SaveFileManager::SaveURL(const GURL& url,
// Since the data will come from render process, so we need to start
// this kind of save job by ourself.
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
this, &SaveFileManager::OnRequireSaveJobFromOtherSource, info));
}
@@ -166,7 +166,7 @@ void SaveFileManager::SaveURL(const GURL& url,
void SaveFileManager::RemoveSaveFile(int save_id, const GURL& save_url,
SavePackage* package) {
DCHECK(package);
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// A save page job(SavePackage) can only have one manager,
// so remove it if it exists.
if (save_id == -1) {
@@ -196,9 +196,9 @@ SavePackage* SaveFileManager::GetSavePackageFromRenderIds(
// Utility function for deleting specified file.
void SaveFileManager::DeleteDirectoryOrFile(const FilePath& full_path,
bool is_dir) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
this, &SaveFileManager::OnDeleteDirectoryOrFile, full_path, is_dir));
}
@@ -206,8 +206,8 @@ void SaveFileManager::DeleteDirectoryOrFile(const FilePath& full_path,
void SaveFileManager::SendCancelRequest(int save_id) {
// Cancel the request which has specific save id.
DCHECK_GT(save_id, -1);
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(this, &SaveFileManager::CancelSave, save_id));
}
@@ -217,7 +217,7 @@ void SaveFileManager::SendCancelRequest(int save_id) {
// to create a SaveFile which will hold and finally destroy |info|. It will
// then passes |info| to the UI thread for reporting saving status.
void SaveFileManager::StartSave(SaveFileCreateInfo* info) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DCHECK(info);
SaveFile* save_file = new SaveFile(info);
@@ -228,8 +228,8 @@ void SaveFileManager::StartSave(SaveFileCreateInfo* info) {
save_file_map_[info->save_id] = save_file;
info->path = save_file->full_path();
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this, &SaveFileManager::OnStartSave, info));
}
@@ -240,12 +240,12 @@ void SaveFileManager::StartSave(SaveFileCreateInfo* info) {
void SaveFileManager::UpdateSaveProgress(int save_id,
net::IOBuffer* data,
int data_len) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
SaveFile* save_file = LookupSaveFile(save_id);
if (save_file) {
bool write_success = save_file->AppendDataToFile(data->data(), data_len);
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(
this, &SaveFileManager::OnUpdateSaveProgress, save_file->save_id(),
save_file->bytes_so_far(), write_success));
@@ -263,12 +263,12 @@ void SaveFileManager::SaveFinished(int save_id,
GURL save_url,
int render_process_id,
bool is_success) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
SaveFileMap::iterator it = save_file_map_.find(save_id);
if (it != save_file_map_.end()) {
SaveFile* save_file = it->second;
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(
this, &SaveFileManager::OnSaveFinished, save_id,
save_file->bytes_so_far(), is_success));
@@ -277,8 +277,8 @@ void SaveFileManager::SaveFinished(int save_id,
} else if (save_id == -1) {
// Before saving started, we got error. We still call finish process.
DCHECK(!save_url.is_empty());
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(
this, &SaveFileManager::OnErrorFinished, save_url,
render_process_id));
@@ -288,7 +288,7 @@ void SaveFileManager::SaveFinished(int save_id,
// Notifications sent from the file thread and run on the UI thread.
void SaveFileManager::OnStartSave(const SaveFileCreateInfo* info) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
SavePackage* save_package =
GetSavePackageFromRenderIds(info->render_process_id,
info->render_view_id);
@@ -322,7 +322,7 @@ void SaveFileManager::OnStartSave(const SaveFileCreateInfo* info) {
void SaveFileManager::OnUpdateSaveProgress(int save_id, int64 bytes_so_far,
bool write_success) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
SavePackage* package = LookupPackage(save_id);
if (package)
package->UpdateSaveProgress(save_id, bytes_so_far, write_success);
@@ -333,14 +333,14 @@ void SaveFileManager::OnUpdateSaveProgress(int save_id, int64 bytes_so_far,
void SaveFileManager::OnSaveFinished(int save_id,
int64 bytes_so_far,
bool is_success) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
SavePackage* package = LookupPackage(save_id);
if (package)
package->SaveFinished(save_id, bytes_so_far, is_success);
}
void SaveFileManager::OnErrorFinished(GURL save_url, int tab_id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
SavePackage* save_package = UnregisterStartingRequest(save_url, tab_id);
if (save_package)
save_package->SaveFailed(save_url);
@@ -354,7 +354,7 @@ void SaveFileManager::OnSaveURL(
int render_process_host_id,
int render_view_id,
URLRequestContextGetter* request_context_getter) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
URLRequestContext* context = request_context_getter->GetURLRequestContext();
resource_dispatcher_host_->BeginSaveFile(url,
referrer,
@@ -365,19 +365,19 @@ void SaveFileManager::OnSaveURL(
void SaveFileManager::OnRequireSaveJobFromOtherSource(
SaveFileCreateInfo* info) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK_EQ(info->save_id, -1);
// Generate a unique save id.
info->save_id = GetNextId();
// Start real saving action.
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(this, &SaveFileManager::StartSave, info));
}
void SaveFileManager::ExecuteCancelSaveRequest(int render_process_id,
int request_id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
resource_dispatcher_host_->CancelRequest(render_process_id,
request_id,
false);
@@ -391,7 +391,7 @@ void SaveFileManager::ExecuteCancelSaveRequest(int render_process_id,
// sent from the UI thread, the saving job may have already completed and
// won't exist in our map.
void SaveFileManager::CancelSave(int save_id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
SaveFileMap::iterator it = save_file_map_.find(save_id);
if (it != save_file_map_.end()) {
SaveFile* save_file = it->second;
@@ -400,8 +400,8 @@ void SaveFileManager::CancelSave(int save_id) {
// message to IO thread. If the data comes from other sources, just
// ignore the cancel message.
if (save_file->save_source() == SaveFileCreateInfo::SAVE_FILE_FROM_NET) {
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
this, &SaveFileManager::ExecuteCancelSaveRequest,
save_file->render_process_id(), save_file->request_id()));
@@ -428,7 +428,7 @@ void SaveFileManager::CancelSave(int save_id) {
void SaveFileManager::SaveLocalFile(const GURL& original_file_url,
int save_id,
int render_process_id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
SaveFile* save_file = LookupSaveFile(save_id);
if (!save_file)
return;
@@ -458,7 +458,7 @@ void SaveFileManager::SaveLocalFile(const GURL& original_file_url,
void SaveFileManager::OnDeleteDirectoryOrFile(const FilePath& full_path,
bool is_dir) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DCHECK(!full_path.empty());
file_util::Delete(full_path, is_dir);
@@ -468,7 +468,7 @@ void SaveFileManager::OnDeleteDirectoryOrFile(const FilePath& full_path,
// We run on this thread to avoid blocking the UI with slow Shell operations.
#if !defined(OS_MACOSX)
void SaveFileManager::OnShowSavedFileInShell(const FilePath full_path) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
platform_util::ShowItemInFolder(full_path);
}
#endif
@@ -479,7 +479,7 @@ void SaveFileManager::RenameAllFiles(
int render_process_id,
int render_view_id,
int save_package_id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
if (!resource_dir.empty() && !file_util::PathExists(resource_dir))
file_util::CreateDirectory(resource_dir);
@@ -496,8 +496,8 @@ void SaveFileManager::RenameAllFiles(
}
}
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(
this, &SaveFileManager::OnFinishSavePageJob, render_process_id,
render_view_id, save_package_id));
@@ -506,7 +506,7 @@ void SaveFileManager::RenameAllFiles(
void SaveFileManager::OnFinishSavePageJob(int render_process_id,
int render_view_id,
int save_package_id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
SavePackage* save_package =
GetSavePackageFromRenderIds(render_process_id, render_view_id);
@@ -517,7 +517,7 @@ void SaveFileManager::OnFinishSavePageJob(int render_process_id,
void SaveFileManager::RemoveSavedFileFromFileMap(
const SaveIDList& save_ids) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
for (SaveIDList::const_iterator i = save_ids.begin();
i != save_ids.end(); ++i) {
diff --git a/chrome/browser/download/save_package.cc b/chrome/browser/download/save_package.cc
index 4ce3e36..cb97629 100644
--- a/chrome/browser/download/save_package.cc
+++ b/chrome/browser/download/save_package.cc
@@ -202,13 +202,13 @@ class CreateDownloadDirectoryTask : public Task {
if (!file_util::DirectoryExists(default_download_dir_))
file_util::CreateDirectory(default_download_dir_);
- ChromeThread::PostTask(ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
NewRunnableMethod(save_package_,
&SavePackage::ContinueGetSaveInfo,
default_download_dir_));
} else {
// If it does exist, use the default save dir param.
- ChromeThread::PostTask(ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
NewRunnableMethod(save_package_,
&SavePackage::ContinueGetSaveInfo,
default_save_file_dir_));
@@ -572,8 +572,8 @@ void SavePackage::StartSave(const SaveFileCreateInfo* info) {
// If the save source is from file system, inform SaveFileManager to copy
// corresponding file to the file path which this SaveItem specifies.
if (info->save_source == SaveFileCreateInfo::SAVE_FILE_FROM_FILE) {
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(file_manager_,
&SaveFileManager::SaveLocalFile,
save_item->url(),
@@ -679,8 +679,8 @@ void SavePackage::Stop() {
it != saved_failed_items_.end(); ++it)
save_ids.push_back(it->second->save_id());
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(file_manager_,
&SaveFileManager::RemoveSavedFileFromFileMap,
save_ids));
@@ -709,8 +709,8 @@ void SavePackage::CheckFinish() {
final_names.push_back(std::make_pair(it->first,
it->second->full_path()));
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(file_manager_,
&SaveFileManager::RenameAllFiles,
final_names,
@@ -736,8 +736,8 @@ void SavePackage::Finish() {
it != saved_failed_items_.end(); ++it)
save_ids.push_back(it->second->save_id());
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(file_manager_,
&SaveFileManager::RemoveSavedFileFromFileMap,
save_ids));
@@ -836,8 +836,8 @@ void SavePackage::SaveCanceled(SaveItem* save_item) {
save_item->url(),
this);
if (save_item->save_id() != -1)
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(file_manager_,
&SaveFileManager::CancelSave,
save_item->save_id()));
@@ -879,13 +879,13 @@ void SavePackage::SaveNextFile(bool process_all_remaining_items) {
void SavePackage::ShowDownloadInShell() {
DCHECK(file_manager_);
DCHECK(finished_ && !canceled() && !saved_main_file_path_.empty());
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
#if defined(OS_MACOSX)
// Mac OS X requires opening downloads on the UI thread.
platform_util::ShowItemInFolder(saved_main_file_path_);
#else
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(file_manager_,
&SaveFileManager::OnShowSavedFileInShell,
saved_main_file_path_));
@@ -1005,8 +1005,8 @@ void SavePackage::OnReceivedSerializedHtmlData(const GURL& frame_url,
if (flag == WebPageSerializerClient::AllFramesAreFinished) {
for (SaveUrlItemMap::iterator it = in_progress_items_.begin();
it != in_progress_items_.end(); ++it) {
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(file_manager_,
&SaveFileManager::SaveFinished,
it->second->save_id(),
@@ -1030,8 +1030,8 @@ void SavePackage::OnReceivedSerializedHtmlData(const GURL& frame_url,
memcpy(new_data->data(), data.data(), data.size());
// Call write file functionality in file thread.
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(file_manager_,
&SaveFileManager::UpdateSaveProgress,
save_item->save_id(),
@@ -1041,8 +1041,8 @@ void SavePackage::OnReceivedSerializedHtmlData(const GURL& frame_url,
// Current frame is completed saving, call finish in file thread.
if (flag == WebPageSerializerClient::CurrentFrameIsFinished) {
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(file_manager_,
&SaveFileManager::SaveFinished,
save_item->save_id(),
@@ -1240,8 +1240,8 @@ void SavePackage::GetSaveInfo() {
FilePath download_save_dir = prefs->GetFilePath(
prefs::kDownloadDefaultDirectory);
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
new CreateDownloadDirectoryTask(this,
website_save_dir,
download_save_dir));
diff --git a/chrome/browser/extensions/autoupdate_interceptor.cc b/chrome/browser/extensions/autoupdate_interceptor.cc
index 0067940..acc0d99 100644
--- a/chrome/browser/extensions/autoupdate_interceptor.cc
+++ b/chrome/browser/extensions/autoupdate_interceptor.cc
@@ -34,7 +34,7 @@ AutoUpdateInterceptor::~AutoUpdateInterceptor() {
URLRequestJob* AutoUpdateInterceptor::MaybeIntercept(URLRequest* request) {
- EXPECT_TRUE(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (request->url().scheme() != "http" ||
request->url().host() != "localhost") {
return NULL;
@@ -60,7 +60,7 @@ URLRequestJob* AutoUpdateInterceptor::MaybeIntercept(URLRequest* request) {
void AutoUpdateInterceptor::SetResponse(const std::string url,
const FilePath& path) {
- EXPECT_TRUE(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
GURL gurl(url);
EXPECT_EQ("http", gurl.scheme());
EXPECT_EQ("localhost", gurl.host());
@@ -71,7 +71,7 @@ void AutoUpdateInterceptor::SetResponse(const std::string url,
void AutoUpdateInterceptor::SetResponseOnIOThread(const std::string url,
const FilePath& path) {
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this, &AutoUpdateInterceptor::SetResponse, url, path));
}
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index 28f873b..bd06637 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -49,7 +49,7 @@ struct WhitelistedInstallData {
// static
void CrxInstaller::SetWhitelistedInstallId(const std::string& id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
Singleton<WhitelistedInstallData>::get()->ids.push_back(id);
}
@@ -92,19 +92,19 @@ CrxInstaller::~CrxInstaller() {
// destructor might be called on any thread, so we post a task to the file
// thread to make sure the delete happens there.
if (!temp_dir_.value().empty()) {
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableFunction(&DeleteFileHelper, temp_dir_, true));
}
if (delete_source_) {
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableFunction(&DeleteFileHelper, source_file_, false));
}
// Make sure the UI is deleted on the ui thread.
- ChromeThread::DeleteSoon(ChromeThread::UI, FROM_HERE, client_);
+ BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, client_);
client_ = NULL;
}
@@ -121,8 +121,8 @@ void CrxInstaller::InstallCrx(const FilePath& source_file) {
g_browser_process->resource_dispatcher_host(),
this));
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
unpacker.get(), &SandboxedExtensionUnpacker::Start));
}
@@ -134,8 +134,8 @@ void CrxInstaller::InstallUserScript(const FilePath& source_file,
source_file_ = source_file;
original_url_ = original_url;
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(this, &CrxInstaller::ConvertUserScriptOnFileThread));
}
@@ -227,14 +227,14 @@ bool CrxInstaller::AllowInstall(Extension* extension, std::string* error) {
}
void CrxInstaller::OnUnpackFailure(const std::string& error_message) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
ReportFailureFromFileThread(error_message);
}
void CrxInstaller::OnUnpackSuccess(const FilePath& temp_dir,
const FilePath& extension_dir,
Extension* extension) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
// Note: We take ownership of |extension| and |temp_dir|.
extension_.reset(extension);
@@ -255,13 +255,13 @@ void CrxInstaller::OnUnpackSuccess(const FilePath& temp_dir,
&install_icon_);
}
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this, &CrxInstaller::ConfirmInstall));
}
void CrxInstaller::ConfirmInstall() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (frontend_->extension_prefs()->IsExtensionBlacklisted(extension_->id())) {
LOG(INFO) << "This extension: " << extension_->id()
<< " is blacklisted. Install failed.";
@@ -294,16 +294,16 @@ void CrxInstaller::ConfirmInstall() {
AddRef(); // Balanced in Proceed() and Abort().
client_->ConfirmInstall(this, extension_.get());
} else {
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(this, &CrxInstaller::CompleteInstall));
}
return;
}
void CrxInstaller::InstallUIProceed() {
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(this, &CrxInstaller::CompleteInstall));
Release(); // balanced in ConfirmInstall().
@@ -322,7 +322,7 @@ void CrxInstaller::InstallUIAbort() {
}
void CrxInstaller::CompleteInstall() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
if (!current_version_.empty()) {
scoped_ptr<Version> current_version(
@@ -360,14 +360,14 @@ void CrxInstaller::CompleteInstall() {
}
void CrxInstaller::ReportFailureFromFileThread(const std::string& error) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this, &CrxInstaller::ReportFailureFromUIThread, error));
}
void CrxInstaller::ReportFailureFromUIThread(const std::string& error) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
NotificationService* service = NotificationService::current();
service->Notify(NotificationType::EXTENSION_INSTALL_ERROR,
@@ -386,14 +386,14 @@ void CrxInstaller::ReportFailureFromUIThread(const std::string& error) {
}
void CrxInstaller::ReportSuccessFromFileThread() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this, &CrxInstaller::ReportSuccessFromUIThread));
}
void CrxInstaller::ReportSuccessFromUIThread() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// If there is a client, tell the client about installation.
if (client_)
diff --git a/chrome/browser/extensions/extension_cookies_api.cc b/chrome/browser/extensions/extension_cookies_api.cc
index a1e455c..1d085a3 100644
--- a/chrome/browser/extensions/extension_cookies_api.cc
+++ b/chrome/browser/extensions/extension_cookies_api.cc
@@ -167,8 +167,8 @@ bool GetCookieFunction::RunImpl() {
DCHECK(store_context && !store_id_.empty());
store_context_ = store_context;
- bool rv = ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ bool rv = BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this, &GetCookieFunction::GetCookieOnIOThread));
DCHECK(rv);
@@ -177,19 +177,19 @@ bool GetCookieFunction::RunImpl() {
}
void GetCookieFunction::GetCookieOnIOThread() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
net::CookieStore* cookie_store = store_context_->GetCookieStore();
cookie_list_ =
extension_cookies_helpers::GetCookieListFromStore(cookie_store, url_);
- bool rv = ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ bool rv = BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this, &GetCookieFunction::RespondOnUIThread));
DCHECK(rv);
}
void GetCookieFunction::RespondOnUIThread() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
net::CookieMonster::CookieList::iterator it;
for (it = cookie_list_.begin(); it != cookie_list_.end(); ++it) {
@@ -229,8 +229,8 @@ bool GetAllCookiesFunction::RunImpl() {
DCHECK(store_context);
store_context_ = store_context;
- bool rv = ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ bool rv = BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this, &GetAllCookiesFunction::GetAllCookiesOnIOThread));
DCHECK(rv);
@@ -239,19 +239,19 @@ bool GetAllCookiesFunction::RunImpl() {
}
void GetAllCookiesFunction::GetAllCookiesOnIOThread() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
net::CookieStore* cookie_store = store_context_->GetCookieStore();
cookie_list_ =
extension_cookies_helpers::GetCookieListFromStore(cookie_store, url_);
- bool rv = ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ bool rv = BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this, &GetAllCookiesFunction::RespondOnUIThread));
DCHECK(rv);
}
void GetAllCookiesFunction::RespondOnUIThread() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
const Extension* extension = GetExtension();
if (extension) {
@@ -326,8 +326,8 @@ bool SetCookieFunction::RunImpl() {
DCHECK(store_context);
store_context_ = store_context;
- bool rv = ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ bool rv = BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this, &SetCookieFunction::SetCookieOnIOThread));
DCHECK(rv);
@@ -336,21 +336,21 @@ bool SetCookieFunction::RunImpl() {
}
void SetCookieFunction::SetCookieOnIOThread() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
net::CookieMonster* cookie_monster =
store_context_->GetCookieStore()->GetCookieMonster();
success_ = cookie_monster->SetCookieWithDetails(
url_, name_, value_, domain_, path_, expiration_time_,
secure_, http_only_);
- bool rv = ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ bool rv = BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this, &SetCookieFunction::RespondOnUIThread));
DCHECK(rv);
}
void SetCookieFunction::RespondOnUIThread() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!success_) {
error_ = ExtensionErrorUtils::FormatErrorMessage(
keys::kCookieSetFailedError, name_);
@@ -407,8 +407,8 @@ bool RemoveCookieFunction::RunImpl() {
// We don't bother to synchronously wait for the result here, because
// CookieMonster is only ever accessed on the IO thread, so any other accesses
// should happen after this.
- bool rv = ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ bool rv = BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
new RemoveCookieTask(url, name, store_context));
DCHECK(rv);
diff --git a/chrome/browser/extensions/extension_data_deleter.cc b/chrome/browser/extensions/extension_data_deleter.cc
index 6c04755..6c9be77 100644
--- a/chrome/browser/extensions/extension_data_deleter.cc
+++ b/chrome/browser/extensions/extension_data_deleter.cc
@@ -28,25 +28,25 @@ ExtensionDataDeleter::~ExtensionDataDeleter() {
}
void ExtensionDataDeleter::StartDeleting() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this, &ExtensionDataDeleter::DeleteCookiesOnIOThread));
- ChromeThread::PostTask(
- ChromeThread::WEBKIT, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::WEBKIT, FROM_HERE,
NewRunnableMethod(
this, &ExtensionDataDeleter::DeleteLocalStorageOnWebkitThread));
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
this, &ExtensionDataDeleter::DeleteDatabaseOnFileThread));
}
void ExtensionDataDeleter::DeleteCookiesOnIOThread() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
net::CookieMonster* cookie_monster =
extension_request_context_->GetCookieStore()->GetCookieMonster();
if (cookie_monster)
@@ -54,13 +54,13 @@ void ExtensionDataDeleter::DeleteCookiesOnIOThread() {
}
void ExtensionDataDeleter::DeleteDatabaseOnFileThread() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
int rv = database_tracker_->DeleteDataForOrigin(origin_id_, NULL);
DCHECK(rv == net::OK || rv == net::ERR_IO_PENDING);
}
void ExtensionDataDeleter::DeleteLocalStorageOnWebkitThread() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT));
webkit_context_->dom_storage_context()->DeleteLocalStorageForOrigin(
origin_id_);
}
diff --git a/chrome/browser/extensions/extension_data_deleter.h b/chrome/browser/extensions/extension_data_deleter.h
index 567128f..1d390f0 100644
--- a/chrome/browser/extensions/extension_data_deleter.h
+++ b/chrome/browser/extensions/extension_data_deleter.h
@@ -24,7 +24,7 @@ class WebKitContext;
// ExtensionsService::ClearExtensionData() upon uninstalling an extension.
class ExtensionDataDeleter
: public base::RefCountedThreadSafe<ExtensionDataDeleter,
- ChromeThread::DeleteOnUIThread> {
+ BrowserThread::DeleteOnUIThread> {
public:
ExtensionDataDeleter(Profile* profile, const GURL& extension_url);
~ExtensionDataDeleter();
diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc
index c1867ca..b8643fb 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.cc
+++ b/chrome/browser/extensions/extension_function_dispatcher.cc
@@ -379,8 +379,8 @@ ExtensionFunctionDispatcher::ExtensionFunctionDispatcher(
// ChromeURLDataManager.
if (extension->HasHostPermission(GURL(chrome::kChromeUIFavIconURL))) {
DOMUIFavIconSource* favicon_source = new DOMUIFavIconSource(profile_);
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(Singleton<ChromeURLDataManager>::get(),
&ChromeURLDataManager::AddDataSource,
make_scoped_refptr(favicon_source)));
diff --git a/chrome/browser/extensions/extension_icon_manager_unittest.cc b/chrome/browser/extensions/extension_icon_manager_unittest.cc
index f1d6dca..cf7455d 100644
--- a/chrome/browser/extensions/extension_icon_manager_unittest.cc
+++ b/chrome/browser/extensions/extension_icon_manager_unittest.cc
@@ -21,9 +21,9 @@ class ExtensionIconManagerTest : public testing::Test {
ExtensionIconManagerTest() :
unwaited_image_loads_(0),
waiting_(false),
- ui_thread_(ChromeThread::UI, &ui_loop_),
- file_thread_(ChromeThread::FILE),
- io_thread_(ChromeThread::IO) {}
+ ui_thread_(BrowserThread::UI, &ui_loop_),
+ file_thread_(BrowserThread::FILE),
+ io_thread_(BrowserThread::IO) {}
virtual ~ExtensionIconManagerTest() {}
@@ -57,9 +57,9 @@ class ExtensionIconManagerTest : public testing::Test {
bool waiting_;
MessageLoop ui_loop_;
- ChromeThread ui_thread_;
- ChromeThread file_thread_;
- ChromeThread io_thread_;
+ BrowserThread ui_thread_;
+ BrowserThread file_thread_;
+ BrowserThread io_thread_;
DISALLOW_COPY_AND_ASSIGN(ExtensionIconManagerTest);
};
diff --git a/chrome/browser/extensions/extension_info_map.cc b/chrome/browser/extensions/extension_info_map.cc
index 997dea3..e51c50d 100644
--- a/chrome/browser/extensions/extension_info_map.cc
+++ b/chrome/browser/extensions/extension_info_map.cc
@@ -10,7 +10,7 @@
namespace {
static void CheckOnValidThread() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
}
} // namespace
diff --git a/chrome/browser/extensions/extension_info_map_unittest.cc b/chrome/browser/extensions/extension_info_map_unittest.cc
index 37226e4..c8b7204 100644
--- a/chrome/browser/extensions/extension_info_map_unittest.cc
+++ b/chrome/browser/extensions/extension_info_map_unittest.cc
@@ -17,14 +17,14 @@ namespace {
class ExtensionInfoMapTest : public testing::Test {
public:
ExtensionInfoMapTest()
- : ui_thread_(ChromeThread::UI, &message_loop_),
- io_thread_(ChromeThread::IO, &message_loop_) {
+ : ui_thread_(BrowserThread::UI, &message_loop_),
+ io_thread_(BrowserThread::IO, &message_loop_) {
}
private:
MessageLoop message_loop_;
- ChromeThread ui_thread_;
- ChromeThread io_thread_;
+ BrowserThread ui_thread_;
+ BrowserThread io_thread_;
};
// Returns a barebones test Extension object with the given name.
diff --git a/chrome/browser/extensions/extension_menu_manager_unittest.cc b/chrome/browser/extensions/extension_menu_manager_unittest.cc
index e3a61a1..af15726 100644
--- a/chrome/browser/extensions/extension_menu_manager_unittest.cc
+++ b/chrome/browser/extensions/extension_menu_manager_unittest.cc
@@ -390,7 +390,7 @@ TEST_F(ExtensionMenuManagerTest, RemoveAll) {
TEST_F(ExtensionMenuManagerTest, ExecuteCommand) {
MessageLoopForUI message_loop;
- ChromeThread ui_thread(ChromeThread::UI, &message_loop);
+ BrowserThread ui_thread(BrowserThread::UI, &message_loop);
MockTestingProfile profile;
diff --git a/chrome/browser/extensions/extension_updater.cc b/chrome/browser/extensions/extension_updater.cc
index 593b04d..b2fca2b 100644
--- a/chrome/browser/extensions/extension_updater.cc
+++ b/chrome/browser/extensions/extension_updater.cc
@@ -294,7 +294,7 @@ class ExtensionUpdaterFileHandler
const GURL& download_url,
scoped_refptr<ExtensionUpdater> updater) {
// Make sure we're running in the right thread.
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
FilePath path;
if (!file_util::CreateTemporaryFile(&path)) {
@@ -311,8 +311,8 @@ class ExtensionUpdaterFileHandler
}
// The ExtensionUpdater now owns the temp file.
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(
updater.get(), &ExtensionUpdater::OnCRXFileWritten, extension_id,
path, download_url));
@@ -444,9 +444,9 @@ class SafeManifestParser : public UtilityProcessHost::Client {
// Posts a task over to the IO loop to start the parsing of xml_ in a
// utility process.
void Start() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
this, &SafeManifestParser::ParseInSandbox,
g_browser_process->resource_dispatcher_host()));
@@ -454,7 +454,7 @@ class SafeManifestParser : public UtilityProcessHost::Client {
// Creates the sandboxed utility process and tells it to start parsing.
void ParseInSandbox(ResourceDispatcherHost* rdh) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// TODO(asargent) we shouldn't need to do this branch here - instead
// UtilityProcessHost should handle it for us. (http://crbug.com/19192)
@@ -462,19 +462,19 @@ class SafeManifestParser : public UtilityProcessHost::Client {
!CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess);
if (use_utility_process) {
UtilityProcessHost* host = new UtilityProcessHost(
- rdh, this, ChromeThread::UI);
+ rdh, this, BrowserThread::UI);
host->StartUpdateManifestParse(xml_);
} else {
UpdateManifest manifest;
if (manifest.Parse(xml_)) {
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(
this, &SafeManifestParser::OnParseUpdateManifestSucceeded,
manifest.results()));
} else {
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(
this, &SafeManifestParser::OnParseUpdateManifestFailed,
manifest.errors()));
@@ -485,13 +485,13 @@ class SafeManifestParser : public UtilityProcessHost::Client {
// Callback from the utility process when parsing succeeded.
virtual void OnParseUpdateManifestSucceeded(
const UpdateManifest::Results& results) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
updater_->HandleManifestResults(*fetch_data_, results);
}
// Callback from the utility process when parsing failed.
virtual void OnParseUpdateManifestFailed(const std::string& error_message) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
LOG(WARNING) << "Error parsing update manifest:\n" << error_message;
}
@@ -601,8 +601,8 @@ void ExtensionUpdater::OnCRXFetchComplete(const GURL& url,
} else {
// Successfully fetched - now write crx to a file so we can have the
// ExtensionsService install it.
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
file_handler_.get(), &ExtensionUpdaterFileHandler::WriteTempFile,
current_extension_fetch_.id, data, url,
diff --git a/chrome/browser/extensions/extension_updater_unittest.cc b/chrome/browser/extensions/extension_updater_unittest.cc
index b40eb6e..d183b7b 100644
--- a/chrome/browser/extensions/extension_updater_unittest.cc
+++ b/chrome/browser/extensions/extension_updater_unittest.cc
@@ -300,7 +300,7 @@ class ExtensionUpdaterTest : public testing::Test {
// Setup and start the updater.
MessageLoop message_loop;
- ChromeThread io_thread(ChromeThread::IO);
+ BrowserThread io_thread(BrowserThread::IO);
io_thread.Start();
TestURLFetcherFactory factory;
@@ -352,7 +352,7 @@ class ExtensionUpdaterTest : public testing::Test {
// Setup and start the updater.
MessageLoop message_loop;
- ChromeThread io_thread(ChromeThread::IO);
+ BrowserThread io_thread(BrowserThread::IO);
io_thread.Start();
TestURLFetcherFactory factory;
@@ -471,10 +471,10 @@ class ExtensionUpdaterTest : public testing::Test {
static void TestMultipleManifestDownloading() {
MessageLoop ui_loop;
- ChromeThread ui_thread(ChromeThread::UI, &ui_loop);
- ChromeThread file_thread(ChromeThread::FILE);
+ BrowserThread ui_thread(BrowserThread::UI, &ui_loop);
+ BrowserThread file_thread(BrowserThread::FILE);
file_thread.Start();
- ChromeThread io_thread(ChromeThread::IO);
+ BrowserThread io_thread(BrowserThread::IO);
io_thread.Start();
TestURLFetcherFactory factory;
@@ -535,10 +535,10 @@ class ExtensionUpdaterTest : public testing::Test {
static void TestSingleExtensionDownloading(bool pending) {
MessageLoop ui_loop;
- ChromeThread ui_thread(ChromeThread::UI, &ui_loop);
- ChromeThread file_thread(ChromeThread::FILE);
+ BrowserThread ui_thread(BrowserThread::UI, &ui_loop);
+ BrowserThread file_thread(BrowserThread::FILE);
file_thread.Start();
- ChromeThread io_thread(ChromeThread::IO);
+ BrowserThread io_thread(BrowserThread::IO);
io_thread.Start();
TestURLFetcherFactory factory;
@@ -600,8 +600,8 @@ class ExtensionUpdaterTest : public testing::Test {
static void TestBlacklistDownloading() {
MessageLoop message_loop;
- ChromeThread ui_thread(ChromeThread::UI, &message_loop);
- ChromeThread io_thread(ChromeThread::IO);
+ BrowserThread ui_thread(BrowserThread::UI, &message_loop);
+ BrowserThread io_thread(BrowserThread::IO);
io_thread.Start();
TestURLFetcherFactory factory;
@@ -646,9 +646,9 @@ class ExtensionUpdaterTest : public testing::Test {
static void TestMultipleExtensionDownloading() {
MessageLoopForUI message_loop;
- ChromeThread ui_thread(ChromeThread::UI, &message_loop);
- ChromeThread file_thread(ChromeThread::FILE, &message_loop);
- ChromeThread io_thread(ChromeThread::IO);
+ BrowserThread ui_thread(BrowserThread::UI, &message_loop);
+ BrowserThread file_thread(BrowserThread::FILE, &message_loop);
+ BrowserThread io_thread(BrowserThread::IO);
io_thread.Start();
TestURLFetcherFactory factory;
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index 0898de0..4ce8c9f 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -318,16 +318,16 @@ void ExtensionsServiceBackend::LoadSingleExtension(
// Report this as an installed extension so that it gets remembered in the
// prefs.
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(frontend_, &ExtensionsService::OnExtensionInstalled,
extension, true));
}
void ExtensionsServiceBackend::ReportExtensionLoadError(
const FilePath& extension_path, const std::string &error) {
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(
frontend_,
&ExtensionsService::ReportExtensionLoadError, extension_path,
@@ -378,8 +378,8 @@ void ExtensionsServiceBackend::CheckForExternalUpdates(
}
if (external_extension_added_ && frontend->updater()) {
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(
frontend->updater(), &ExtensionUpdater::CheckNow));
}
@@ -402,8 +402,8 @@ void ExtensionsServiceBackend::CheckExternalUninstall(
return; // Yup, known extension, don't uninstall.
// This is an external extension that we don't have registered. Uninstall.
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(
frontend.get(), &ExtensionsService::UninstallExtension, id, true));
}
@@ -424,8 +424,8 @@ void ExtensionsServiceBackend::OnExternalExtensionFileFound(
const std::string& id, const Version* version, const FilePath& path,
Extension::Location location) {
DCHECK(version);
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(
frontend_, &ExtensionsService::OnExternalExtensionFileFound, id,
version->GetString(), path, location));
@@ -466,8 +466,8 @@ void ExtensionsServiceBackend::ReloadExtensionManifests(
}
// Finish installing on UI thread.
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(
frontend_,
&ExtensionsService::ContinueLoadAllExtensions,
@@ -648,7 +648,7 @@ namespace {
// TODO(akalin): Put this somewhere where both crx_installer.cc and
// this file can use it.
void DeleteFileHelper(const FilePath& path, bool recursive) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
file_util::Delete(path, recursive);
}
} // namespace
@@ -665,8 +665,8 @@ void ExtensionsService::UpdateExtension(const std::string& id,
<< " because it is not installed or pending";
// Delete extension_path since we're not creating a CrxInstaller
// that would do it for us.
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableFunction(&DeleteFileHelper, extension_path, false));
return;
}
@@ -811,8 +811,8 @@ void ExtensionsService::UninstallExtension(const std::string& extension_id,
// Tell the backend to start deleting installed extensions on the file thread.
if (Extension::LOAD != location) {
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableFunction(
&extension_file_util::UninstallExtension,
install_directory_,
@@ -879,8 +879,8 @@ void ExtensionsService::DisableExtension(const std::string& extension_id) {
}
void ExtensionsService::LoadExtension(const FilePath& extension_path) {
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
backend_.get(),
&ExtensionsServiceBackend::LoadSingleExtension,
@@ -929,8 +929,8 @@ void ExtensionsService::LoadAllExtensions() {
// for re-reading and localization.
for (size_t i = 0; i < info->size(); ++i) {
if (ShouldReloadExtensionManifest(*info->at(i))) {
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE, NewRunnableMethod(
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE, NewRunnableMethod(
backend_.get(),
&ExtensionsServiceBackend::ReloadExtensionManifests,
info.release(), // Callee takes ownership of the memory.
@@ -1068,8 +1068,8 @@ void ExtensionsService::LoadInstalledExtension(const ExtensionInfo& info,
OnExtensionLoaded(extension, true);
if (Extension::IsExternalLocation(info.extension_location)) {
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
backend_.get(),
&ExtensionsServiceBackend::CheckExternalUninstall,
@@ -1157,22 +1157,22 @@ void ExtensionsService::GrantUnlimitedStorage(Extension* extension) {
if (++unlimited_storage_map_[origin] == 1) {
string16 origin_identifier =
webkit_database::DatabaseUtil::GetOriginIdentifier(origin);
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
profile_->GetDatabaseTracker(),
&webkit_database::DatabaseTracker::SetOriginQuotaInMemory,
origin_identifier,
kint64max));
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
profile_->GetAppCacheService(),
&ChromeAppCacheService::SetOriginQuotaInMemory,
origin,
kint64max));
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
profile_->GetFileSystemHostContext(),
&FileSystemHostContext::SetOriginQuotaUnlimited,
@@ -1194,20 +1194,20 @@ void ExtensionsService::RevokeUnlimitedStorage(Extension* extension) {
unlimited_storage_map_.erase(origin);
string16 origin_identifier =
webkit_database::DatabaseUtil::GetOriginIdentifier(origin);
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
profile_->GetDatabaseTracker(),
&webkit_database::DatabaseTracker::ResetOriginQuotaInMemory,
origin_identifier));
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
profile_->GetAppCacheService(),
&ChromeAppCacheService::ResetOriginQuotaInMemory,
origin));
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
profile_->GetFileSystemHostContext(),
&FileSystemHostContext::ResetOriginQuotaUnlimited,
@@ -1309,8 +1309,8 @@ void ExtensionsService::CheckForExternalUpdates() {
// later?
std::set<std::string> killed_extensions;
extension_prefs_->GetKilledExtensionIds(&killed_extensions);
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
backend_.get(), &ExtensionsServiceBackend::CheckForExternalUpdates,
killed_extensions, scoped_refptr<ExtensionsService>(this)));
@@ -1384,8 +1384,8 @@ void ExtensionsService::GarbageCollectExtensions() {
for (size_t i = 0; i < info->size(); ++i)
extension_paths[info->at(i)->extension_id] = info->at(i)->extension_path;
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableFunction(
&extension_file_util::GarbageCollectExtensions, install_directory_,
extension_paths));
@@ -1524,8 +1524,8 @@ void ExtensionsService::OnExtensionInstalled(Extension* extension,
<< " with is_theme = " << extension->is_theme();
// Delete the extension directory since we're not going to
// load it.
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableFunction(&DeleteFileHelper, extension->path(), true));
return;
}
@@ -1574,8 +1574,8 @@ void ExtensionsService::OnExtensionInstalled(Extension* extension,
<< extension->id();
// Delete the extension directory since we're not going to
// load it.
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableFunction(&DeleteFileHelper, extension->path(), true));
return;
}
@@ -1699,16 +1699,16 @@ const SkBitmap& ExtensionsService::GetOmniboxPopupIcon(
}
void ExtensionsService::ClearProvidersForTesting() {
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
backend_.get(), &ExtensionsServiceBackend::ClearProvidersForTesting));
}
void ExtensionsService::SetProviderForTesting(
Extension::Location location, ExternalExtensionProvider* test_provider) {
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
backend_.get(), &ExtensionsServiceBackend::SetProviderForTesting,
location, test_provider));
diff --git a/chrome/browser/extensions/extensions_service.h b/chrome/browser/extensions/extensions_service.h
index b18c63b..71fbfd9 100644
--- a/chrome/browser/extensions/extensions_service.h
+++ b/chrome/browser/extensions/extensions_service.h
@@ -98,7 +98,7 @@ class ExtensionUpdateService {
// Manages installed and running Chromium extensions.
class ExtensionsService
: public base::RefCountedThreadSafe<ExtensionsService,
- ChromeThread::DeleteOnUIThread>,
+ BrowserThread::DeleteOnUIThread>,
public ExtensionUpdateService,
public NotificationObserver {
public:
diff --git a/chrome/browser/extensions/extensions_service_unittest.cc b/chrome/browser/extensions/extensions_service_unittest.cc
index 7a1c384..fc6662e 100644
--- a/chrome/browser/extensions/extensions_service_unittest.cc
+++ b/chrome/browser/extensions/extensions_service_unittest.cc
@@ -248,8 +248,8 @@ class ExtensionTestingProfile : public TestingProfile {
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(),
@@ -275,17 +275,17 @@ class ExtensionTestingProfile : public TestingProfile {
ExtensionsServiceTestBase::ExtensionsServiceTestBase()
: total_successes_(0),
loop_(MessageLoop::TYPE_IO),
- ui_thread_(ChromeThread::UI, &loop_),
- db_thread_(ChromeThread::DB, &loop_),
- webkit_thread_(ChromeThread::WEBKIT, &loop_),
- file_thread_(ChromeThread::FILE, &loop_),
- io_thread_(ChromeThread::IO, &loop_) {
+ ui_thread_(BrowserThread::UI, &loop_),
+ db_thread_(BrowserThread::DB, &loop_),
+ webkit_thread_(BrowserThread::WEBKIT, &loop_),
+ file_thread_(BrowserThread::FILE, &loop_),
+ io_thread_(BrowserThread::IO, &loop_) {
}
ExtensionsServiceTestBase::~ExtensionsServiceTestBase() {
// Drop our reference to ExtensionsService and TestingProfile, so that they
- // can be destroyed while ChromeThreads and MessageLoop are still around (they
- // are used in the destruction process).
+ // can be destroyed while BrowserThreads and MessageLoop are still around
+ // (they are used in the destruction process).
service_ = NULL;
profile_.reset(NULL);
MessageLoop::current()->RunAllPending();
@@ -2524,8 +2524,8 @@ TEST(ExtensionsServiceTestSimple, Enabledness) {
ExtensionsReadyRecorder recorder;
scoped_ptr<TestingProfile> profile(new TestingProfile());
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);
scoped_ptr<CommandLine> command_line;
scoped_refptr<ExtensionsService> service;
FilePath install_dir = profile->GetPath()
diff --git a/chrome/browser/extensions/extensions_service_unittest.h b/chrome/browser/extensions/extensions_service_unittest.h
index fe298b4b..456921d 100644
--- a/chrome/browser/extensions/extensions_service_unittest.h
+++ b/chrome/browser/extensions/extensions_service_unittest.h
@@ -43,11 +43,11 @@ class ExtensionsServiceTestBase : public testing::Test {
scoped_refptr<ExtensionsService> service_;
size_t total_successes_;
MessageLoop loop_;
- ChromeThread ui_thread_;
- ChromeThread db_thread_;
- ChromeThread webkit_thread_;
- ChromeThread file_thread_;
- ChromeThread io_thread_;
+ BrowserThread ui_thread_;
+ BrowserThread db_thread_;
+ BrowserThread webkit_thread_;
+ BrowserThread file_thread_;
+ BrowserThread io_thread_;
};
#endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_UNITTEST_H_
diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc
index 868009c..cea5d38 100644
--- a/chrome/browser/extensions/extensions_ui.cc
+++ b/chrome/browser/extensions/extensions_ui.cc
@@ -200,8 +200,8 @@ ExtensionsDOMHandler::IconLoader::IconLoader(ExtensionsDOMHandler* handler)
void ExtensionsDOMHandler::IconLoader::LoadIcons(
std::vector<ExtensionResource>* icons, DictionaryValue* json) {
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(this,
&IconLoader::LoadIconsOnFileThread, icons, json));
}
@@ -267,8 +267,8 @@ void ExtensionsDOMHandler::IconLoader::LoadIconsOnFileThread(
extension->SetString("icon", icon_url.spec());
}
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this, &IconLoader::ReportResultOnUIThread,
json_deleter.release()));
}
@@ -922,8 +922,8 @@ ExtensionsUI::ExtensionsUI(TabContents* contents) : DOMUI(contents) {
ExtensionsUIHTMLSource* html_source = new ExtensionsUIHTMLSource();
// Set up the chrome://extensions/ source.
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
Singleton<ChromeURLDataManager>::get(),
&ChromeURLDataManager::AddDataSource,
diff --git a/chrome/browser/extensions/file_reader.cc b/chrome/browser/extensions/file_reader.cc
index c6f19f6..90db839 100644
--- a/chrome/browser/extensions/file_reader.cc
+++ b/chrome/browser/extensions/file_reader.cc
@@ -17,8 +17,8 @@ FileReader::FileReader(const ExtensionResource& resource, Callback* callback)
}
void FileReader::Start() {
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(this, &FileReader::ReadFileOnBackgroundThread));
}
diff --git a/chrome/browser/extensions/file_reader_unittest.cc b/chrome/browser/extensions/file_reader_unittest.cc
index b45afeb..675b4a2 100644
--- a/chrome/browser/extensions/file_reader_unittest.cc
+++ b/chrome/browser/extensions/file_reader_unittest.cc
@@ -18,12 +18,12 @@ namespace {
class FileReaderTest : public testing::Test {
public:
- FileReaderTest() : file_thread_(ChromeThread::FILE) {
+ FileReaderTest() : file_thread_(BrowserThread::FILE) {
file_thread_.Start();
}
private:
MessageLoop message_loop_;
- ChromeThread file_thread_;
+ BrowserThread file_thread_;
};
class Receiver {
diff --git a/chrome/browser/extensions/image_loading_tracker.cc b/chrome/browser/extensions/image_loading_tracker.cc
index 5be22d8..b2bc8424 100644
--- a/chrome/browser/extensions/image_loading_tracker.cc
+++ b/chrome/browser/extensions/image_loading_tracker.cc
@@ -26,8 +26,8 @@ class ImageLoadingTracker::ImageLoader
public:
explicit ImageLoader(ImageLoadingTracker* tracker)
: tracker_(tracker) {
- CHECK(ChromeThread::GetCurrentThreadIdentifier(&callback_thread_id_));
- DCHECK(!ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ CHECK(BrowserThread::GetCurrentThreadIdentifier(&callback_thread_id_));
+ DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::FILE));
}
// Lets this class know that the tracker is no longer interested in the
@@ -40,9 +40,9 @@ class ImageLoadingTracker::ImageLoader
void LoadImage(const ExtensionResource& resource,
const gfx::Size& max_size,
int id) {
- DCHECK(!ChromeThread::CurrentlyOn(ChromeThread::FILE));
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(this, &ImageLoader::LoadOnFileThread, resource,
max_size, id));
}
@@ -50,7 +50,7 @@ class ImageLoadingTracker::ImageLoader
void LoadOnFileThread(ExtensionResource resource,
const gfx::Size& max_size,
int id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
// Read the file from disk.
std::string file_contents;
@@ -86,9 +86,9 @@ class ImageLoadingTracker::ImageLoader
void ReportBack(SkBitmap* image, const ExtensionResource& resource,
const gfx::Size& original_size, int id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
- ChromeThread::PostTask(
+ BrowserThread::PostTask(
callback_thread_id_, FROM_HERE,
NewRunnableMethod(this, &ImageLoader::ReportOnUIThread,
image, resource, original_size, id));
@@ -96,7 +96,7 @@ class ImageLoadingTracker::ImageLoader
void ReportOnUIThread(SkBitmap* image, ExtensionResource resource,
const gfx::Size& original_size, int id) {
- DCHECK(!ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::FILE));
if (tracker_)
tracker_->OnImageLoaded(image, resource, original_size, id);
@@ -110,7 +110,7 @@ class ImageLoadingTracker::ImageLoader
ImageLoadingTracker* tracker_;
// The thread that we need to call back on to report that we are done.
- ChromeThread::ID callback_thread_id_;
+ BrowserThread::ID callback_thread_id_;
DISALLOW_COPY_AND_ASSIGN(ImageLoader);
};
diff --git a/chrome/browser/extensions/image_loading_tracker_unittest.cc b/chrome/browser/extensions/image_loading_tracker_unittest.cc
index 930d831..595ba93 100644
--- a/chrome/browser/extensions/image_loading_tracker_unittest.cc
+++ b/chrome/browser/extensions/image_loading_tracker_unittest.cc
@@ -23,9 +23,9 @@ class ImageLoadingTrackerTest : public testing::Test,
ImageLoadingTrackerTest()
: image_loaded_count_(0),
quit_in_image_loaded_(false),
- ui_thread_(ChromeThread::UI, &ui_loop_),
- file_thread_(ChromeThread::FILE),
- io_thread_(ChromeThread::IO) {
+ ui_thread_(BrowserThread::UI, &ui_loop_),
+ file_thread_(BrowserThread::FILE),
+ io_thread_(BrowserThread::IO) {
}
virtual void OnImageLoaded(SkBitmap* image, ExtensionResource resource,
@@ -92,9 +92,9 @@ class ImageLoadingTrackerTest : public testing::Test,
int image_loaded_count_;
bool quit_in_image_loaded_;
MessageLoop ui_loop_;
- ChromeThread ui_thread_;
- ChromeThread file_thread_;
- ChromeThread io_thread_;
+ BrowserThread ui_thread_;
+ BrowserThread file_thread_;
+ BrowserThread io_thread_;
};
// Tests asking ImageLoadingTracker to cache pushes the result to the Extension.
diff --git a/chrome/browser/extensions/pack_extension_job.cc b/chrome/browser/extensions/pack_extension_job.cc
index 1896c1e..d363631 100644
--- a/chrome/browser/extensions/pack_extension_job.cc
+++ b/chrome/browser/extensions/pack_extension_job.cc
@@ -17,12 +17,12 @@ PackExtensionJob::PackExtensionJob(Client* client,
const FilePath& key_file)
: client_(client), key_file_(key_file) {
root_directory_ = root_directory.StripTrailingSeparators();
- CHECK(ChromeThread::GetCurrentThreadIdentifier(&client_thread_id_));
+ CHECK(BrowserThread::GetCurrentThreadIdentifier(&client_thread_id_));
}
void PackExtensionJob::Start() {
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(this, &PackExtensionJob::RunOnFileThread));
}
@@ -42,12 +42,12 @@ void PackExtensionJob::RunOnFileThread() {
// returns. See bug 20734.
ExtensionCreator creator;
if (creator.Run(root_directory_, crx_file_out_, key_file_, key_file_out_)) {
- ChromeThread::PostTask(
+ BrowserThread::PostTask(
client_thread_id_, FROM_HERE,
NewRunnableMethod(this,
&PackExtensionJob::ReportSuccessOnClientThread));
} else {
- ChromeThread::PostTask(
+ BrowserThread::PostTask(
client_thread_id_, FROM_HERE,
NewRunnableMethod(
this, &PackExtensionJob::ReportFailureOnClientThread,
diff --git a/chrome/browser/extensions/pack_extension_job.h b/chrome/browser/extensions/pack_extension_job.h
index 48c0a54..5142c01 100644
--- a/chrome/browser/extensions/pack_extension_job.h
+++ b/chrome/browser/extensions/pack_extension_job.h
@@ -54,7 +54,7 @@ class PackExtensionJob : public base::RefCountedThreadSafe<PackExtensionJob> {
void ReportSuccessOnClientThread();
void ReportFailureOnClientThread(const std::string& error);
- ChromeThread::ID client_thread_id_;
+ BrowserThread::ID client_thread_id_;
Client* client_;
FilePath root_directory_;
FilePath key_file_;
diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker.cc b/chrome/browser/extensions/sandboxed_extension_unpacker.cc
index 022351b..0f89b22 100644
--- a/chrome/browser/extensions/sandboxed_extension_unpacker.cc
+++ b/chrome/browser/extensions/sandboxed_extension_unpacker.cc
@@ -34,14 +34,14 @@ SandboxedExtensionUnpacker::SandboxedExtensionUnpacker(
ResourceDispatcherHost* rdh,
SandboxedExtensionUnpackerClient* client)
: crx_path_(crx_path), temp_path_(temp_path),
- thread_identifier_(ChromeThread::ID_COUNT),
+ thread_identifier_(BrowserThread::ID_COUNT),
rdh_(rdh), client_(client), got_response_(false) {
}
void SandboxedExtensionUnpacker::Start() {
// We assume that we are started on the thread that the client wants us to do
// file IO on.
- CHECK(ChromeThread::GetCurrentThreadIdentifier(&thread_identifier_));
+ CHECK(BrowserThread::GetCurrentThreadIdentifier(&thread_identifier_));
// Create a temporary directory to work in.
if (!temp_dir_.CreateUniqueTempDirUnderPath(temp_path_)) {
@@ -98,8 +98,8 @@ void SandboxedExtensionUnpacker::Start() {
return;
}
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
this,
&SandboxedExtensionUnpacker::StartProcessOnIOThread,
@@ -128,8 +128,8 @@ void SandboxedExtensionUnpacker::StartProcessOnIOThread(
void SandboxedExtensionUnpacker::OnUnpackExtensionSucceeded(
const DictionaryValue& manifest) {
// Skip check for unittests.
- if (thread_identifier_ != ChromeThread::ID_COUNT)
- DCHECK(ChromeThread::CurrentlyOn(thread_identifier_));
+ if (thread_identifier_ != BrowserThread::ID_COUNT)
+ DCHECK(BrowserThread::CurrentlyOn(thread_identifier_));
got_response_ = true;
scoped_ptr<DictionaryValue> final_manifest(RewriteManifestFile(manifest));
@@ -167,7 +167,7 @@ void SandboxedExtensionUnpacker::OnUnpackExtensionSucceeded(
void SandboxedExtensionUnpacker::OnUnpackExtensionFailed(
const std::string& error) {
- DCHECK(ChromeThread::CurrentlyOn(thread_identifier_));
+ DCHECK(BrowserThread::CurrentlyOn(thread_identifier_));
got_response_ = true;
ReportFailure(error);
}
diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker.h b/chrome/browser/extensions/sandboxed_extension_unpacker.h
index c9de32d..8df1414 100644
--- a/chrome/browser/extensions/sandboxed_extension_unpacker.h
+++ b/chrome/browser/extensions/sandboxed_extension_unpacker.h
@@ -145,7 +145,7 @@ class SandboxedExtensionUnpacker : public UtilityProcessHost::Client {
FilePath temp_path_;
// Our client's thread. This is the thread we respond on.
- ChromeThread::ID thread_identifier_;
+ BrowserThread::ID thread_identifier_;
// ResourceDispatcherHost to pass to the utility process.
ResourceDispatcherHost* rdh_;
diff --git a/chrome/browser/extensions/test_extension_prefs.cc b/chrome/browser/extensions/test_extension_prefs.cc
index 5f4c94f..62fdffc 100644
--- a/chrome/browser/extensions/test_extension_prefs.cc
+++ b/chrome/browser/extensions/test_extension_prefs.cc
@@ -35,7 +35,7 @@ void TestExtensionPrefs::RecreateExtensionPrefs() {
// need to wait for any pending I/O to complete before creating a new
// PrefService.
MessageLoop file_loop;
- ChromeThread file_thread(ChromeThread::FILE, &file_loop);
+ BrowserThread file_thread(BrowserThread::FILE, &file_loop);
pref_service_->SavePersistentPrefs();
file_loop.RunAllPending();
}
diff --git a/chrome/browser/extensions/user_script_listener.cc b/chrome/browser/extensions/user_script_listener.cc
index 111d5ba..fd371c1 100644
--- a/chrome/browser/extensions/user_script_listener.cc
+++ b/chrome/browser/extensions/user_script_listener.cc
@@ -17,7 +17,7 @@
UserScriptListener::UserScriptListener(ResourceQueue* resource_queue)
: resource_queue_(resource_queue),
user_scripts_ready_(false) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(resource_queue_);
registrar_.Add(this, NotificationType::EXTENSION_LOADED,
@@ -29,7 +29,7 @@ UserScriptListener::UserScriptListener(ResourceQueue* resource_queue)
}
void UserScriptListener::ShutdownMainThread() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
registrar_.RemoveAll();
}
@@ -37,7 +37,7 @@ bool UserScriptListener::ShouldDelayRequest(
URLRequest* request,
const ResourceDispatcherHostRequestInfo& request_info,
const GlobalRequestID& request_id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// If it's a frame load, then we need to check the URL against the list of
// user scripts to see if we need to wait.
@@ -63,7 +63,7 @@ bool UserScriptListener::ShouldDelayRequest(
}
void UserScriptListener::WillShutdownResourceQueue() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
resource_queue_ = NULL;
}
@@ -71,7 +71,7 @@ UserScriptListener::~UserScriptListener() {
}
void UserScriptListener::StartDelayedRequests() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
user_scripts_ready_ = true;
@@ -86,7 +86,7 @@ void UserScriptListener::StartDelayedRequests() {
}
void UserScriptListener::AppendNewURLPatterns(const URLPatterns& new_patterns) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
user_scripts_ready_ = false;
url_patterns_.insert(url_patterns_.end(),
@@ -94,13 +94,13 @@ void UserScriptListener::AppendNewURLPatterns(const URLPatterns& new_patterns) {
}
void UserScriptListener::ReplaceURLPatterns(const URLPatterns& patterns) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
url_patterns_ = patterns;
}
void UserScriptListener::CollectURLPatterns(Extension* extension,
URLPatterns* patterns) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
const UserScriptList& scripts = extension->content_scripts();
for (UserScriptList::const_iterator iter = scripts.begin();
@@ -114,7 +114,7 @@ void UserScriptListener::CollectURLPatterns(Extension* extension,
void UserScriptListener::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
switch (type.value) {
case NotificationType::EXTENSION_LOADED: {
@@ -125,8 +125,8 @@ void UserScriptListener::Observe(NotificationType type,
URLPatterns new_patterns;
CollectURLPatterns(Details<Extension>(details).ptr(), &new_patterns);
if (!new_patterns.empty()) {
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
this, &UserScriptListener::AppendNewURLPatterns, new_patterns));
}
@@ -147,16 +147,16 @@ void UserScriptListener::Observe(NotificationType type,
if (*it != unloaded_extension)
CollectURLPatterns(*it, &new_patterns);
}
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
this, &UserScriptListener::ReplaceURLPatterns, new_patterns));
break;
}
case NotificationType::USER_SCRIPTS_UPDATED: {
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this, &UserScriptListener::StartDelayedRequests));
break;
}
diff --git a/chrome/browser/extensions/user_script_master.cc b/chrome/browser/extensions/user_script_master.cc
index 6605936..560fda3 100644
--- a/chrome/browser/extensions/user_script_master.cc
+++ b/chrome/browser/extensions/user_script_master.cc
@@ -45,7 +45,7 @@ static bool GetDeclarationValue(const base::StringPiece& line,
UserScriptMaster::ScriptReloader::ScriptReloader(UserScriptMaster* master)
: master_(master) {
- CHECK(ChromeThread::GetCurrentThreadIdentifier(&master_thread_id_));
+ CHECK(BrowserThread::GetCurrentThreadIdentifier(&master_thread_id_));
}
// static
@@ -137,8 +137,8 @@ void UserScriptMaster::ScriptReloader::StartScan(
// Add a reference to ourselves to keep ourselves alive while we're running.
// Balanced by NotifyMaster().
AddRef();
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
this, &UserScriptMaster::ScriptReloader::RunScan, script_dir,
lone_scripts));
@@ -287,7 +287,7 @@ void UserScriptMaster::ScriptReloader::RunScan(
// Scripts now contains list of up-to-date scripts. Load the content in the
// shared memory and let the master know it's ready. We need to post the task
// back even if no scripts ware found to balance the AddRef/Release calls
- ChromeThread::PostTask(
+ BrowserThread::PostTask(
master_thread_id_, FROM_HERE,
NewRunnableMethod(
this, &ScriptReloader::NotifyMaster, Serialize(scripts)));
diff --git a/chrome/browser/extensions/user_script_master.h b/chrome/browser/extensions/user_script_master.h
index 82adab0..812dbde 100644
--- a/chrome/browser/extensions/user_script_master.h
+++ b/chrome/browser/extensions/user_script_master.h
@@ -118,7 +118,7 @@ class UserScriptMaster : public base::RefCountedThreadSafe<UserScriptMaster>,
// The message loop to call our master back on.
// Expected to always outlive us.
- ChromeThread::ID master_thread_id_;
+ BrowserThread::ID master_thread_id_;
DISALLOW_COPY_AND_ASSIGN(ScriptReloader);
};
diff --git a/chrome/browser/extensions/user_script_master_unittest.cc b/chrome/browser/extensions/user_script_master_unittest.cc
index 3760941..84ab638 100644
--- a/chrome/browser/extensions/user_script_master_unittest.cc
+++ b/chrome/browser/extensions/user_script_master_unittest.cc
@@ -44,8 +44,8 @@ class UserScriptMasterTest : public testing::Test,
// UserScriptMaster posts tasks to the file thread so make the current
// thread look like one.
- file_thread_.reset(new ChromeThread(
- ChromeThread::FILE, MessageLoop::current()));
+ file_thread_.reset(new BrowserThread(
+ BrowserThread::FILE, MessageLoop::current()));
}
virtual void TearDown() {
@@ -70,7 +70,7 @@ class UserScriptMasterTest : public testing::Test,
// MessageLoop used in tests.
MessageLoop message_loop_;
- scoped_ptr<ChromeThread> file_thread_;
+ scoped_ptr<BrowserThread> file_thread_;
// Directory containing user scripts.
FilePath script_dir_;