summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-07 05:00:29 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-07 05:00:29 +0000
commit4d3b42a773a09463c9f57613206729aff2f84bfd (patch)
tree92e86c0e05c64ec50e672eaef8a30c4b8394f372 /chrome/browser
parent34867b3fcd518cdb50435806c821e5be2604bc88 (diff)
downloadchromium_src-4d3b42a773a09463c9f57613206729aff2f84bfd.zip
chromium_src-4d3b42a773a09463c9f57613206729aff2f84bfd.tar.gz
chromium_src-4d3b42a773a09463c9f57613206729aff2f84bfd.tar.bz2
Rename ChromeThread to BrowserThread Part4:
- Rename entries under safe_browsing, search_engines, service and speech. BUG=56926 TEST=trybots Review URL: http://codereview.chromium.org/3552013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61763 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/safe_browsing/protocol_manager.cc4
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page.cc4
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc8
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_service.cc78
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_test.cc22
-rw-r--r--chrome/browser/search_engines/search_provider_install_data.cc27
-rw-r--r--chrome/browser/search_engines/search_provider_install_data_unittest.cc8
-rw-r--r--chrome/browser/search_engines/search_provider_install_state_dispatcher_host.cc6
-rw-r--r--chrome/browser/search_engines/search_terms_data.cc16
-rw-r--r--chrome/browser/search_engines/template_url_fetcher_unittest.cc4
-rw-r--r--chrome/browser/search_engines/template_url_model_test_util.cc14
-rw-r--r--chrome/browser/search_engines/template_url_model_test_util.h2
-rw-r--r--chrome/browser/search_engines/template_url_model_unittest.cc2
-rw-r--r--chrome/browser/search_engines/util.cc6
-rw-r--r--chrome/browser/service/service_process_control.cc26
-rw-r--r--chrome/browser/service/service_process_control_manager.cc2
-rw-r--r--chrome/browser/speech/speech_input_bubble_controller.cc26
-rw-r--r--chrome/browser/speech/speech_input_bubble_controller_unittest.cc14
-rw-r--r--chrome/browser/speech/speech_input_dispatcher_host.cc8
-rw-r--r--chrome/browser/speech/speech_input_manager.cc4
-rw-r--r--chrome/browser/speech/speech_recognizer.cc10
-rw-r--r--chrome/browser/speech/speech_recognizer_unittest.cc4
22 files changed, 147 insertions, 148 deletions
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc
index aef07ae..31cd937 100644
--- a/chrome/browser/safe_browsing/protocol_manager.cc
+++ b/chrome/browser/safe_browsing/protocol_manager.cc
@@ -402,8 +402,8 @@ bool SafeBrowsingProtocolManager::HandleServiceResponse(const GURL& url,
client_key_ = client_key;
wrapped_key_ = wrapped_key;
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(
sb_service_, &SafeBrowsingService::OnNewMacKeys, client_key_,
wrapped_key_));
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
index bcc28cb..4901811 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
@@ -481,8 +481,8 @@ void SafeBrowsingBlockingPage::NotifySafeBrowsingService(
SafeBrowsingService* sb_service,
const UnsafeResourceList& unsafe_resources,
bool proceed) {
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
sb_service, &SafeBrowsingService::OnBlockingPageDone,
unsafe_resources, proceed));
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
index db67004..799ebd9 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
@@ -58,8 +58,8 @@ class SafeBrowsingBlockingPageTest : public RenderViewHostTestHarness,
};
SafeBrowsingBlockingPageTest()
- : ui_thread_(ChromeThread::UI, MessageLoop::current()),
- io_thread_(ChromeThread::IO, MessageLoop::current()) {
+ : ui_thread_(BrowserThread::UI, MessageLoop::current()),
+ io_thread_(BrowserThread::IO, MessageLoop::current()) {
ResetUserResponse();
service_ = new SafeBrowsingService();
}
@@ -143,8 +143,8 @@ class SafeBrowsingBlockingPageTest : public RenderViewHostTestHarness,
UserResponse user_response_;
scoped_refptr<SafeBrowsingService> service_;
TestSafeBrowsingBlockingPageFactory factory_;
- ChromeThread ui_thread_;
- ChromeThread io_thread_;
+ BrowserThread ui_thread_;
+ BrowserThread io_thread_;
};
// Tests showing a blocking page for a malware page and not proceeding.
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc
index e0ac3d7..ba8edc4 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -67,8 +67,8 @@ void SafeBrowsingService::Initialize() {
}
void SafeBrowsingService::ShutDown() {
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this, &SafeBrowsingService::OnIOShutdown));
}
@@ -79,7 +79,7 @@ bool SafeBrowsingService::CanCheckUrl(const GURL& url) const {
}
bool SafeBrowsingService::CheckUrl(const GURL& url, Client* client) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!enabled_)
return true;
@@ -118,15 +118,15 @@ bool SafeBrowsingService::CheckUrl(const GURL& url, Client* client) {
check->full_hits.swap(full_hits);
checks_.insert(check);
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this, &SafeBrowsingService::OnCheckDone, check));
return false;
}
void SafeBrowsingService::CancelCheck(Client* client) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
for (CurrentChecks::iterator i = checks_.begin(); i != checks_.end(); ++i) {
// We can't delete matching checks here because the db thread has a copy of
// the pointer. Instead, we simply NULL out the client, and when the db
@@ -155,7 +155,7 @@ void SafeBrowsingService::DisplayBlockingPage(const GURL& url,
Client* client,
int render_process_host_id,
int render_view_id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// Check if the user has already ignored our warning for this render_view
// and domain.
@@ -183,8 +183,8 @@ void SafeBrowsingService::DisplayBlockingPage(const GURL& url,
resource.render_view_id = render_view_id;
// The blocking page must be created from the UI thread.
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(
this, &SafeBrowsingService::DoDisplayBlockingPage, resource));
}
@@ -193,7 +193,7 @@ void SafeBrowsingService::HandleGetHashResults(
SafeBrowsingCheck* check,
const std::vector<SBFullHashResult>& full_hashes,
bool can_cache) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (checks_.find(check) == checks_.end())
return;
@@ -212,7 +212,7 @@ void SafeBrowsingService::HandleGetHashResults(
void SafeBrowsingService::HandleChunk(const std::string& list,
SBChunkList* chunks) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(enabled_);
safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &SafeBrowsingService::HandleChunkForDatabase, list, chunks));
@@ -220,14 +220,14 @@ void SafeBrowsingService::HandleChunk(const std::string& list,
void SafeBrowsingService::HandleChunkDelete(
std::vector<SBChunkDelete>* chunk_deletes) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(enabled_);
safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &SafeBrowsingService::DeleteChunks, chunk_deletes));
}
void SafeBrowsingService::UpdateStarted() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(enabled_);
DCHECK(!update_in_progress_);
update_in_progress_ = true;
@@ -236,7 +236,7 @@ void SafeBrowsingService::UpdateStarted() {
}
void SafeBrowsingService::UpdateFinished(bool update_succeeded) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(enabled_);
if (update_in_progress_) {
update_in_progress_ = false;
@@ -248,7 +248,7 @@ void SafeBrowsingService::UpdateFinished(bool update_succeeded) {
}
bool SafeBrowsingService::IsUpdateInProgress() const {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
return update_in_progress_;
}
@@ -296,7 +296,7 @@ void SafeBrowsingService::RegisterPrefs(PrefService* prefs) {
}
void SafeBrowsingService::CloseDatabase() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// Cases to avoid:
// * If |closing_database_| is true, continuing will queue up a second
@@ -327,7 +327,7 @@ void SafeBrowsingService::CloseDatabase() {
}
void SafeBrowsingService::ResetDatabase() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(enabled_);
safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &SafeBrowsingService::OnResetDatabase));
@@ -347,7 +347,7 @@ void SafeBrowsingService::OnIOInitialize(
const std::string& client_key,
const std::string& wrapped_key,
URLRequestContextGetter* request_context_getter) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
enabled_ = true;
MakeDatabaseAvailable();
@@ -393,7 +393,7 @@ void SafeBrowsingService::OnIOInitialize(
}
void SafeBrowsingService::OnIOShutdown() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!enabled_)
return;
@@ -446,7 +446,7 @@ bool SafeBrowsingService::DatabaseAvailable() const {
}
bool SafeBrowsingService::MakeDatabaseAvailable() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(enabled_);
if (DatabaseAvailable())
return true;
@@ -475,8 +475,8 @@ SafeBrowsingDatabase* SafeBrowsingService::GetDatabase() {
database_ = database;
}
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this, &SafeBrowsingService::DatabaseLoadComplete));
UMA_HISTOGRAM_TIMES("SB2.DatabaseOpen", Time::Now() - before);
@@ -484,7 +484,7 @@ SafeBrowsingDatabase* SafeBrowsingService::GetDatabase() {
}
void SafeBrowsingService::OnCheckDone(SafeBrowsingCheck* check) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// If we've been shutdown during the database lookup, this check will already
// have been deleted (in OnIOShutdown).
@@ -539,8 +539,8 @@ void SafeBrowsingService::GetAllChunksFromDatabase() {
database_->UpdateFinished(false);
}
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
this, &SafeBrowsingService::OnGetAllChunksFromDatabase, lists,
database_error));
@@ -548,19 +548,19 @@ void SafeBrowsingService::GetAllChunksFromDatabase() {
void SafeBrowsingService::OnGetAllChunksFromDatabase(
const std::vector<SBListChunkRanges>& lists, bool database_error) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (enabled_)
protocol_manager_->OnGetChunksComplete(lists, database_error);
}
void SafeBrowsingService::OnChunkInserted() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (enabled_)
protocol_manager_->OnChunkInserted();
}
void SafeBrowsingService::DatabaseLoadComplete() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!enabled_)
return;
@@ -591,8 +591,8 @@ void SafeBrowsingService::HandleChunkForDatabase(
GetDatabase()->InsertChunks(list_name, *chunks);
delete chunks;
}
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this, &SafeBrowsingService::OnChunkInserted));
}
@@ -652,8 +652,8 @@ void SafeBrowsingService::Start() {
GetDefaultProfile()->GetRequestContext();
request_context_getter->AddRef(); // Balanced in OnIOInitialize.
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
this, &SafeBrowsingService::OnIOInitialize, client_key, wrapped_key,
request_context_getter));
@@ -691,7 +691,7 @@ void SafeBrowsingService::CacheHashResults(
void SafeBrowsingService::OnHandleGetHashResults(
SafeBrowsingCheck* check,
const std::vector<SBFullHashResult>& full_hashes) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
SBPrefix prefix = check->prefix_hits[0];
GetHashRequests::iterator it = gethash_requests_.find(prefix);
if (check->prefix_hits.size() > 1 || it == gethash_requests_.end()) {
@@ -712,7 +712,7 @@ void SafeBrowsingService::OnHandleGetHashResults(
void SafeBrowsingService::HandleOneCheck(
SafeBrowsingCheck* check,
const std::vector<SBFullHashResult>& full_hashes) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (check->client) {
UrlCheckResult result = URL_SAFE;
int index = safe_browsing_util::CompareFullHashes(check->url, full_hashes);
@@ -746,8 +746,8 @@ void SafeBrowsingService::DoDisplayBlockingPage(
// Just act as "Don't Proceed" was chosen.
std::vector<UnsafeResource> resources;
resources.push_back(resource);
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
this, &SafeBrowsingService::OnBlockingPageDone, resources, false));
return;
@@ -782,8 +782,8 @@ void SafeBrowsingService::DoDisplayBlockingPage(
if ((!page_url.is_empty() && resource.url != page_url) ||
!referrer_url.is_empty()) {
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this,
&SafeBrowsingService::ReportMalware,
resource.url,
@@ -800,7 +800,7 @@ void SafeBrowsingService::ReportMalware(const GURL& malware_url,
const GURL& page_url,
const GURL& referrer_url,
bool is_subresource) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!enabled_)
return;
diff --git a/chrome/browser/safe_browsing/safe_browsing_test.cc b/chrome/browser/safe_browsing/safe_browsing_test.cc
index 17295cf..43d3264 100644
--- a/chrome/browser/safe_browsing/safe_browsing_test.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_test.cc
@@ -133,14 +133,14 @@ class SafeBrowsingServiceTestHelper
// Functions and callbacks related to CheckUrl. These are used to verify if
// a URL is a phishing URL.
void CheckUrl(const GURL& url) {
- ChromeThread::PostTask(ChromeThread::IO, FROM_HERE, NewRunnableMethod(this,
- &SafeBrowsingServiceTestHelper::CheckUrlOnIOThread, url));
+ BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, NewRunnableMethod(
+ this, &SafeBrowsingServiceTestHelper::CheckUrlOnIOThread, url));
}
void CheckUrlOnIOThread(const GURL& url) {
- CHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
safe_browsing_test_->CheckUrl(this, url);
- ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, NewRunnableMethod(this,
- &SafeBrowsingServiceTestHelper::OnCheckUrlOnIOThreadDone));
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod(
+ this, &SafeBrowsingServiceTestHelper::OnCheckUrlOnIOThreadDone));
}
void OnCheckUrlOnIOThreadDone() {
StopUILoop();
@@ -148,7 +148,7 @@ class SafeBrowsingServiceTestHelper
// Updates status from IO Thread.
void CheckStatusOnIOThread() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
safe_browsing_test_->UpdateSafeBrowsingStatus();
safe_browsing_test_->SafeBrowsingMessageLoop()->PostTask(
FROM_HERE, NewRunnableMethod(this,
@@ -160,8 +160,8 @@ class SafeBrowsingServiceTestHelper
DCHECK_EQ(MessageLoop::current(),
safe_browsing_test_->SafeBrowsingMessageLoop());
safe_browsing_test_->CheckIsDatabaseReady();
- ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, NewRunnableMethod(this,
- &SafeBrowsingServiceTestHelper::OnCheckStatusAfterDelayDone));
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod(
+ this, &SafeBrowsingServiceTestHelper::OnCheckStatusAfterDelayDone));
}
void OnCheckStatusAfterDelayDone() {
@@ -170,8 +170,8 @@ class SafeBrowsingServiceTestHelper
// Checks safebrowsing status after a given latency.
void CheckStatusAfterDelay(int64 wait_time_sec) {
- ChromeThread::PostDelayedTask(
- ChromeThread::IO,
+ BrowserThread::PostDelayedTask(
+ BrowserThread::IO,
FROM_HERE,
NewRunnableMethod(this,
&SafeBrowsingServiceTestHelper::CheckStatusOnIOThread),
@@ -181,7 +181,7 @@ class SafeBrowsingServiceTestHelper
private:
// Stops UI loop after desired status is updated.
void StopUILoop() {
- CHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
MessageLoopForUI::current()->Quit();
}
diff --git a/chrome/browser/search_engines/search_provider_install_data.cc b/chrome/browser/search_engines/search_provider_install_data.cc
index 132ffc2..bbf36d8 100644
--- a/chrome/browser/search_engines/search_provider_install_data.cc
+++ b/chrome/browser/search_engines/search_provider_install_data.cc
@@ -88,7 +88,7 @@ GoogleURLChangeNotifier::GoogleURLChangeNotifier(
}
void GoogleURLChangeNotifier::OnChange(const std::string& google_base_url) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (install_data_)
install_data_->OnGoogleURLChange(google_base_url);
}
@@ -121,7 +121,7 @@ GoogleURLObserver::GoogleURLObserver(
NotificationType ui_death_notification,
const NotificationSource& ui_death_source)
: change_notifier_(change_notifier) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
registrar_.Add(this, NotificationType::GOOGLE_URL_UPDATED,
NotificationService::AllSources());
registrar_.Add(this, ui_death_notification, ui_death_source);
@@ -131,11 +131,10 @@ void GoogleURLObserver::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
if (type == NotificationType::GOOGLE_URL_UPDATED) {
- ChromeThread::PostTask(ChromeThread::IO, FROM_HERE,
- NewRunnableMethod(
- change_notifier_.get(),
- &GoogleURLChangeNotifier::OnChange,
- UIThreadSearchTermsData().GoogleBaseURLValue()));
+ BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
+ NewRunnableMethod(change_notifier_.get(),
+ &GoogleURLChangeNotifier::OnChange,
+ UIThreadSearchTermsData().GoogleBaseURLValue()));
} else {
// This must be the death notification.
delete this;
@@ -171,7 +170,7 @@ SearchProviderInstallData::SearchProviderInstallData(
}
SearchProviderInstallData::~SearchProviderInstallData() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (load_handle_) {
DCHECK(web_service_.get());
@@ -180,7 +179,7 @@ SearchProviderInstallData::~SearchProviderInstallData() {
}
void SearchProviderInstallData::CallWhenLoaded(Task* task) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (provider_map_.get()) {
task->Run();
@@ -200,7 +199,7 @@ void SearchProviderInstallData::CallWhenLoaded(Task* task) {
SearchProviderInstallData::State SearchProviderInstallData::GetInstallState(
const GURL& requested_origin) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(provider_map_.get());
// First check to see if the origin is the default search provider.
@@ -231,7 +230,7 @@ void SearchProviderInstallData::OnGoogleURLChange(
void SearchProviderInstallData::OnWebDataServiceRequestDone(
WebDataService::Handle h,
const WDTypedResult* result) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// Reset the load_handle so that we don't try and cancel the load in
// the destructor.
@@ -264,7 +263,7 @@ void SearchProviderInstallData::OnWebDataServiceRequestDone(
}
void SearchProviderInstallData::SetDefault(const TemplateURL* template_url) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!template_url) {
default_search_origin_.clear();
@@ -282,7 +281,7 @@ void SearchProviderInstallData::SetDefault(const TemplateURL* template_url) {
}
void SearchProviderInstallData::OnLoadFailed() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
provider_map_.reset(new SearchHostToURLsMap());
IOThreadSearchTermsData search_terms_data(google_base_url_);
@@ -292,7 +291,7 @@ void SearchProviderInstallData::OnLoadFailed() {
}
void SearchProviderInstallData::NotifyLoaded() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
task_queue_.Run();
diff --git a/chrome/browser/search_engines/search_provider_install_data_unittest.cc b/chrome/browser/search_engines/search_provider_install_data_unittest.cc
index 50b4a5a..2cd8c5e 100644
--- a/chrome/browser/search_engines/search_provider_install_data_unittest.cc
+++ b/chrome/browser/search_engines/search_provider_install_data_unittest.cc
@@ -52,7 +52,7 @@ class TestGetInstallState :
}
// Runs the test. Returns true if all passed. False if any failed.
- bool RunTests(const ChromeThread& io_thread);
+ bool RunTests(const BrowserThread& io_thread);
private:
friend class base::RefCountedThreadSafe<TestGetInstallState>;
@@ -84,7 +84,7 @@ class TestGetInstallState :
DISALLOW_COPY_AND_ASSIGN(TestGetInstallState);
};
-bool TestGetInstallState::RunTests(const ChromeThread& io_thread) {
+bool TestGetInstallState::RunTests(const BrowserThread& io_thread) {
passed_ = true;
main_loop_ = MessageLoop::current();
@@ -167,7 +167,7 @@ class SearchProviderInstallDataTest : public testing::Test {
util_.GetWebDataService(),
NotificationType::RENDERER_PROCESS_TERMINATED,
Source<SearchProviderInstallDataTest>(this));
- io_thread_.reset(new ChromeThread(ChromeThread::IO));
+ io_thread_.reset(new BrowserThread(BrowserThread::IO));
io_thread_->Start();
}
@@ -216,7 +216,7 @@ class SearchProviderInstallDataTest : public testing::Test {
protected:
TemplateURLModelTestUtil util_;
- scoped_ptr<ChromeThread> io_thread_;
+ scoped_ptr<BrowserThread> io_thread_;
// Provides the search provider install state on the I/O thread. It must be
// deleted on the I/O thread, which is why it isn't a scoped_ptr.
diff --git a/chrome/browser/search_engines/search_provider_install_state_dispatcher_host.cc b/chrome/browser/search_engines/search_provider_install_state_dispatcher_host.cc
index 5d1b64d..86975e3 100644
--- a/chrome/browser/search_engines/search_provider_install_state_dispatcher_host.cc
+++ b/chrome/browser/search_engines/search_provider_install_state_dispatcher_host.cc
@@ -33,12 +33,12 @@ SearchProviderInstallStateDispatcherHost(
// This is initialized by ResourceMessageFilter. Do not add any non-trivial
// initialization here. Instead do it lazily when required.
DCHECK(ipc_sender);
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
SearchProviderInstallStateDispatcherHost::
~SearchProviderInstallStateDispatcherHost() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
}
void SearchProviderInstallStateDispatcherHost::Send(IPC::Message* message) {
@@ -48,7 +48,7 @@ void SearchProviderInstallStateDispatcherHost::Send(IPC::Message* message) {
bool SearchProviderInstallStateDispatcherHost::OnMessageReceived(
const IPC::Message& message,
bool* message_was_ok) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
bool handled = true;
IPC_BEGIN_MESSAGE_MAP_EX(SearchProviderInstallStateDispatcherHost, message,
*message_was_ok)
diff --git a/chrome/browser/search_engines/search_terms_data.cc b/chrome/browser/search_engines/search_terms_data.cc
index 2045837..46d9de5 100644
--- a/chrome/browser/search_engines/search_terms_data.cc
+++ b/chrome/browser/search_engines/search_terms_data.cc
@@ -54,27 +54,27 @@ std::string* UIThreadSearchTermsData::google_base_url_ = NULL;
UIThreadSearchTermsData::UIThreadSearchTermsData() {
// GoogleURLTracker::GoogleURL() DCHECKs this also, but adding it here helps
// us catch bad behavior at a more common place in this code.
- DCHECK(!ChromeThread::IsWellKnownThread(ChromeThread::UI) ||
- ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) ||
+ BrowserThread::CurrentlyOn(BrowserThread::UI));
}
std::string UIThreadSearchTermsData::GoogleBaseURLValue() const {
- DCHECK(!ChromeThread::IsWellKnownThread(ChromeThread::UI) ||
- ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) ||
+ BrowserThread::CurrentlyOn(BrowserThread::UI));
return google_base_url_ ?
(*google_base_url_) : GoogleURLTracker::GoogleURL().spec();
}
std::string UIThreadSearchTermsData::GetApplicationLocale() const {
- DCHECK(!ChromeThread::IsWellKnownThread(ChromeThread::UI) ||
- ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) ||
+ BrowserThread::CurrentlyOn(BrowserThread::UI));
return g_browser_process->GetApplicationLocale();
}
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
std::wstring UIThreadSearchTermsData::GetRlzParameterValue() const {
- DCHECK(!ChromeThread::IsWellKnownThread(ChromeThread::UI) ||
- ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) ||
+ BrowserThread::CurrentlyOn(BrowserThread::UI));
std::wstring rlz_string;
// For organic brandcodes do not use rlz at all. Empty brandcode usually
// means a chromium install. This is ok.
diff --git a/chrome/browser/search_engines/template_url_fetcher_unittest.cc b/chrome/browser/search_engines/template_url_fetcher_unittest.cc
index 1b28b5a..a2a2846 100644
--- a/chrome/browser/search_engines/template_url_fetcher_unittest.cc
+++ b/chrome/browser/search_engines/template_url_fetcher_unittest.cc
@@ -50,7 +50,7 @@ class TemplateURLFetcherTest : public testing::Test {
ASSERT_TRUE(test_server_.Start());
test_util_.SetUp();
- io_thread_.reset(new ChromeThread(ChromeThread::IO));
+ io_thread_.reset(new BrowserThread(BrowserThread::IO));
base::Thread::Options options;
options.message_loop_type = MessageLoop::TYPE_IO;
io_thread_->StartWithOptions(options);
@@ -71,7 +71,7 @@ class TemplateURLFetcherTest : public testing::Test {
protected:
TemplateURLModelTestUtil test_util_;
net::TestServer test_server_;
- scoped_ptr<ChromeThread> io_thread_;
+ scoped_ptr<BrowserThread> io_thread_;
private:
DISALLOW_COPY_AND_ASSIGN(TemplateURLFetcherTest);
diff --git a/chrome/browser/search_engines/template_url_model_test_util.cc b/chrome/browser/search_engines/template_url_model_test_util.cc
index 480a6ee..a01c3bb 100644
--- a/chrome/browser/search_engines/template_url_model_test_util.cc
+++ b/chrome/browser/search_engines/template_url_model_test_util.cc
@@ -34,10 +34,10 @@ class QuitTask2 : public Task {
// Blocks the caller until thread has finished servicing all pending
// requests.
-static void WaitForThreadToProcessRequests(ChromeThread::ID identifier) {
+static void WaitForThreadToProcessRequests(BrowserThread::ID identifier) {
// Schedule a task on the thread that is processed after all
// pending requests on the thread.
- ChromeThread::PostTask(identifier, FROM_HERE, new QuitTask2());
+ BrowserThread::PostTask(identifier, FROM_HERE, new QuitTask2());
// Run the current message loop. QuitTask2, when run, invokes Quit,
// which unblocks this.
MessageLoop::current()->Run();
@@ -60,7 +60,7 @@ class TemplateURLModelTestingProfile : public TestingProfile {
private:
scoped_refptr<WebDataService> service_;
ScopedTempDir temp_dir_;
- scoped_ptr<ChromeThread> db_thread_;
+ scoped_ptr<BrowserThread> db_thread_;
};
// Trivial subclass of TemplateURLModel that records the last invocation of
@@ -91,7 +91,7 @@ class TestingTemplateURLModel : public TemplateURLModel {
};
void TemplateURLModelTestingProfile::SetUp() {
- db_thread_.reset(new ChromeThread(ChromeThread::DB));
+ db_thread_.reset(new BrowserThread(BrowserThread::DB));
db_thread_->Start();
// Make unique temp directory.
@@ -113,7 +113,7 @@ void TemplateURLModelTestingProfile::TearDown() {
}
TemplateURLModelTestUtil::TemplateURLModelTestUtil()
- : ui_thread_(ChromeThread::UI, &message_loop_),
+ : ui_thread_(BrowserThread::UI, &message_loop_),
changed_count_(0) {
}
@@ -149,11 +149,11 @@ void TemplateURLModelTestUtil::ResetObserverCount() {
}
void TemplateURLModelTestUtil::BlockTillServiceProcessesRequests() {
- WaitForThreadToProcessRequests(ChromeThread::DB);
+ WaitForThreadToProcessRequests(BrowserThread::DB);
}
void TemplateURLModelTestUtil::BlockTillIOThreadProcessesRequests() {
- WaitForThreadToProcessRequests(ChromeThread::IO);
+ WaitForThreadToProcessRequests(BrowserThread::IO);
}
void TemplateURLModelTestUtil::VerifyLoad() {
diff --git a/chrome/browser/search_engines/template_url_model_test_util.h b/chrome/browser/search_engines/template_url_model_test_util.h
index 109e2cc..53f1fc8 100644
--- a/chrome/browser/search_engines/template_url_model_test_util.h
+++ b/chrome/browser/search_engines/template_url_model_test_util.h
@@ -88,7 +88,7 @@ class TemplateURLModelTestUtil : public TemplateURLModelObserver {
MessageLoopForUI message_loop_;
// Needed to make the DeleteOnUIThread trait of WebDataService work
// properly.
- ChromeThread ui_thread_;
+ BrowserThread ui_thread_;
scoped_ptr<TemplateURLModelTestingProfile> profile_;
scoped_ptr<TestingTemplateURLModel> model_;
int changed_count_;
diff --git a/chrome/browser/search_engines/template_url_model_unittest.cc b/chrome/browser/search_engines/template_url_model_unittest.cc
index 1d8ccef..b8ef9be 100644
--- a/chrome/browser/search_engines/template_url_model_unittest.cc
+++ b/chrome/browser/search_engines/template_url_model_unittest.cc
@@ -486,7 +486,7 @@ TEST_F(TemplateURLModelTest, GenerateSearchURLUsingTermsData) {
scoped_refptr<TestGenerateSearchURL> test_generate_search_url(
new TestGenerateSearchURL(&search_terms_data));
- ChromeThread io_thread(ChromeThread::IO);
+ BrowserThread io_thread(BrowserThread::IO);
io_thread.Start();
io_thread.message_loop()->PostTask(
FROM_HERE,
diff --git a/chrome/browser/search_engines/util.cc b/chrome/browser/search_engines/util.cc
index 958f740..677f6d6 100644
--- a/chrome/browser/search_engines/util.cc
+++ b/chrome/browser/search_engines/util.cc
@@ -41,7 +41,7 @@ static void RemoveDuplicatePrepopulateIDs(
std::vector<TemplateURL*>* template_urls,
WebDataService* service) {
DCHECK(template_urls);
- DCHECK(service == NULL || ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(service == NULL || BrowserThread::CurrentlyOn(BrowserThread::UI));
std::set<int> ids;
for (std::vector<TemplateURL*>::iterator i = template_urls->begin();
@@ -70,7 +70,7 @@ void MergeEnginesFromPrepopulateData(
WebDataService* service,
std::vector<TemplateURL*>* template_urls,
const TemplateURL** default_search_provider) {
- DCHECK(service == NULL || ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(service == NULL || BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(template_urls);
DCHECK(default_search_provider);
@@ -156,7 +156,7 @@ void GetSearchProvidersUsingKeywordResult(
std::vector<TemplateURL*>* template_urls,
const TemplateURL** default_search_provider,
int* new_resource_keyword_version) {
- DCHECK(service == NULL || ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(service == NULL || BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(template_urls);
DCHECK(template_urls->empty());
DCHECK(default_search_provider);
diff --git a/chrome/browser/service/service_process_control.cc b/chrome/browser/service/service_process_control.cc
index 6af47c3..6790b00 100644
--- a/chrome/browser/service/service_process_control.cc
+++ b/chrome/browser/service/service_process_control.cc
@@ -32,9 +32,9 @@ class ServiceProcessControl::Launcher
// After the comamnd is executed |task| is called with the process handle on
// the UI thread.
void Run(Task* task) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- ChromeThread::PostTask(ChromeThread::PROCESS_LAUNCHER, FROM_HERE,
+ BrowserThread::PostTask(BrowserThread::PROCESS_LAUNCHER, FROM_HERE,
NewRunnableMethod(this, &Launcher::DoRun, task));
}
@@ -44,22 +44,22 @@ class ServiceProcessControl::Launcher
void DoRun(Task* task) {
launched_ = base::LaunchApp(*cmd_line_.get(), false, true, NULL);
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this, &Launcher::DoDetectLaunched, task));
}
void DoDetectLaunched(Task* task) {
if (CheckServiceProcessRunning()) {
- ChromeThread::PostTask(ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this, &Launcher::Notify, task));
return;
}
// If the service process is not launched yet then check again in 2 seconds.
const int kDetectLaunchRetry = 2000;
- ChromeThread::PostDelayedTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostDelayedTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this, &Launcher::DoDetectLaunched, task),
kDetectLaunchRetry);
}
@@ -111,7 +111,7 @@ void ServiceProcessControl::ConnectInternal(Task* task) {
}
void ServiceProcessControl::Launch(Task* task) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// If the service process is already running then connects to it.
if (CheckServiceProcessRunning()) {
@@ -152,7 +152,7 @@ void ServiceProcessControl::Launch(Task* task) {
}
void ServiceProcessControl::OnProcessLaunched(Task* task) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (launcher_->launched()) {
// After we have successfully created the service process we try to connect
// to it. The launch task is transfered to a connect task.
@@ -177,7 +177,7 @@ void ServiceProcessControl::OnMessageReceived(const IPC::Message& message) {
}
void ServiceProcessControl::OnChannelConnected(int32 peer_pid) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!connect_done_task_.get())
return;
connect_done_task_->Run();
@@ -185,7 +185,7 @@ void ServiceProcessControl::OnChannelConnected(int32 peer_pid) {
}
void ServiceProcessControl::OnChannelError() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
channel_.reset();
if (!connect_done_task_.get())
return;
@@ -194,7 +194,7 @@ void ServiceProcessControl::OnChannelError() {
}
bool ServiceProcessControl::Send(IPC::Message* message) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!channel_.get())
return false;
return channel_->Send(message);
@@ -209,7 +209,7 @@ void ServiceProcessControl::OnGoodDay() {
void ServiceProcessControl::OnCloudPrintProxyIsEnabled(bool enabled,
std::string email) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (cloud_print_status_callback_ != NULL) {
cloud_print_status_callback_->Run(enabled, email);
cloud_print_status_callback_.reset();
diff --git a/chrome/browser/service/service_process_control_manager.cc b/chrome/browser/service/service_process_control_manager.cc
index 5e391a8..564dbe3 100644
--- a/chrome/browser/service/service_process_control_manager.cc
+++ b/chrome/browser/service/service_process_control_manager.cc
@@ -19,7 +19,7 @@ ServiceProcessControlManager::~ServiceProcessControlManager() {
ServiceProcessControl* ServiceProcessControlManager::GetProcessControl(
Profile* profile) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// TODO(hclam): We will have different service process for different types of
// service, but now we only create a new process for a different profile.
diff --git a/chrome/browser/speech/speech_input_bubble_controller.cc b/chrome/browser/speech/speech_input_bubble_controller.cc
index bf1f923..4cde92e 100644
--- a/chrome/browser/speech/speech_input_bubble_controller.cc
+++ b/chrome/browser/speech/speech_input_bubble_controller.cc
@@ -24,15 +24,15 @@ void SpeechInputBubbleController::CreateBubble(int caller_id,
int render_process_id,
int render_view_id,
const gfx::Rect& element_rect) {
- if (!ChromeThread::CurrentlyOn(ChromeThread::UI)) {
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this, &SpeechInputBubbleController::CreateBubble,
caller_id, render_process_id, render_view_id,
element_rect));
return;
}
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
TabContents* tab_contents = tab_util::GetTabContentsByID(render_process_id,
render_view_id);
@@ -72,13 +72,13 @@ void SpeechInputBubbleController::SetBubbleMessage(int caller_id,
void SpeechInputBubbleController::ProcessRequestInUiThread(
int caller_id, RequestType type, const string16& text, float volume) {
- if (!ChromeThread::CurrentlyOn(ChromeThread::UI)) {
- ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, NewRunnableMethod(
+ if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod(
this, &SpeechInputBubbleController::ProcessRequestInUiThread,
caller_id, type, text, volume));
return;
}
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// The bubble may have been closed before we got a chance to process this
// request. So check before proceeding.
if (!bubbles_.count(caller_id))
@@ -123,11 +123,11 @@ void SpeechInputBubbleController::ProcessRequestInUiThread(
void SpeechInputBubbleController::InfoBubbleButtonClicked(
SpeechInputBubble::Button button) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(current_bubble_caller_id_);
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
this,
&SpeechInputBubbleController::InvokeDelegateButtonClicked,
@@ -135,15 +135,15 @@ void SpeechInputBubbleController::InfoBubbleButtonClicked(
}
void SpeechInputBubbleController::InfoBubbleFocusChanged() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(current_bubble_caller_id_);
int old_bubble_caller_id = current_bubble_caller_id_;
current_bubble_caller_id_ = 0;
bubbles_[old_bubble_caller_id]->Hide();
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
this,
&SpeechInputBubbleController::InvokeDelegateFocusChanged,
diff --git a/chrome/browser/speech/speech_input_bubble_controller_unittest.cc b/chrome/browser/speech/speech_input_bubble_controller_unittest.cc
index f837130..55d7cc0 100644
--- a/chrome/browser/speech/speech_input_bubble_controller_unittest.cc
+++ b/chrome/browser/speech/speech_input_bubble_controller_unittest.cc
@@ -66,8 +66,8 @@ class SpeechInputBubbleControllerTest
public:
SpeechInputBubbleControllerTest()
: io_loop_(MessageLoop::TYPE_IO),
- ui_thread_(ChromeThread::UI), // constructs a new thread and loop
- io_thread_(ChromeThread::IO, &io_loop_), // resuses main thread loop
+ ui_thread_(BrowserThread::UI), // constructs a new thread and loop
+ io_thread_(BrowserThread::IO, &io_loop_), // resuses main thread loop
cancel_clicked_(false),
try_again_clicked_(false),
focus_changed_(false),
@@ -85,7 +85,7 @@ class SpeechInputBubbleControllerTest
virtual void InfoBubbleButtonClicked(int caller_id,
SpeechInputBubble::Button button) {
LOG(INFO) << "Received InfoBubbleButtonClicked for button " << button;
- EXPECT_TRUE(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (button == SpeechInputBubble::BUTTON_CANCEL) {
cancel_clicked_ = true;
} else if (button == SpeechInputBubble::BUTTON_TRY_AGAIN) {
@@ -96,7 +96,7 @@ class SpeechInputBubbleControllerTest
virtual void InfoBubbleFocusChanged(int caller_id) {
LOG(INFO) << "Received InfoBubbleFocusChanged";
- EXPECT_TRUE(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
focus_changed_ = true;
MessageLoop::current()->Quit();
}
@@ -126,7 +126,7 @@ class SpeechInputBubbleControllerTest
static SpeechInputBubble* CreateBubble(TabContents* tab_contents,
SpeechInputBubble::Delegate* delegate,
const gfx::Rect& element_rect) {
- EXPECT_TRUE(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Set up to activate the bubble soon after it gets created, since we test
// events sent by the bubble and those are handled only when the bubble is
// active.
@@ -139,8 +139,8 @@ class SpeechInputBubbleControllerTest
// The main thread of the test is marked as the IO thread and we create a new
// one for the UI thread.
MessageLoop io_loop_;
- ChromeThread ui_thread_;
- ChromeThread io_thread_;
+ BrowserThread ui_thread_;
+ BrowserThread io_thread_;
bool cancel_clicked_;
bool try_again_clicked_;
bool focus_changed_;
diff --git a/chrome/browser/speech/speech_input_dispatcher_host.cc b/chrome/browser/speech/speech_input_dispatcher_host.cc
index 7532e09..5c13e5c 100644
--- a/chrome/browser/speech/speech_input_dispatcher_host.cc
+++ b/chrome/browser/speech/speech_input_dispatcher_host.cc
@@ -119,7 +119,7 @@ SpeechInputManager* SpeechInputDispatcherHost::manager() {
bool SpeechInputDispatcherHost::OnMessageReceived(
const IPC::Message& msg, bool* msg_was_ok) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
bool handled = true;
IPC_BEGIN_MESSAGE_MAP_EX(SpeechInputDispatcherHost, msg, *msg_was_ok)
IPC_MESSAGE_HANDLER(ViewHostMsg_SpeechInput_StartRecognition,
@@ -169,7 +169,7 @@ void SpeechInputDispatcherHost::SendMessageToRenderView(IPC::Message* message,
void SpeechInputDispatcherHost::SetRecognitionResult(int caller_id,
const string16& result) {
LOG(INFO) << "SpeechInputDispatcherHost::SetRecognitionResult enter";
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
int caller_render_view_id = callers_->render_view_id(caller_id);
int caller_request_id = callers_->request_id(caller_id);
SendMessageToRenderView(
@@ -182,7 +182,7 @@ void SpeechInputDispatcherHost::SetRecognitionResult(int caller_id,
void SpeechInputDispatcherHost::DidCompleteRecording(int caller_id) {
LOG(INFO) << "SpeechInputDispatcherHost::DidCompleteRecording enter";
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
int caller_render_view_id = callers_->render_view_id(caller_id);
int caller_request_id = callers_->request_id(caller_id);
SendMessageToRenderView(
@@ -194,7 +194,7 @@ void SpeechInputDispatcherHost::DidCompleteRecording(int caller_id) {
void SpeechInputDispatcherHost::DidCompleteRecognition(int caller_id) {
LOG(INFO) << "SpeechInputDispatcherHost::DidCompleteRecognition enter";
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
int caller_render_view_id = callers_->render_view_id(caller_id);
int caller_request_id = callers_->request_id(caller_id);
SendMessageToRenderView(
diff --git a/chrome/browser/speech/speech_input_manager.cc b/chrome/browser/speech/speech_input_manager.cc
index a029bb4..dc96730f 100644
--- a/chrome/browser/speech/speech_input_manager.cc
+++ b/chrome/browser/speech/speech_input_manager.cc
@@ -222,7 +222,7 @@ void SpeechInputManagerImpl::CancelRecognitionAndInformDelegate(int caller_id) {
void SpeechInputManagerImpl::InfoBubbleButtonClicked(
int caller_id, SpeechInputBubble::Button button) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// Ignore if the caller id was not in our active recognizers list because the
// user might have clicked more than once, or recognition could have been
// cancelled due to other reasons before the user click was processed.
@@ -237,7 +237,7 @@ void SpeechInputManagerImpl::InfoBubbleButtonClicked(
}
void SpeechInputManagerImpl::InfoBubbleFocusChanged(int caller_id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// Ignore if the caller id was not in our active recognizers list because the
// user might have clicked more than once, or recognition could have been
// ended due to other reasons before the user click was processed.
diff --git a/chrome/browser/speech/speech_recognizer.cc b/chrome/browser/speech/speech_recognizer.cc
index a9f92e0..b4f75c7 100644
--- a/chrome/browser/speech/speech_recognizer.cc
+++ b/chrome/browser/speech/speech_recognizer.cc
@@ -131,7 +131,7 @@ SpeechRecognizer::~SpeechRecognizer() {
}
bool SpeechRecognizer::StartRecording() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(!audio_controller_.get());
DCHECK(!request_.get() || !request_->HasPendingRequest());
@@ -155,7 +155,7 @@ bool SpeechRecognizer::StartRecording() {
}
void SpeechRecognizer::CancelRecognition() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(audio_controller_.get() || request_.get());
// Stop recording if required.
@@ -171,7 +171,7 @@ void SpeechRecognizer::CancelRecognition() {
}
void SpeechRecognizer::StopRecording() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// If audio recording has already stopped and we are in recognition phase,
// silently ignore any more calls to stop recording.
@@ -225,7 +225,7 @@ void SpeechRecognizer::ReleaseAudioBuffers() {
// Invoked in the audio thread.
void SpeechRecognizer::OnError(AudioInputController* controller,
int error_code) {
- ChromeThread::PostTask(ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this,
&SpeechRecognizer::HandleOnError,
error_code));
@@ -249,7 +249,7 @@ void SpeechRecognizer::OnData(AudioInputController* controller,
return;
string* str_data = new string(reinterpret_cast<const char*>(data), size);
- ChromeThread::PostTask(ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this,
&SpeechRecognizer::HandleOnData,
str_data));
diff --git a/chrome/browser/speech/speech_recognizer_unittest.cc b/chrome/browser/speech/speech_recognizer_unittest.cc
index e049558..be9fa79 100644
--- a/chrome/browser/speech/speech_recognizer_unittest.cc
+++ b/chrome/browser/speech/speech_recognizer_unittest.cc
@@ -21,7 +21,7 @@ class SpeechRecognizerTest : public SpeechRecognizerDelegate,
public testing::Test {
public:
SpeechRecognizerTest()
- : io_thread_(ChromeThread::IO, &message_loop_),
+ : io_thread_(BrowserThread::IO, &message_loop_),
ALLOW_THIS_IN_INITIALIZER_LIST(
recognizer_(new SpeechRecognizer(this, 1))),
recording_complete_(false),
@@ -87,7 +87,7 @@ class SpeechRecognizerTest : public SpeechRecognizerDelegate,
protected:
MessageLoopForIO message_loop_;
- ChromeThread io_thread_;
+ BrowserThread io_thread_;
scoped_refptr<SpeechRecognizer> recognizer_;
bool recording_complete_;
bool recognition_complete_;