summaryrefslogtreecommitdiffstats
path: root/chrome/browser/search_engines
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/search_engines
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/search_engines')
-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
9 files changed, 42 insertions, 43 deletions
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);