summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/net/blob_url_request_job_factory.cc2
-rw-r--r--chrome/browser/net/chrome_cookie_policy.cc4
-rw-r--r--chrome/browser/net/chrome_net_log.cc16
-rw-r--r--chrome/browser/net/chrome_url_request_context.cc32
-rw-r--r--chrome/browser/net/cookie_policy_browsertest.cc4
-rw-r--r--chrome/browser/net/gaia/token_service.cc24
-rw-r--r--chrome/browser/net/gaia/token_service_unittest.h12
-rw-r--r--chrome/browser/net/net_pref_observer.cc6
-rw-r--r--chrome/browser/net/preconnect.cc6
-rw-r--r--chrome/browser/net/predictor.cc40
-rw-r--r--chrome/browser/net/predictor_api.cc48
-rw-r--r--chrome/browser/net/predictor_unittest.cc4
-rw-r--r--chrome/browser/net/sqlite_persistent_cookie_store.cc21
-rw-r--r--chrome/browser/net/url_request_mock_util.cc2
-rw-r--r--chrome/browser/net/websocket_experiment/websocket_experiment_runner.cc12
-rw-r--r--chrome/browser/net/websocket_experiment/websocket_experiment_task.cc4
-rw-r--r--chrome/browser/password_manager/native_backend_gnome_x.cc104
-rw-r--r--chrome/browser/password_manager/native_backend_kwallet_x.cc2
-rw-r--r--chrome/browser/password_manager/password_manager_unittest.cc4
-rw-r--r--chrome/browser/password_manager/password_store.cc10
-rw-r--r--chrome/browser/password_manager/password_store_default.cc6
-rw-r--r--chrome/browser/password_manager/password_store_default_unittest.cc49
-rw-r--r--chrome/browser/password_manager/password_store_mac_unittest.cc6
-rw-r--r--chrome/browser/password_manager/password_store_win_unittest.cc28
-rw-r--r--chrome/browser/password_manager/password_store_x.cc2
-rw-r--r--chrome/browser/password_manager/password_store_x_unittest.cc63
-rw-r--r--chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc2
-rw-r--r--chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc4
-rw-r--r--chrome/browser/printing/print_dialog_cloud.cc40
-rw-r--r--chrome/browser/printing/print_dialog_cloud_uitest.cc8
-rw-r--r--chrome/browser/printing/print_dialog_cloud_unittest.cc40
-rw-r--r--chrome/browser/printing/print_dialog_gtk.cc4
-rw-r--r--chrome/browser/printing/print_job_worker.cc6
33 files changed, 321 insertions, 294 deletions
diff --git a/chrome/browser/net/blob_url_request_job_factory.cc b/chrome/browser/net/blob_url_request_job_factory.cc
index 7297795..b37be6d 100644
--- a/chrome/browser/net/blob_url_request_job_factory.cc
+++ b/chrome/browser/net/blob_url_request_job_factory.cc
@@ -31,7 +31,7 @@ URLRequestJob* BlobURLRequestJobFactory(URLRequest* request,
}
return new webkit_blob::BlobURLRequestJob(
request, data,
- ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE));
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE));
}
}
diff --git a/chrome/browser/net/chrome_cookie_policy.cc b/chrome/browser/net/chrome_cookie_policy.cc
index 28c7e95..3d11e14 100644
--- a/chrome/browser/net/chrome_cookie_policy.cc
+++ b/chrome/browser/net/chrome_cookie_policy.cc
@@ -29,7 +29,7 @@ ChromeCookiePolicy::~ChromeCookiePolicy() {
int ChromeCookiePolicy::CanGetCookies(const GURL& url,
const GURL& first_party,
net::CompletionCallback* callback) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (host_content_settings_map_->BlockThirdPartyCookies()) {
net::StaticCookiePolicy policy(
@@ -66,7 +66,7 @@ int ChromeCookiePolicy::CanSetCookie(const GURL& url,
const GURL& first_party,
const std::string& cookie_line,
net::CompletionCallback* callback) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (host_content_settings_map_->BlockThirdPartyCookies()) {
net::StaticCookiePolicy policy(
diff --git a/chrome/browser/net/chrome_net_log.cc b/chrome/browser/net/chrome_net_log.cc
index 1003dfa..73adc36 100644
--- a/chrome/browser/net/chrome_net_log.cc
+++ b/chrome/browser/net/chrome_net_log.cc
@@ -21,7 +21,7 @@ ChromeNetLog::ChromeNetLog()
: next_id_(1),
passive_collector_(new PassiveLogCollector),
load_timing_observer_(new LoadTimingObserver) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
AddObserver(passive_collector_.get());
AddObserver(load_timing_observer_.get());
@@ -33,7 +33,7 @@ ChromeNetLog::ChromeNetLog()
}
ChromeNetLog::~ChromeNetLog() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
RemoveObserver(passive_collector_.get());
RemoveObserver(load_timing_observer_.get());
if (net_log_logger_.get()) {
@@ -49,8 +49,8 @@ void ChromeNetLog::AddEntry(EventType type,
// This must be invoked when we're on the IO thread, or if the IO thread's
// message loop isn't valid. The later can happen if this is invoked when the
// IOThread is shuting down the MessageLoop.
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO) ||
- !ChromeThread::IsMessageLoopValid(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO) ||
+ !BrowserThread::IsMessageLoopValid(BrowserThread::IO));
// Notify all of the log observers.
FOR_EACH_OBSERVER(Observer, observers_,
@@ -58,12 +58,12 @@ void ChromeNetLog::AddEntry(EventType type,
}
uint32 ChromeNetLog::NextID() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
return next_id_++;
}
net::NetLog::LogLevel ChromeNetLog::GetLogLevel() const {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// Look through all the observers and find the finest granularity
// log level (higher values of the enum imply *lower* log levels).
@@ -77,11 +77,11 @@ net::NetLog::LogLevel ChromeNetLog::GetLogLevel() const {
}
void ChromeNetLog::AddObserver(Observer* observer) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
observers_.AddObserver(observer);
}
void ChromeNetLog::RemoveObserver(Observer* observer) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
observers_.RemoveObserver(observer);
}
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc
index 79a29c1..9f053f3 100644
--- a/chrome/browser/net/chrome_url_request_context.cc
+++ b/chrome/browser/net/chrome_url_request_context.cc
@@ -51,11 +51,11 @@ namespace {
// ----------------------------------------------------------------------------
void CheckCurrentlyOnIOThread() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
}
void CheckCurrentlyOnMainThread() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
// ----------------------------------------------------------------------------
@@ -74,7 +74,7 @@ net::ProxyConfigService* CreateProxyConfigService(Profile* profile) {
// Use system settings.
// TODO(port): the IO and FILE message loops are only used by Linux. Can
// that code be moved to chrome/browser instead of being in net, so that it
- // can use ChromeThread instead of raw MessageLoop pointers? See bug 25354.
+ // can use BrowserThread instead of raw MessageLoop pointers? See bug 25354.
#if defined(OS_CHROMEOS)
return new chromeos::ProxyConfigService(
profile->GetChromeOSProxyConfigServiceImpl());
@@ -145,8 +145,8 @@ class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate {
virtual void OnCookieChanged(
const net::CookieMonster::CanonicalCookie& cookie,
bool removed) {
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this,
&ChromeCookieMonsterDelegate::OnCookieChangedAsyncHelper,
cookie,
@@ -161,7 +161,7 @@ class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate {
// thread.
class ProfileGetter
: public base::RefCountedThreadSafe<ProfileGetter,
- ChromeThread::DeleteOnUIThread>,
+ BrowserThread::DeleteOnUIThread>,
public NotificationObserver {
public:
explicit ProfileGetter(Profile* profile) : profile_(profile) {
@@ -269,7 +269,7 @@ ChromeURLRequestContext* FactoryForOriginal::Create() {
net::HttpCache::DefaultBackend* backend = new net::HttpCache::DefaultBackend(
net::DISK_CACHE, disk_cache_path_, cache_size_,
- ChromeThread::GetMessageLoopProxyForThread(ChromeThread::CACHE));
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE));
net::HttpCache* cache =
new net::HttpCache(context->host_resolver(),
context->dnsrr_resolver(),
@@ -480,7 +480,7 @@ ChromeURLRequestContext* FactoryForMedia::Create() {
// TODO(hclam): make the maximum size of media cache configurable.
net::HttpCache::DefaultBackend* backend = new net::HttpCache::DefaultBackend(
net::MEDIA_CACHE, disk_cache_path_, cache_size_,
- ChromeThread::GetMessageLoopProxyForThread(ChromeThread::CACHE));
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE));
net::HttpCache* main_cache =
main_context->http_transaction_factory()->GetCache();
@@ -576,7 +576,7 @@ void ChromeURLRequestContextGetter::RegisterUserPrefs(
net::CookieStore* ChromeURLRequestContextGetter::GetCookieStore() {
// If we are running on the IO thread this is real easy.
- if (ChromeThread::CurrentlyOn(ChromeThread::IO))
+ if (BrowserThread::CurrentlyOn(BrowserThread::IO))
return GetURLRequestContext()->cookie_store();
// If we aren't running on the IO thread, we cannot call
@@ -586,8 +586,8 @@ net::CookieStore* ChromeURLRequestContextGetter::GetCookieStore() {
base::WaitableEvent completion(false, false);
net::CookieStore* result = NULL;
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this,
&ChromeURLRequestContextGetter::GetCookieStoreAsyncHelper,
&completion,
@@ -600,7 +600,7 @@ net::CookieStore* ChromeURLRequestContextGetter::GetCookieStore() {
scoped_refptr<base::MessageLoopProxy>
ChromeURLRequestContextGetter::GetIOMessageLoopProxy() {
- return ChromeThread::GetMessageLoopProxyForThread(ChromeThread::IO);
+ return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
}
// static
@@ -672,8 +672,8 @@ void ChromeURLRequestContextGetter::Observe(
if (*pref_name_in == prefs::kAcceptLanguages) {
std::string accept_language =
prefs->GetString(prefs::kAcceptLanguages);
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
this,
&ChromeURLRequestContextGetter::OnAcceptLanguageChange,
@@ -681,8 +681,8 @@ void ChromeURLRequestContextGetter::Observe(
} else if (*pref_name_in == prefs::kDefaultCharset) {
std::string default_charset =
prefs->GetString(prefs::kDefaultCharset);
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
this,
&ChromeURLRequestContextGetter::OnDefaultCharsetChange,
diff --git a/chrome/browser/net/cookie_policy_browsertest.cc b/chrome/browser/net/cookie_policy_browsertest.cc
index de87969..822154e 100644
--- a/chrome/browser/net/cookie_policy_browsertest.cc
+++ b/chrome/browser/net/cookie_policy_browsertest.cc
@@ -52,8 +52,8 @@ class CookiePolicyBrowserTest : public InProcessBrowserTest {
URLRequestContextGetter* context_getter =
browser()->profile()->GetRequestContext();
EXPECT_TRUE(
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
new GetCookiesTask(url, context_getter, &event, &cookies)));
EXPECT_TRUE(event.Wait());
return cookies;
diff --git a/chrome/browser/net/gaia/token_service.cc b/chrome/browser/net/gaia/token_service.cc
index 0f2b1ac..6ba25ac 100644
--- a/chrome/browser/net/gaia/token_service.cc
+++ b/chrome/browser/net/gaia/token_service.cc
@@ -21,18 +21,18 @@ const char* TokenService::kServices[] = {GaiaConstants::kSyncService,
GaiaConstants::kTalkService};
TokenService::TokenService()
: token_loading_query_(0) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
TokenService::~TokenService() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
ResetCredentialsInMemory();
}
void TokenService::Initialize(const char* const source,
Profile* profile) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!source_.empty()) {
// Already initialized.
return;
@@ -66,7 +66,7 @@ void TokenService::Initialize(const char* const source,
}
void TokenService::ResetCredentialsInMemory() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Terminate any running fetchers. Callbacks will not return.
for (int i = 0; i < kNumServices; i++) {
@@ -85,7 +85,7 @@ void TokenService::ResetCredentialsInMemory() {
void TokenService::UpdateCredentials(
const GaiaAuthConsumer::ClientLoginResult& credentials) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
credentials_ = credentials;
// Cancels any currently running requests.
@@ -95,18 +95,18 @@ void TokenService::UpdateCredentials(
}
void TokenService::LoadTokensFromDB() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
token_loading_query_ = web_data_service_->GetAllTokens(this);
}
void TokenService::SaveAuthTokenToDB(const std::string& service,
const std::string& auth_token) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
web_data_service_->SetTokenForService(service, auth_token);
}
void TokenService::EraseTokensFromDB() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
web_data_service_->RemoveAllTokens();
}
@@ -123,7 +123,7 @@ const std::string& TokenService::GetLsid() const {
}
void TokenService::StartFetchingTokens() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(AreCredentialsValid());
for (int i = 0; i < kNumServices; i++) {
fetchers_[i]->StartIssueAuthToken(credentials_.sid,
@@ -183,7 +183,7 @@ void TokenService::IssueAuthTokenForTest(const std::string& service,
void TokenService::OnIssueAuthTokenSuccess(const std::string& service,
const std::string& auth_token) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
LOG(INFO) << "Got an authorization token for " << service;
token_map_[service] = auth_token;
FireTokenAvailableNotification(service, auth_token);
@@ -192,14 +192,14 @@ void TokenService::OnIssueAuthTokenSuccess(const std::string& service,
void TokenService::OnIssueAuthTokenFailure(const std::string& service,
const GoogleServiceAuthError& error) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
LOG(WARNING) << "Auth token issuing failed for service:" << service;
FireTokenRequestFailedNotification(service, error);
}
void TokenService::OnWebDataServiceRequestDone(WebDataService::Handle h,
const WDTypedResult* result) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(token_loading_query_);
token_loading_query_ = 0;
diff --git a/chrome/browser/net/gaia/token_service_unittest.h b/chrome/browser/net/gaia/token_service_unittest.h
index ad46138..674baf0 100644
--- a/chrome/browser/net/gaia/token_service_unittest.h
+++ b/chrome/browser/net/gaia/token_service_unittest.h
@@ -63,8 +63,8 @@ class TokenFailedTracker : public TestNotificationTracker {
class TokenServiceTestHarness : public testing::Test {
public:
TokenServiceTestHarness()
- : ui_thread_(ChromeThread::UI, &message_loop_),
- db_thread_(ChromeThread::DB) {
+ : ui_thread_(BrowserThread::UI, &message_loop_),
+ db_thread_(BrowserThread::DB) {
}
virtual void SetUp() {
@@ -108,8 +108,8 @@ class TokenServiceTestHarness : public testing::Test {
// to the end of the DB thread, so when we reach this task, all DB
// operations should be complete.
WaitableEvent done(false, false);
- ChromeThread::PostTask(
- ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(
+ BrowserThread::DB, FROM_HERE, new SignalingTask(&done));
done.Wait();
// Notifications should be returned from the DB thread onto the UI thread.
@@ -117,8 +117,8 @@ class TokenServiceTestHarness : public testing::Test {
}
MessageLoopForUI message_loop_;
- ChromeThread ui_thread_; // Mostly so DCHECKS pass.
- ChromeThread db_thread_; // WDS on here
+ BrowserThread ui_thread_; // Mostly so DCHECKS pass.
+ BrowserThread db_thread_; // WDS on here
TokenService service_;
TokenAvailableTracker success_tracker_;
diff --git a/chrome/browser/net/net_pref_observer.cc b/chrome/browser/net/net_pref_observer.cc
index f81febf..91f1f1e 100644
--- a/chrome/browser/net/net_pref_observer.cc
+++ b/chrome/browser/net/net_pref_observer.cc
@@ -10,17 +10,17 @@
#include "chrome/common/pref_names.h"
NetPrefObserver::NetPrefObserver(PrefService* prefs) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
dns_prefetching_enabled_.Init(prefs::kDnsPrefetchingEnabled, prefs, this);
}
NetPrefObserver::~NetPrefObserver() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
void NetPrefObserver::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
chrome_browser_net::EnablePredictor(*dns_prefetching_enabled_);
}
diff --git a/chrome/browser/net/preconnect.cc b/chrome/browser/net/preconnect.cc
index 13a3cc9..649b2c2 100644
--- a/chrome/browser/net/preconnect.cc
+++ b/chrome/browser/net/preconnect.cc
@@ -24,8 +24,8 @@ namespace chrome_browser_net {
void Preconnect::PreconnectOnUIThread(const GURL& url,
UrlInfo::ResolutionMotivation motivation) {
// Prewarm connection to Search URL.
- ChromeThread::PostTask(
- ChromeThread::IO,
+ BrowserThread::PostTask(
+ BrowserThread::IO,
FROM_HERE,
NewRunnableFunction(Preconnect::PreconnectOnIOThread, url, motivation));
return;
@@ -44,7 +44,7 @@ void Preconnect::Connect(const GURL& url) {
URLRequestContextGetter* getter = Profile::GetDefaultRequestContext();
if (!getter)
return;
- if (!ChromeThread::CurrentlyOn(ChromeThread::IO)) {
+ if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
LOG(DFATAL) << "This must be run only on the IO thread.";
return;
}
diff --git a/chrome/browser/net/predictor.cc b/chrome/browser/net/predictor.cc
index c93e62e..d91341f 100644
--- a/chrome/browser/net/predictor.cc
+++ b/chrome/browser/net/predictor.cc
@@ -99,7 +99,7 @@ Predictor::~Predictor() {
}
void Predictor::Shutdown() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(!shutdown_);
shutdown_ = true;
@@ -111,7 +111,7 @@ void Predictor::Shutdown() {
// Overloaded Resolve() to take a vector of names.
void Predictor::ResolveList(const UrlList& urls,
UrlInfo::ResolutionMotivation motivation) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
for (UrlList::const_iterator it = urls.begin(); it < urls.end(); ++it) {
AppendToResolutionQueue(*it, motivation);
@@ -122,7 +122,7 @@ void Predictor::ResolveList(const UrlList& urls,
// to the queue.
void Predictor::Resolve(const GURL& url,
UrlInfo::ResolutionMotivation motivation) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!url.has_host())
return;
AppendToResolutionQueue(url, motivation);
@@ -130,7 +130,7 @@ void Predictor::Resolve(const GURL& url,
void Predictor::LearnFromNavigation(const GURL& referring_url,
const GURL& target_url) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(referring_url == referring_url.GetWithEmptyPath());
DCHECK(target_url == target_url.GetWithEmptyPath());
DCHECK(target_url != referring_url);
@@ -205,8 +205,8 @@ void Predictor::AnticipateOmniboxUrl(const GURL& url, bool preconnectable) {
last_omnibox_preresolve_ = now;
// Perform at least DNS pre-resolution.
- ChromeThread::PostTask(
- ChromeThread::IO,
+ BrowserThread::PostTask(
+ BrowserThread::IO,
FROM_HERE,
NewRunnableMethod(this, &Predictor::Resolve, CanonicalizeUrl(url),
motivation));
@@ -225,14 +225,14 @@ void Predictor::PredictFrameSubresources(const GURL& url) {
DCHECK(url.GetWithEmptyPath() == url);
// Add one pass through the message loop to allow current navigation to
// proceed.
- ChromeThread::PostTask(
- ChromeThread::IO,
+ BrowserThread::PostTask(
+ BrowserThread::IO,
FROM_HERE,
NewRunnableMethod(this, &Predictor::PrepareFrameSubresources, url));
}
void Predictor::PrepareFrameSubresources(const GURL& url) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(url.GetWithEmptyPath() == url);
Referrers::iterator it = referrers_.find(url);
if (referrers_.end() == it)
@@ -331,7 +331,7 @@ struct RightToLeftStringSorter {
};
void Predictor::GetHtmlReferrerLists(std::string* output) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (referrers_.empty())
return;
@@ -382,7 +382,7 @@ void Predictor::GetHtmlReferrerLists(std::string* output) {
}
void Predictor::GetHtmlInfo(std::string* output) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// Local lists for calling UrlInfo
UrlInfo::UrlInfoTable name_not_found;
UrlInfo::UrlInfoTable name_preresolved;
@@ -421,7 +421,7 @@ void Predictor::GetHtmlInfo(std::string* output) {
UrlInfo* Predictor::AppendToResolutionQueue(
const GURL& url,
UrlInfo::ResolutionMotivation motivation) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(url.has_host());
if (shutdown_)
@@ -446,7 +446,7 @@ UrlInfo* Predictor::AppendToResolutionQueue(
}
void Predictor::StartSomeQueuedResolutions() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
while (!work_queue_.IsEmpty() &&
pending_lookups_.size() < max_concurrent_dns_lookups_) {
@@ -478,7 +478,7 @@ void Predictor::StartSomeQueuedResolutions() {
}
bool Predictor::CongestionControlPerformed(UrlInfo* info) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// Note: queue_duration is ONLY valid after we go to assigned state.
if (info->queue_duration() < max_dns_queue_delay_)
return false;
@@ -497,7 +497,7 @@ bool Predictor::CongestionControlPerformed(UrlInfo* info) {
void Predictor::OnLookupFinished(LookupRequest* request, const GURL& url,
bool found) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
LookupFinished(request, url, found);
pending_lookups_.erase(request);
@@ -508,7 +508,7 @@ void Predictor::OnLookupFinished(LookupRequest* request, const GURL& url,
void Predictor::LookupFinished(LookupRequest* request, const GURL& url,
bool found) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
UrlInfo* info = &results_[url];
DCHECK(info->HasUrl(url));
if (info->is_marked_to_delete()) {
@@ -522,7 +522,7 @@ void Predictor::LookupFinished(LookupRequest* request, const GURL& url,
}
void Predictor::DiscardAllResults() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// Delete anything listed so far in this session that shows in about:dns.
referrers_.clear();
@@ -561,7 +561,7 @@ void Predictor::DiscardAllResults() {
}
void Predictor::TrimReferrers() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
std::vector<GURL> urls;
for (Referrers::const_iterator it = referrers_.begin();
it != referrers_.end(); ++it)
@@ -572,7 +572,7 @@ void Predictor::TrimReferrers() {
}
void Predictor::SerializeReferrers(ListValue* referral_list) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
referral_list->Clear();
referral_list->Append(new FundamentalValue(PREDICTOR_REFERRER_VERSION));
for (Referrers::const_iterator it = referrers_.begin();
@@ -590,7 +590,7 @@ void Predictor::SerializeReferrers(ListValue* referral_list) {
}
void Predictor::DeserializeReferrers(const ListValue& referral_list) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
int format_version = -1;
if (referral_list.GetSize() > 0 &&
referral_list.GetInteger(0, &format_version) &&
diff --git a/chrome/browser/net/predictor_api.cc b/chrome/browser/net/predictor_api.cc
index 2bfcfd6..42f2870 100644
--- a/chrome/browser/net/predictor_api.cc
+++ b/chrome/browser/net/predictor_api.cc
@@ -101,7 +101,7 @@ void EnablePredictor(bool enable) {
}
void OnTheRecord(bool enable) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (on_the_record_switch == enable)
return;
on_the_record_switch = enable;
@@ -137,23 +137,23 @@ void DnsPrefetchList(const NameList& hostnames) {
urls.push_back(GURL("http://" + *it + ":80"));
}
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DnsPrefetchMotivatedList(urls, UrlInfo::PAGE_SCAN_MOTIVATED);
}
static void DnsPrefetchMotivatedList(
const UrlList& urls,
UrlInfo::ResolutionMotivation motivation) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI) ||
- ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) ||
+ BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!predictor_enabled || NULL == g_predictor)
return;
- if (ChromeThread::CurrentlyOn(ChromeThread::IO)) {
+ if (BrowserThread::CurrentlyOn(BrowserThread::IO)) {
g_predictor->ResolveList(urls, motivation);
} else {
- ChromeThread::PostTask(
- ChromeThread::IO,
+ BrowserThread::PostTask(
+ BrowserThread::IO,
FROM_HERE,
NewRunnableMethod(g_predictor,
&Predictor::ResolveList, urls, motivation));
@@ -162,7 +162,7 @@ static void DnsPrefetchMotivatedList(
// This API is used by the autocomplete popup box (where URLs are typed).
void AnticipateOmniboxUrl(const GURL& url, bool preconnectable) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!predictor_enabled || NULL == g_predictor)
return;
if (!url.is_valid() || !url.has_host())
@@ -189,21 +189,21 @@ void PreconnectUrlAndSubresources(const GURL& url) {
//------------------------------------------------------------------------------
void PredictFrameSubresources(const GURL& url) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!predictor_enabled || NULL == g_predictor)
return;
g_predictor->PredictFrameSubresources(url);
}
void LearnAboutInitialNavigation(const GURL& url) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!predictor_enabled || NULL == g_initial_observer )
return;
g_initial_observer->Append(url);
}
void LearnFromNavigation(const GURL& referring_url, const GURL& target_url) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!predictor_enabled || NULL == g_predictor)
return;
g_predictor->LearnFromNavigation(referring_url, target_url);
@@ -217,7 +217,7 @@ typedef std::map<int, UrlInfo> ObservedResolutionMap;
// Member definitions for InitialObserver class.
void InitialObserver::Append(const GURL& url) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!on_the_record_switch || NULL == g_predictor)
return;
@@ -232,7 +232,7 @@ void InitialObserver::Append(const GURL& url) {
}
void InitialObserver::GetInitialDnsResolutionList(ListValue* startup_list) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(startup_list);
startup_list->Clear();
DCHECK_EQ(0u, startup_list->GetSize());
@@ -246,7 +246,7 @@ void InitialObserver::GetInitialDnsResolutionList(ListValue* startup_list) {
}
void InitialObserver::GetFirstResolutionsHtml(std::string* output) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
UrlInfo::UrlInfoTable resolution_list;
{
@@ -322,7 +322,7 @@ class OffTheRecordObserver : public NotificationObserver {
// Provide global support for the about:dns page.
void PredictorGetHtmlInfo(std::string* output) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
output->append("<html><head><title>About DNS</title>"
// We'd like the following no-cache... but it doesn't work.
@@ -353,7 +353,7 @@ void PredictorGetHtmlInfo(std::string* output) {
static void InitNetworkPredictor(TimeDelta max_dns_queue_delay,
size_t max_concurrent, PrefService* user_prefs, PrefService* local_state,
bool preconnect_enabled) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
bool prefetching_enabled =
user_prefs->GetBoolean(prefs::kDnsPrefetchingEnabled);
@@ -375,7 +375,7 @@ void FinalizePredictorInitialization(
Predictor* global_predictor,
const UrlList& startup_urls,
ListValue* referral_list) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
g_predictor = global_predictor;
g_initial_observer = new InitialObserver();
@@ -386,7 +386,7 @@ void FinalizePredictorInitialization(
}
void FreePredictorResources() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
g_predictor = NULL; // Owned and released by io_thread.cc.
delete g_initial_observer;
g_initial_observer = NULL;
@@ -400,7 +400,7 @@ static void SaveDnsPrefetchStateForNextStartupAndTrimOnIOThread(
ListValue* startup_list,
ListValue* referral_list,
base::WaitableEvent* completion) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (NULL == g_predictor) {
completion->Signal();
@@ -421,15 +421,15 @@ static void SaveDnsPrefetchStateForNextStartupAndTrimOnIOThread(
}
void SavePredictorStateForNextStartupAndTrim(PrefService* prefs) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!predictor_enabled || g_predictor == NULL)
return;
base::WaitableEvent completion(true, false);
- bool posted = ChromeThread::PostTask(
- ChromeThread::IO,
+ bool posted = BrowserThread::PostTask(
+ BrowserThread::IO,
FROM_HERE,
NewRunnableFunction(SaveDnsPrefetchStateForNextStartupAndTrimOnIOThread,
prefs->GetMutableList(prefs::kDnsStartupPrefetchList),
@@ -443,7 +443,7 @@ void SavePredictorStateForNextStartupAndTrim(PrefService* prefs) {
static UrlList GetPredictedUrlListAtStartup(PrefService* user_prefs,
PrefService* local_state) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
UrlList urls;
// Recall list of URLs we learned about during last session.
// This may catch secondary hostnames, pulled in by the homepages. It will
@@ -503,7 +503,7 @@ static UrlList GetPredictedUrlListAtStartup(PrefService* user_prefs,
PredictorInit::PredictorInit(PrefService* user_prefs,
PrefService* local_state,
bool preconnect_enabled) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Set up a field trial to see what disabling DNS pre-resolution does to
// latency of page loads.
FieldTrial::Probability kDivisor = 1000;
diff --git a/chrome/browser/net/predictor_unittest.cc b/chrome/browser/net/predictor_unittest.cc
index 071c66f..38d916a 100644
--- a/chrome/browser/net/predictor_unittest.cc
+++ b/chrome/browser/net/predictor_unittest.cc
@@ -62,7 +62,7 @@ class WaitForResolutionHelper {
class PredictorTest : public testing::Test {
public:
PredictorTest()
- : io_thread_(ChromeThread::IO, &loop_),
+ : io_thread_(BrowserThread::IO, &loop_),
host_resolver_(new net::MockCachingHostResolver()),
default_max_queueing_delay_(TimeDelta::FromMilliseconds(
PredictorInit::kMaxPrefetchQueueingDelayMs)) {
@@ -96,7 +96,7 @@ class PredictorTest : public testing::Test {
// must not outlive the message loop, otherwise bad things can happen
// (like posting to a deleted message loop).
MessageLoop loop_;
- ChromeThread io_thread_;
+ BrowserThread io_thread_;
protected:
scoped_ptr<net::MockCachingHostResolver> host_resolver_;
diff --git a/chrome/browser/net/sqlite_persistent_cookie_store.cc b/chrome/browser/net/sqlite_persistent_cookie_store.cc
index b70ca15..dbaa351 100644
--- a/chrome/browser/net/sqlite_persistent_cookie_store.cc
+++ b/chrome/browser/net/sqlite_persistent_cookie_store.cc
@@ -117,7 +117,7 @@ void SQLitePersistentCookieStore::Backend::BatchOperation(
static const int kCommitIntervalMs = 30 * 1000;
// Commit right away if we have more than 512 outstanding operations.
static const size_t kCommitAfterBatchSize = 512;
- DCHECK(!ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::DB));
// We do a full copy of the cookie here, and hopefully just here.
scoped_ptr<PendingOperation> po(new PendingOperation(op, cc));
@@ -131,18 +131,19 @@ void SQLitePersistentCookieStore::Backend::BatchOperation(
if (num_pending == 1) {
// We've gotten our first entry for this batch, fire off the timer.
- ChromeThread::PostDelayedTask(
- ChromeThread::DB, FROM_HERE,
+ BrowserThread::PostDelayedTask(
+ BrowserThread::DB, FROM_HERE,
NewRunnableMethod(this, &Backend::Commit), kCommitIntervalMs);
} else if (num_pending == kCommitAfterBatchSize) {
// We've reached a big enough batch, fire off a commit now.
- ChromeThread::PostTask(
- ChromeThread::DB, FROM_HERE, NewRunnableMethod(this, &Backend::Commit));
+ BrowserThread::PostTask(
+ BrowserThread::DB, FROM_HERE,
+ NewRunnableMethod(this, &Backend::Commit));
}
}
void SQLitePersistentCookieStore::Backend::Commit() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
PendingOperationsList ops;
{
AutoLock locked(pending_lock_);
@@ -233,15 +234,15 @@ void SQLitePersistentCookieStore::Backend::Commit() {
// pending commit timer that will be holding a reference on us, but if/when
// this fires we will already have been cleaned up and it will be ignored.
void SQLitePersistentCookieStore::Backend::Close() {
- DCHECK(!ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::DB));
// Must close the backend on the background thread.
- ChromeThread::PostTask(
- ChromeThread::DB, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::DB, FROM_HERE,
NewRunnableMethod(this, &Backend::InternalBackgroundClose));
}
void SQLitePersistentCookieStore::Backend::InternalBackgroundClose() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
// Commit any pending operations
Commit();
diff --git a/chrome/browser/net/url_request_mock_util.cc b/chrome/browser/net/url_request_mock_util.cc
index 05ec594..42538ed 100644
--- a/chrome/browser/net/url_request_mock_util.cc
+++ b/chrome/browser/net/url_request_mock_util.cc
@@ -21,7 +21,7 @@ namespace chrome_browser_net {
void SetUrlRequestMocksEnabled(bool enabled) {
// Since this involves changing the URLRequest ProtocolFactory, we need to
// run on the IO thread.
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (enabled) {
URLRequestFilter::GetInstance()->ClearHandlers();
diff --git a/chrome/browser/net/websocket_experiment/websocket_experiment_runner.cc b/chrome/browser/net/websocket_experiment/websocket_experiment_runner.cc
index fa4ede8..a939939a 100644
--- a/chrome/browser/net/websocket_experiment/websocket_experiment_runner.cc
+++ b/chrome/browser/net/websocket_experiment/websocket_experiment_runner.cc
@@ -70,8 +70,8 @@ WebSocketExperimentRunner::~WebSocketExperimentRunner() {
void WebSocketExperimentRunner::Run() {
DCHECK_EQ(next_state_, STATE_NONE);
next_state_ = STATE_RUN_WS;
- ChromeThread::PostDelayedTask(
- ChromeThread::IO,
+ BrowserThread::PostDelayedTask(
+ BrowserThread::IO,
FROM_HERE,
NewRunnableMethod(this, &WebSocketExperimentRunner::DoLoop),
config_.initial_delay_ms);
@@ -79,8 +79,8 @@ void WebSocketExperimentRunner::Run() {
void WebSocketExperimentRunner::Cancel() {
next_state_ = STATE_NONE;
- ChromeThread::PostTask(
- ChromeThread::IO,
+ BrowserThread::PostTask(
+ BrowserThread::IO,
FROM_HERE,
NewRunnableMethod(this, &WebSocketExperimentRunner::DoLoop));
}
@@ -186,8 +186,8 @@ void WebSocketExperimentRunner::DoLoop() {
case STATE_IDLE:
task_.reset();
next_state_ = STATE_RUN_WS;
- ChromeThread::PostDelayedTask(
- ChromeThread::IO,
+ BrowserThread::PostDelayedTask(
+ BrowserThread::IO,
FROM_HERE,
NewRunnableMethod(this, &WebSocketExperimentRunner::DoLoop),
config_.next_delay_ms);
diff --git a/chrome/browser/net/websocket_experiment/websocket_experiment_task.cc b/chrome/browser/net/websocket_experiment/websocket_experiment_task.cc
index 6cbc6cd..99c71a3 100644
--- a/chrome/browser/net/websocket_experiment/websocket_experiment_task.cc
+++ b/chrome/browser/net/websocket_experiment/websocket_experiment_task.cc
@@ -623,8 +623,8 @@ int WebSocketExperimentTask::DoWebSocketCloseComplete(int result) {
}
void WebSocketExperimentTask::SetTimeout(int64 deadline_ms) {
- bool r = ChromeThread::PostDelayedTask(
- ChromeThread::IO,
+ bool r = BrowserThread::PostDelayedTask(
+ BrowserThread::IO,
FROM_HERE,
method_factory_.NewRunnableMethod(&WebSocketExperimentTask::OnTimedOut),
deadline_ms);
diff --git a/chrome/browser/password_manager/native_backend_gnome_x.cc b/chrome/browser/password_manager/native_backend_gnome_x.cc
index 86da685..d39140c0 100644
--- a/chrome/browser/password_manager/native_backend_gnome_x.cc
+++ b/chrome/browser/password_manager/native_backend_gnome_x.cc
@@ -304,7 +304,7 @@ class GKRMethod {
};
void GKRMethod::AddLogin(const PasswordForm& form) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
gnome_keyring_store_password(
&kGnomeSchema,
NULL, // Default keyring.
@@ -330,7 +330,7 @@ void GKRMethod::AddLogin(const PasswordForm& form) {
}
void GKRMethod::UpdateLoginSearch(const PasswordForm& form) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Search GNOME Keyring for matching passwords to update.
gnome_keyring_find_itemsv(
GNOME_KEYRING_ITEM_GENERIC_SECRET,
@@ -353,7 +353,7 @@ void GKRMethod::UpdateLoginSearch(const PasswordForm& form) {
}
void GKRMethod::RemoveLogin(const PasswordForm& form) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// We find forms using the same fields as LoginDatabase::RemoveLogin().
gnome_keyring_delete_password(
&kGnomeSchema,
@@ -371,7 +371,7 @@ void GKRMethod::RemoveLogin(const PasswordForm& form) {
}
void GKRMethod::GetLogins(const PasswordForm& form) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Search GNOME Keyring for matching passwords.
gnome_keyring_find_itemsv(
GNOME_KEYRING_ITEM_GENERIC_SECRET,
@@ -387,7 +387,7 @@ void GKRMethod::GetLogins(const PasswordForm& form) {
#if !defined(GNOME_KEYRING_WORK_AROUND_MEMORY_CORRUPTION)
void GKRMethod::GetLoginsList(uint32_t blacklisted_by_user) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Search GNOME Keyring for matching passwords.
gnome_keyring_find_itemsv(
GNOME_KEYRING_ITEM_GENERIC_SECRET,
@@ -402,7 +402,7 @@ void GKRMethod::GetLoginsList(uint32_t blacklisted_by_user) {
}
void GKRMethod::GetAllLogins() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// We need to search for something, otherwise we get no results - so
// we search for the fixed application string.
gnome_keyring_find_itemsv(
@@ -416,29 +416,29 @@ void GKRMethod::GetAllLogins() {
}
#else
void GKRMethod::GetItemIds() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
gnome_keyring_list_item_ids(NULL, OnOperationGetIds, this, NULL);
}
void GKRMethod::GetItemAttrs(guint id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
gnome_keyring_item_get_attributes(NULL, id, OnOperationGetAttrs, this, NULL);
}
void GKRMethod::GetItemInfo(guint id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
gnome_keyring_item_get_info(NULL, id, OnOperationGetInfo, this, NULL);
}
#endif
GnomeKeyringResult GKRMethod::WaitResult() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
event_.Wait();
return result_;
}
GnomeKeyringResult GKRMethod::WaitResult(PasswordFormList* forms) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
event_.Wait();
forms->swap(forms_);
return result_;
@@ -446,21 +446,21 @@ GnomeKeyringResult GKRMethod::WaitResult(PasswordFormList* forms) {
#if defined(GNOME_KEYRING_WORK_AROUND_MEMORY_CORRUPTION)
GnomeKeyringResult GKRMethod::WaitResult(std::vector<guint>* item_ids) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
event_.Wait();
item_ids->swap(item_ids_);
return result_;
}
GnomeKeyringResult GKRMethod::WaitResult(PasswordForm** form) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
event_.Wait();
*form = form_.release();
return result_;
}
GnomeKeyringResult GKRMethod::WaitResult(string16* password) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
event_.Wait();
*password = password_;
return result_;
@@ -551,12 +551,12 @@ bool NativeBackendGnome::Init() {
}
bool NativeBackendGnome::AddLogin(const PasswordForm& form) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
GKRMethod method;
- ChromeThread::PostTask(ChromeThread::UI, FROM_HERE,
- NewRunnableMethod(&method,
- &GKRMethod::AddLogin,
- form));
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ NewRunnableMethod(&method,
+ &GKRMethod::AddLogin,
+ form));
GnomeKeyringResult result = method.WaitResult();
if (result != GNOME_KEYRING_RESULT_OK) {
LOG(ERROR) << "Keyring save failed: "
@@ -573,9 +573,9 @@ bool NativeBackendGnome::UpdateLogin(const PasswordForm& form) {
// differ in any of the action, password_value, ssl_valid, or preferred
// fields, then we add a new login with those fields updated and only delete
// the original on success.
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
GKRMethod method;
- ChromeThread::PostTask(ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
NewRunnableMethod(&method,
&GKRMethod::UpdateLoginSearch,
form));
@@ -608,12 +608,12 @@ bool NativeBackendGnome::UpdateLogin(const PasswordForm& form) {
}
bool NativeBackendGnome::RemoveLogin(const PasswordForm& form) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
GKRMethod method;
- ChromeThread::PostTask(ChromeThread::UI, FROM_HERE,
- NewRunnableMethod(&method,
- &GKRMethod::RemoveLogin,
- form));
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ NewRunnableMethod(&method,
+ &GKRMethod::RemoveLogin,
+ form));
GnomeKeyringResult result = method.WaitResult();
if (result != GNOME_KEYRING_RESULT_OK) {
LOG(ERROR) << "Keyring delete failed: "
@@ -626,7 +626,7 @@ bool NativeBackendGnome::RemoveLogin(const PasswordForm& form) {
bool NativeBackendGnome::RemoveLoginsCreatedBetween(
const base::Time& delete_begin,
const base::Time& delete_end) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
bool ok = true;
// We could walk the list and delete items as we find them, but it is much
// easier to build the list and use RemoveLogin() to delete them.
@@ -647,12 +647,12 @@ bool NativeBackendGnome::RemoveLoginsCreatedBetween(
bool NativeBackendGnome::GetLogins(const PasswordForm& form,
PasswordFormList* forms) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
GKRMethod method;
- ChromeThread::PostTask(ChromeThread::UI, FROM_HERE,
- NewRunnableMethod(&method,
- &GKRMethod::GetLogins,
- form));
+ BrowserThread::PostTask(
+ BrowserThread::UI,
+ FROM_HERE,
+ NewRunnableMethod(&method, &GKRMethod::GetLogins, form));
GnomeKeyringResult result = method.WaitResult(forms);
if (result == GNOME_KEYRING_RESULT_NO_MATCH)
return true;
@@ -667,7 +667,7 @@ bool NativeBackendGnome::GetLogins(const PasswordForm& form,
bool NativeBackendGnome::GetLoginsCreatedBetween(const base::Time& get_begin,
const base::Time& get_end,
PasswordFormList* forms) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
// We could walk the list and add items as we find them, but it is much
// easier to build the list and then filter the results.
PasswordFormList all_forms;
@@ -697,16 +697,16 @@ bool NativeBackendGnome::GetBlacklistLogins(PasswordFormList* forms) {
bool NativeBackendGnome::GetLoginsList(PasswordFormList* forms,
bool autofillable) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
uint32_t blacklisted_by_user = !autofillable;
#if !defined(GNOME_KEYRING_WORK_AROUND_MEMORY_CORRUPTION)
GKRMethod method;
- ChromeThread::PostTask(ChromeThread::UI, FROM_HERE,
- NewRunnableMethod(&method,
- &GKRMethod::GetLoginsList,
- blacklisted_by_user));
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ NewRunnableMethod(&method,
+ &GKRMethod::GetLoginsList,
+ blacklisted_by_user));
GnomeKeyringResult result = method.WaitResult(forms);
if (result == GNOME_KEYRING_RESULT_NO_MATCH)
return true;
@@ -734,9 +734,9 @@ bool NativeBackendGnome::GetLoginsList(PasswordFormList* forms,
bool NativeBackendGnome::GetAllLogins(PasswordFormList* forms) {
GKRMethod method;
#if !defined(GNOME_KEYRING_WORK_AROUND_MEMORY_CORRUPTION)
- ChromeThread::PostTask(ChromeThread::UI, FROM_HERE,
- NewRunnableMethod(&method,
- &GKRMethod::GetAllLogins));
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ NewRunnableMethod(&method,
+ &GKRMethod::GetAllLogins));
GnomeKeyringResult result = method.WaitResult(forms);
if (result == GNOME_KEYRING_RESULT_NO_MATCH)
return true;
@@ -747,9 +747,9 @@ bool NativeBackendGnome::GetAllLogins(PasswordFormList* forms) {
}
return true;
#else
- ChromeThread::PostTask(ChromeThread::UI, FROM_HERE,
- NewRunnableMethod(&method,
- &GKRMethod::GetItemIds));
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ NewRunnableMethod(&method,
+ &GKRMethod::GetItemIds));
std::vector<guint> item_ids;
GnomeKeyringResult result = method.WaitResult(&item_ids);
if (result != GNOME_KEYRING_RESULT_OK) {
@@ -761,10 +761,10 @@ bool NativeBackendGnome::GetAllLogins(PasswordFormList* forms) {
// We can parallelize getting the item attributes.
GKRMethod* methods = new GKRMethod[item_ids.size()];
for (size_t i = 0; i < item_ids.size(); ++i) {
- ChromeThread::PostTask(ChromeThread::UI, FROM_HERE,
- NewRunnableMethod(&methods[i],
- &GKRMethod::GetItemAttrs,
- item_ids[i]));
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ NewRunnableMethod(&methods[i],
+ &GKRMethod::GetItemAttrs,
+ item_ids[i]));
}
bool success = true;
@@ -783,10 +783,10 @@ bool NativeBackendGnome::GetAllLogins(PasswordFormList* forms) {
success = false;
}
if (all_forms[i]) {
- ChromeThread::PostTask(ChromeThread::UI, FROM_HERE,
- NewRunnableMethod(&methods[i],
- &GKRMethod::GetItemInfo,
- item_ids[i]));
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ NewRunnableMethod(&methods[i],
+ &GKRMethod::GetItemInfo,
+ item_ids[i]));
}
}
diff --git a/chrome/browser/password_manager/native_backend_kwallet_x.cc b/chrome/browser/password_manager/native_backend_kwallet_x.cc
index 5f07bb8..9337e93 100644
--- a/chrome/browser/password_manager/native_backend_kwallet_x.cc
+++ b/chrome/browser/password_manager/native_backend_kwallet_x.cc
@@ -549,7 +549,7 @@ bool NativeBackendKWallet::CheckError() {
}
int NativeBackendKWallet::WalletHandle() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
// Open the wallet.
int handle = kInvalidKWalletHandle;
dbus_g_proxy_call(proxy_, "open", &error_,
diff --git a/chrome/browser/password_manager/password_manager_unittest.cc b/chrome/browser/password_manager/password_manager_unittest.cc
index d408a64..2be490f 100644
--- a/chrome/browser/password_manager/password_manager_unittest.cc
+++ b/chrome/browser/password_manager/password_manager_unittest.cc
@@ -73,7 +73,7 @@ ACTION_P(SaveToScopedPtr, scoped) {
class PasswordManagerTest : public testing::Test {
public:
PasswordManagerTest()
- : ui_thread_(ChromeThread::UI, &message_loop_) {}
+ : ui_thread_(BrowserThread::UI, &message_loop_) {}
protected:
virtual void SetUp() {
@@ -108,7 +108,7 @@ class PasswordManagerTest : public testing::Test {
// We create a UI thread to satisfy PasswordStore.
MessageLoopForUI message_loop_;
- ChromeThread ui_thread_;
+ BrowserThread ui_thread_;
scoped_ptr<Profile> profile_;
scoped_refptr<MockPasswordStore> store_;
diff --git a/chrome/browser/password_manager/password_store.cc b/chrome/browser/password_manager/password_store.cc
index a02d666..3630d6b 100644
--- a/chrome/browser/password_manager/password_store.cc
+++ b/chrome/browser/password_manager/password_store.cc
@@ -21,7 +21,7 @@ bool PasswordStore::Init() {
}
void PasswordStore::ScheduleTask(Task* task) {
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, task);
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, task);
}
void PasswordStore::ReportMetrics() {
@@ -79,7 +79,7 @@ void PasswordStore::NotifyConsumer(GetLoginsRequest* request,
scoped_ptr<GetLoginsRequest> request_ptr(request);
#if !defined(OS_MACOSX)
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
#endif
request->message_loop->PostTask(FROM_HERE,
NewRunnableMethod(this,
@@ -90,7 +90,7 @@ void PasswordStore::NotifyConsumer(GetLoginsRequest* request,
void PasswordStore::NotifyConsumerImpl(PasswordStoreConsumer* consumer,
int handle,
const vector<PasswordForm*> forms) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Don't notify the consumer if the request was canceled.
if (pending_requests_.find(handle) == pending_requests_.end()) {
// |forms| is const so we iterate rather than use STLDeleteElements().
@@ -104,14 +104,14 @@ void PasswordStore::NotifyConsumerImpl(PasswordStoreConsumer* consumer,
}
int PasswordStore::GetNewRequestHandle() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
int handle = handle_++;
pending_requests_.insert(handle);
return handle;
}
void PasswordStore::CancelLoginsQuery(int handle) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
pending_requests_.erase(handle);
}
diff --git a/chrome/browser/password_manager/password_store_default.cc b/chrome/browser/password_manager/password_store_default.cc
index 012cfa1..3aa1323 100644
--- a/chrome/browser/password_manager/password_store_default.cc
+++ b/chrome/browser/password_manager/password_store_default.cc
@@ -34,7 +34,7 @@ PasswordStoreDefault::~PasswordStoreDefault() {
}
void PasswordStoreDefault::ReportMetricsImpl() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
login_db_->ReportMetrics();
}
@@ -114,13 +114,13 @@ void PasswordStoreDefault::GetBlacklistLoginsImpl(
bool PasswordStoreDefault::FillAutofillableLogins(
std::vector<PasswordForm*>* forms) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
return login_db_->GetAutofillableLogins(forms);
}
bool PasswordStoreDefault::FillBlacklistLogins(
std::vector<PasswordForm*>* forms) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
return login_db_->GetBlacklistLogins(forms);
}
diff --git a/chrome/browser/password_manager/password_store_default_unittest.cc b/chrome/browser/password_manager/password_store_default_unittest.cc
index a416d37..31200d5 100644
--- a/chrome/browser/password_manager/password_store_default_unittest.cc
+++ b/chrome/browser/password_manager/password_store_default_unittest.cc
@@ -55,21 +55,21 @@ class MockNotificationObserver : public NotificationObserver {
// the DB thread.
class DBThreadObserverHelper :
public base::RefCountedThreadSafe<DBThreadObserverHelper,
- ChromeThread::DeleteOnDBThread> {
+ BrowserThread::DeleteOnDBThread> {
public:
DBThreadObserverHelper() : done_event_(true, false) {}
void Init() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
- ChromeThread::PostTask(
- ChromeThread::DB,
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ BrowserThread::PostTask(
+ BrowserThread::DB,
FROM_HERE,
NewRunnableMethod(this, &DBThreadObserverHelper::AddObserverTask));
done_event_.Wait();
}
virtual ~DBThreadObserverHelper() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
registrar_.RemoveAll();
}
@@ -81,7 +81,7 @@ class DBThreadObserverHelper :
friend class base::RefCountedThreadSafe<DBThreadObserverHelper>;
void AddObserverTask() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
registrar_.Add(&observer_,
NotificationType::LOGINS_CHANGED,
NotificationService::AllSources());
@@ -100,8 +100,8 @@ typedef std::vector<PasswordForm*> VectorOfForms;
class PasswordStoreDefaultTest : public testing::Test {
protected:
PasswordStoreDefaultTest()
- : ui_thread_(ChromeThread::UI, &message_loop_),
- db_thread_(ChromeThread::DB) {
+ : ui_thread_(BrowserThread::UI, &message_loop_),
+ db_thread_(BrowserThread::DB) {
}
virtual void SetUp() {
@@ -126,8 +126,8 @@ class PasswordStoreDefaultTest : public testing::Test {
}
MessageLoopForUI message_loop_;
- ChromeThread ui_thread_;
- ChromeThread db_thread_; // PasswordStore, WDS schedule work on this thread.
+ BrowserThread ui_thread_;
+ BrowserThread db_thread_; // PasswordStore, WDS schedule work on this thread.
scoped_ptr<LoginDatabase> login_db_;
scoped_ptr<TestingProfile> profile_;
@@ -140,7 +140,7 @@ ACTION(STLDeleteElements0) {
}
ACTION(QuitUIMessageLoop) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
MessageLoop::current()->Quit();
}
@@ -185,7 +185,8 @@ TEST_F(PasswordStoreDefaultTest, NonASCIIData) {
// The PasswordStore schedules tasks to run on the DB thread so we schedule
// yet another task to notify us that it's safe to carry on with the test.
WaitableEvent done(false, false);
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
MockPasswordStoreConsumer consumer;
@@ -279,7 +280,8 @@ TEST_F(PasswordStoreDefaultTest, Migration) {
// The WDS schedules tasks to run on the DB thread so we schedule yet another
// task to notify us that it's safe to carry on with the test.
WaitableEvent done(false, false);
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
// Initializing the PasswordStore should trigger a migration.
@@ -294,7 +296,8 @@ TEST_F(PasswordStoreDefaultTest, Migration) {
// Again, the WDS schedules tasks to run on the DB thread, so schedule a task
// to signal us when it is safe to continue.
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
// Let the WDS callbacks proceed so the logins can be migrated.
@@ -338,7 +341,8 @@ TEST_F(PasswordStoreDefaultTest, Migration) {
wds_->GetAutofillableLogins(&wds_consumer);
// Wait for the WDS methods to execute on the DB thread.
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
// Handle the callback from the WDS.
@@ -351,7 +355,8 @@ TEST_F(PasswordStoreDefaultTest, Migration) {
wds_->GetBlacklistLogins(&wds_consumer);
// Wait for the WDS methods to execute on the DB thread.
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
// Handle the callback from the WDS.
@@ -386,7 +391,8 @@ TEST_F(PasswordStoreDefaultTest, MigrationAlreadyDone) {
// The WDS schedules tasks to run on the DB thread so we schedule yet another
// task to notify us that it's safe to carry on with the test.
WaitableEvent done(false, false);
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
// Prentend that the migration has already taken place.
@@ -461,7 +467,8 @@ TEST_F(PasswordStoreDefaultTest, Notifications) {
// The PasswordStore schedules tasks to run on the DB thread so we schedule
// yet another task to notify us that it's safe to carry on with the test.
WaitableEvent done(false, false);
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
// Change the password.
@@ -482,7 +489,8 @@ TEST_F(PasswordStoreDefaultTest, Notifications) {
store->UpdateLogin(*form);
// Wait for PasswordStore to send the notification.
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
const PasswordStoreChange expected_delete_changes[] = {
@@ -500,6 +508,7 @@ TEST_F(PasswordStoreDefaultTest, Notifications) {
store->RemoveLogin(*form);
// Wait for PasswordStore to send the notification.
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
}
diff --git a/chrome/browser/password_manager/password_store_mac_unittest.cc b/chrome/browser/password_manager/password_store_mac_unittest.cc
index 3db112d..877309d 100644
--- a/chrome/browser/password_manager/password_store_mac_unittest.cc
+++ b/chrome/browser/password_manager/password_store_mac_unittest.cc
@@ -36,7 +36,7 @@ ACTION(STLDeleteElements0) {
}
ACTION(QuitUIMessageLoop) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
MessageLoop::current()->Quit();
}
@@ -896,7 +896,7 @@ TEST_F(PasswordStoreMacInternalsTest, TestPasswordGetAll) {
class PasswordStoreMacTest : public testing::Test {
public:
- PasswordStoreMacTest() : ui_thread_(ChromeThread::UI, &message_loop_) {}
+ PasswordStoreMacTest() : ui_thread_(BrowserThread::UI, &message_loop_) {}
virtual void SetUp() {
login_db_ = new LoginDatabase();
@@ -917,7 +917,7 @@ class PasswordStoreMacTest : public testing::Test {
protected:
MessageLoopForUI message_loop_;
- ChromeThread ui_thread_;
+ BrowserThread ui_thread_;
MockKeychain* keychain_; // Owned by store_.
LoginDatabase* login_db_; // Owned by store_.
diff --git a/chrome/browser/password_manager/password_store_win_unittest.cc b/chrome/browser/password_manager/password_store_win_unittest.cc
index aae342d..5133bc1 100644
--- a/chrome/browser/password_manager/password_store_win_unittest.cc
+++ b/chrome/browser/password_manager/password_store_win_unittest.cc
@@ -51,8 +51,8 @@ typedef std::vector<PasswordForm*> VectorOfForms;
class PasswordStoreWinTest : public testing::Test {
protected:
PasswordStoreWinTest()
- : ui_thread_(ChromeThread::UI, &message_loop_),
- db_thread_(ChromeThread::DB) {
+ : ui_thread_(BrowserThread::UI, &message_loop_),
+ db_thread_(BrowserThread::DB) {
}
bool CreateIE7PasswordInfo(const std::wstring& url, const base::Time& created,
@@ -121,8 +121,8 @@ class PasswordStoreWinTest : public testing::Test {
}
MessageLoopForUI message_loop_;
- ChromeThread ui_thread_;
- ChromeThread db_thread_; // PasswordStore, WDS schedule work on this thread.
+ BrowserThread ui_thread_;
+ BrowserThread db_thread_; // PasswordStore, WDS schedule work on this thread.
scoped_ptr<LoginDatabase> login_db_;
scoped_ptr<TestingProfile> profile_;
@@ -135,7 +135,7 @@ ACTION(STLDeleteElements0) {
}
ACTION(QuitUIMessageLoop) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
MessageLoop::current()->Quit();
}
@@ -159,7 +159,8 @@ TEST_F(PasswordStoreWinTest, ConvertIE7Login) {
// The WDS schedules tasks to run on the DB thread so we schedule yet another
// task to notify us that it's safe to carry on with the test.
WaitableEvent done(false, false);
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
// Prentend that the migration has already taken place.
@@ -264,7 +265,8 @@ TEST_F(PasswordStoreWinTest, DISABLED_MultipleWDSQueriesOnDifferentThreads) {
// The WDS schedules tasks to run on the DB thread so we schedule yet another
// task to notify us that it's safe to carry on with the test.
WaitableEvent done(false, false);
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
// Prentend that the migration has already taken place.
@@ -416,7 +418,8 @@ TEST_F(PasswordStoreWinTest, Migration) {
// The WDS schedules tasks to run on the DB thread so we schedule yet another
// task to notify us that it's safe to carry on with the test.
WaitableEvent done(false, false);
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
// Initializing the PasswordStore should trigger a migration.
@@ -430,7 +433,8 @@ TEST_F(PasswordStoreWinTest, Migration) {
// Again, the WDS schedules tasks to run on the DB thread, so schedule a task
// to signal us when it is safe to continue.
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
// Let the WDS callbacks proceed so the logins can be migrated.
@@ -474,7 +478,8 @@ TEST_F(PasswordStoreWinTest, Migration) {
wds_->GetAutofillableLogins(&wds_consumer);
// Wait for the WDS methods to execute on the DB thread.
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
// Handle the callback from the WDS.
@@ -487,7 +492,8 @@ TEST_F(PasswordStoreWinTest, Migration) {
wds_->GetBlacklistLogins(&wds_consumer);
// Wait for the WDS methods to execute on the DB thread.
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
// Handle the callback from the WDS.
diff --git a/chrome/browser/password_manager/password_store_x.cc b/chrome/browser/password_manager/password_store_x.cc
index 85d1170..9132da5 100644
--- a/chrome/browser/password_manager/password_store_x.cc
+++ b/chrome/browser/password_manager/password_store_x.cc
@@ -164,7 +164,7 @@ bool PasswordStoreX::FillBlacklistLogins(vector<PasswordForm*>* forms) {
}
void PasswordStoreX::CheckMigration() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
if (migration_checked_ || !backend_.get())
return;
migration_checked_ = true;
diff --git a/chrome/browser/password_manager/password_store_x_unittest.cc b/chrome/browser/password_manager/password_store_x_unittest.cc
index 1bb1ab3..55d6391 100644
--- a/chrome/browser/password_manager/password_store_x_unittest.cc
+++ b/chrome/browser/password_manager/password_store_x_unittest.cc
@@ -55,21 +55,21 @@ class MockNotificationObserver : public NotificationObserver {
// the DB thread.
class DBThreadObserverHelper
: public base::RefCountedThreadSafe<DBThreadObserverHelper,
- ChromeThread::DeleteOnDBThread> {
+ BrowserThread::DeleteOnDBThread> {
public:
DBThreadObserverHelper() : done_event_(true, false) {}
void Init() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
- ChromeThread::PostTask(
- ChromeThread::DB,
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ BrowserThread::PostTask(
+ BrowserThread::DB,
FROM_HERE,
NewRunnableMethod(this, &DBThreadObserverHelper::AddObserverTask));
done_event_.Wait();
}
virtual ~DBThreadObserverHelper() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
registrar_.RemoveAll();
}
@@ -81,7 +81,7 @@ class DBThreadObserverHelper
friend class base::RefCountedThreadSafe<DBThreadObserverHelper>;
void AddObserverTask() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
registrar_.Add(&observer_,
NotificationType::LOGINS_CHANGED,
NotificationService::AllSources());
@@ -276,8 +276,8 @@ enum BackendType {
class PasswordStoreXTest : public testing::TestWithParam<BackendType> {
protected:
PasswordStoreXTest()
- : ui_thread_(ChromeThread::UI, &message_loop_),
- db_thread_(ChromeThread::DB) {
+ : ui_thread_(BrowserThread::UI, &message_loop_),
+ db_thread_(BrowserThread::DB) {
}
virtual void SetUp() {
@@ -312,8 +312,8 @@ class PasswordStoreXTest : public testing::TestWithParam<BackendType> {
}
MessageLoopForUI message_loop_;
- ChromeThread ui_thread_;
- ChromeThread db_thread_; // PasswordStore, WDS schedule work on this thread.
+ BrowserThread ui_thread_;
+ BrowserThread db_thread_; // PasswordStore, WDS schedule work on this thread.
scoped_ptr<LoginDatabase> login_db_;
scoped_ptr<TestingProfile> profile_;
@@ -326,7 +326,7 @@ ACTION(STLDeleteElements0) {
}
ACTION(QuitUIMessageLoop) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
MessageLoop::current()->Quit();
}
@@ -355,7 +355,8 @@ TEST_P(PasswordStoreXTest, WDSMigration) {
// The WDS schedules tasks to run on the DB thread so we schedule yet another
// task to notify us that it's safe to carry on with the test.
WaitableEvent done(false, false);
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
// Initializing the PasswordStore should trigger a migration.
@@ -372,7 +373,8 @@ TEST_P(PasswordStoreXTest, WDSMigration) {
// Again, the WDS schedules tasks to run on the DB thread, so schedule a task
// to signal us when it is safe to continue.
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
// Let the WDS callbacks proceed so the logins can be migrated.
@@ -416,7 +418,8 @@ TEST_P(PasswordStoreXTest, WDSMigration) {
wds_->GetAutofillableLogins(&wds_consumer);
// Wait for the WDS methods to execute on the DB thread.
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
// Handle the callback from the WDS.
@@ -429,7 +432,8 @@ TEST_P(PasswordStoreXTest, WDSMigration) {
wds_->GetBlacklistLogins(&wds_consumer);
// Wait for the WDS methods to execute on the DB thread.
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
// Handle the callback from the WDS.
@@ -468,7 +472,8 @@ TEST_P(PasswordStoreXTest, WDSMigrationAlreadyDone) {
// The WDS schedules tasks to run on the DB thread so we schedule yet another
// task to notify us that it's safe to carry on with the test.
WaitableEvent done(false, false);
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
// Prentend that the migration has already taken place.
@@ -547,7 +552,8 @@ TEST_P(PasswordStoreXTest, Notifications) {
// The PasswordStore schedules tasks to run on the DB thread so we schedule
// yet another task to notify us that it's safe to carry on with the test.
WaitableEvent done(false, false);
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
// Change the password.
@@ -568,7 +574,8 @@ TEST_P(PasswordStoreXTest, Notifications) {
store->UpdateLogin(*form);
// Wait for PasswordStore to send the notification.
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
const PasswordStoreChange expected_delete_changes[] = {
@@ -586,7 +593,8 @@ TEST_P(PasswordStoreXTest, Notifications) {
store->RemoveLogin(*form);
// Wait for PasswordStore to send the notification.
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
}
@@ -608,7 +616,7 @@ TEST_P(PasswordStoreXTest, NativeMigration) {
// Populate the login DB with logins that should be migrated.
for (VectorOfForms::iterator it = expected_autofillable.begin();
it != expected_autofillable.end(); ++it) {
- ChromeThread::PostTask(ChromeThread::DB,
+ BrowserThread::PostTask(BrowserThread::DB,
FROM_HERE,
NewRunnableMethod(login_db,
&LoginDatabase::AddLogin,
@@ -616,7 +624,7 @@ TEST_P(PasswordStoreXTest, NativeMigration) {
}
for (VectorOfForms::iterator it = expected_blacklisted.begin();
it != expected_blacklisted.end(); ++it) {
- ChromeThread::PostTask(ChromeThread::DB,
+ BrowserThread::PostTask(BrowserThread::DB,
FROM_HERE,
NewRunnableMethod(login_db,
&LoginDatabase::AddLogin,
@@ -626,7 +634,8 @@ TEST_P(PasswordStoreXTest, NativeMigration) {
// Schedule another task on the DB thread to notify us that it's safe to
// carry on with the test.
WaitableEvent done(false, false);
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
// Get the new size of the login DB file. We expect it to be larger.
@@ -685,11 +694,12 @@ TEST_P(PasswordStoreXTest, NativeMigration) {
.WillOnce(WithArg<0>(STLDeleteElements0()));
}
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE,
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
new LoginDatabaseQueryTask(login_db, true, &ld_return));
// Wait for the login DB methods to execute on the DB thread.
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
if (GetParam() == WORKING_BACKEND) {
@@ -704,11 +714,12 @@ TEST_P(PasswordStoreXTest, NativeMigration) {
.WillOnce(WithArg<0>(STLDeleteElements0()));
}
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE,
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
new LoginDatabaseQueryTask(login_db, false, &ld_return));
// Wait for the login DB methods to execute on the DB thread.
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, new SignalingTask(&done));
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
+ new SignalingTask(&done));
done.Wait();
if (GetParam() == WORKING_BACKEND) {
diff --git a/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc b/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc
index 20d0a73..9b46a95 100644
--- a/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc
+++ b/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc
@@ -139,7 +139,7 @@ void CloudPrintProxyService::OnDialogClosed() {
}
void CloudPrintProxyService::RefreshCloudPrintProxyStatus() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
ServiceProcessControl* process_control =
ServiceProcessControlManager::instance()->GetProcessControl(profile_);
DCHECK(process_control && process_control->is_connected());
diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
index e361062..38e89b6 100644
--- a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
+++ b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
@@ -93,8 +93,8 @@ CloudPrintSetupFlow::CloudPrintSetupFlow(const std::string& args,
delegate_(delegate) {
// TODO(hclam): The data source should be added once.
profile_ = profile;
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(Singleton<ChromeURLDataManager>::get(),
&ChromeURLDataManager::AddDataSource,
make_scoped_refptr(new RemotingResourcesSource())));
diff --git a/chrome/browser/printing/print_dialog_cloud.cc b/chrome/browser/printing/print_dialog_cloud.cc
index 6209038..9998de1 100644
--- a/chrome/browser/printing/print_dialog_cloud.cc
+++ b/chrome/browser/printing/print_dialog_cloud.cc
@@ -158,7 +158,7 @@ void CloudPrintDataSender::CancelPrintDataFile() {
// Once that is done, kick off the next part of the task on the IO
// thread.
void CloudPrintDataSender::ReadPrintDataFile(const FilePath& path_to_pdf) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
int64 file_size = 0;
if (file_util::GetFileSize(path_to_pdf, &file_size) && file_size != 0) {
std::string file_data;
@@ -174,10 +174,10 @@ void CloudPrintDataSender::ReadPrintDataFile(const FilePath& path_to_pdf) {
base64_data.insert(0, header);
scoped_ptr<StringValue> new_data(new StringValue(base64_data));
print_data_.swap(new_data);
- ChromeThread::PostTask(ChromeThread::IO, FROM_HERE,
- NewRunnableMethod(
- this,
- &CloudPrintDataSender::SendPrintDataFile));
+ BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
+ NewRunnableMethod(
+ this,
+ &CloudPrintDataSender::SendPrintDataFile));
}
}
}
@@ -191,7 +191,7 @@ void CloudPrintDataSender::ReadPrintDataFile(const FilePath& path_to_pdf) {
// JavaScript to that location, and make sure it gets deleted when not
// needed. - 4/1/2010
void CloudPrintDataSender::SendPrintDataFile() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
AutoLock lock(lock_);
if (helper_ && print_data_.get()) {
StringValue title(print_job_title_);
@@ -209,7 +209,7 @@ void CloudPrintFlowHandler::SetDialogDelegate(
CloudPrintHtmlDialogDelegate* delegate) {
// Even if setting a new dom_ui, it means any previous task needs
// to be cancelled, it's now invalid.
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
CancelAnyRunningTask();
dialog_delegate_ = delegate;
}
@@ -218,7 +218,7 @@ void CloudPrintFlowHandler::SetDialogDelegate(
// reference to it, so when the task that is calling it finishes and
// removes it's reference, it goes away.
void CloudPrintFlowHandler::CancelAnyRunningTask() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (print_data_sender_.get()) {
print_data_sender_->CancelPrintDataFile();
print_data_sender_ = NULL;
@@ -302,7 +302,7 @@ CloudPrintFlowHandler::CreateCloudPrintDataSender() {
}
void CloudPrintFlowHandler::HandleSendPrintData(const ListValue* args) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// This will cancel any ReadPrintDataFile() or SendPrintDataFile()
// requests in flight (this is anticipation of when setting page
// setup parameters becomes asynchronous and may be set while some
@@ -310,11 +310,11 @@ void CloudPrintFlowHandler::HandleSendPrintData(const ListValue* args) {
CancelAnyRunningTask();
if (dom_ui_) {
print_data_sender_ = CreateCloudPrintDataSender();
- ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE,
- NewRunnableMethod(
- print_data_sender_.get(),
- &CloudPrintDataSender::ReadPrintDataFile,
- path_to_pdf_));
+ BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
+ NewRunnableMethod(
+ print_data_sender_.get(),
+ &CloudPrintDataSender::ReadPrintDataFile,
+ path_to_pdf_));
}
}
@@ -380,7 +380,7 @@ CloudPrintHtmlDialogDelegate::CloudPrintHtmlDialogDelegate(
void CloudPrintHtmlDialogDelegate::Init(
int width, int height, const std::string& json_arguments) {
// This information is needed to show the dialog HTML content.
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
std::string cloud_print_url(chrome::kCloudPrintResourcesURL);
params_.url = GURL(cloud_print_url);
params_.height = height;
@@ -393,7 +393,7 @@ void CloudPrintHtmlDialogDelegate::Init(
CloudPrintHtmlDialogDelegate::~CloudPrintHtmlDialogDelegate() {
// If the flow_handler_ is about to outlive us because we don't own
// it anymore, we need to have it remove it's reference to us.
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
flow_handler_->SetDialogDelegate(NULL);
if (owns_flow_handler_) {
delete flow_handler_;
@@ -450,16 +450,16 @@ void CloudPrintHtmlDialogDelegate::OnCloseContents(TabContents* source,
// workflow through the printing code changes to allow for dynamically
// changing page setup parameters while the dialog is active.
void PrintDialogCloud::CreatePrintDialogForPdf(const FilePath& path_to_pdf) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableFunction(&PrintDialogCloud::CreateDialogImpl, path_to_pdf));
}
// static, called from the UI thread.
void PrintDialogCloud::CreateDialogImpl(const FilePath& path_to_pdf) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
new PrintDialogCloud(path_to_pdf);
}
diff --git a/chrome/browser/printing/print_dialog_cloud_uitest.cc b/chrome/browser/printing/print_dialog_cloud_uitest.cc
index 4b6dcb0..a3a2fcd 100644
--- a/chrome/browser/printing/print_dialog_cloud_uitest.cc
+++ b/chrome/browser/printing/print_dialog_cloud_uitest.cc
@@ -130,8 +130,8 @@ class PrintDialogCloudTest : public InProcessBrowserTest {
AutoQuitDelegate() {}
virtual void OnResponseCompleted(URLRequest* request) {
- ChromeThread::PostTask(ChromeThread::UI, FROM_HERE,
- new MessageLoop::QuitTask());
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ new MessageLoop::QuitTask());
}
};
@@ -179,8 +179,8 @@ class PrintDialogCloudTest : public InProcessBrowserTest {
void CreateDialogForTest() {
FilePath path_to_pdf =
test_data_directory_.AppendASCII("printing/cloud_print_uitest.pdf");
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableFunction(&PrintDialogCloud::CreateDialogImpl, path_to_pdf));
}
diff --git a/chrome/browser/printing/print_dialog_cloud_unittest.cc b/chrome/browser/printing/print_dialog_cloud_unittest.cc
index 092d456..8f13860 100644
--- a/chrome/browser/printing/print_dialog_cloud_unittest.cc
+++ b/chrome/browser/printing/print_dialog_cloud_unittest.cc
@@ -192,8 +192,8 @@ TEST_F(CloudPrintURLTest, CheckDefaultURLs) {
class CloudPrintDataSenderTest : public testing::Test {
public:
CloudPrintDataSenderTest()
- : file_thread_(ChromeThread::FILE, &message_loop_),
- io_thread_(ChromeThread::IO, &message_loop_) {}
+ : file_thread_(BrowserThread::FILE, &message_loop_),
+ io_thread_(BrowserThread::IO, &message_loop_) {}
protected:
virtual void SetUp() {
@@ -207,8 +207,8 @@ class CloudPrintDataSenderTest : public testing::Test {
scoped_ptr<MockCloudPrintDataSenderHelper> mock_helper_;
MessageLoop message_loop_;
- ChromeThread file_thread_;
- ChromeThread io_thread_;
+ BrowserThread file_thread_;
+ BrowserThread io_thread_;
};
// TODO(scottbyer): DISABLED until the binary test file can get
@@ -220,11 +220,11 @@ TEST_F(CloudPrintDataSenderTest, CanSend) {
WillOnce(Return());
FilePath test_data_file_name = GetTestDataFileName();
- ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE,
- NewRunnableMethod(
- print_data_sender_.get(),
- &CloudPrintDataSender::ReadPrintDataFile,
- test_data_file_name));
+ BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
+ NewRunnableMethod(
+ print_data_sender_.get(),
+ &CloudPrintDataSender::ReadPrintDataFile,
+ test_data_file_name));
MessageLoop::current()->RunAllPending();
}
@@ -236,10 +236,10 @@ TEST_F(CloudPrintDataSenderTest, BadFile) {
#else
FilePath bad_data_file_name("/some/file/that/isnot/there");
#endif
- ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE,
- NewRunnableMethod(
- print_data_sender_.get(),
- &CloudPrintDataSender::ReadPrintDataFile,
+ BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
+ NewRunnableMethod(
+ print_data_sender_.get(),
+ &CloudPrintDataSender::ReadPrintDataFile,
bad_data_file_name));
MessageLoop::current()->RunAllPending();
}
@@ -248,11 +248,11 @@ TEST_F(CloudPrintDataSenderTest, EmptyFile) {
EXPECT_CALL(*mock_helper_, CallJavascriptFunction(_, _, _)).Times(0);
FilePath empty_data_file_name = GetEmptyDataFileName();
- ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE,
- NewRunnableMethod(
- print_data_sender_.get(),
- &CloudPrintDataSender::ReadPrintDataFile,
- empty_data_file_name));
+ BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
+ NewRunnableMethod(
+ print_data_sender_.get(),
+ &CloudPrintDataSender::ReadPrintDataFile,
+ empty_data_file_name));
MessageLoop::current()->RunAllPending();
}
@@ -269,7 +269,7 @@ using internal_cloud_print_helpers::CloudPrintHtmlDialogDelegate;
class CloudPrintHtmlDialogDelegateTest : public testing::Test {
public:
CloudPrintHtmlDialogDelegateTest()
- : ui_thread_(ChromeThread::UI, &message_loop_) {}
+ : ui_thread_(BrowserThread::UI, &message_loop_) {}
protected:
virtual void SetUp() {
@@ -291,7 +291,7 @@ class CloudPrintHtmlDialogDelegateTest : public testing::Test {
}
MessageLoopForUI message_loop_;
- ChromeThread ui_thread_;
+ BrowserThread ui_thread_;
base::WeakPtr<MockCloudPrintFlowHandler> mock_flow_handler_;
scoped_ptr<CloudPrintHtmlDialogDelegate> delegate_;
};
diff --git a/chrome/browser/printing/print_dialog_gtk.cc b/chrome/browser/printing/print_dialog_gtk.cc
index b8c0578..2dcda0b 100644
--- a/chrome/browser/printing/print_dialog_gtk.cc
+++ b/chrome/browser/printing/print_dialog_gtk.cc
@@ -68,8 +68,8 @@ class PdfUnsupportedInfoBarDelegate : public LinkInfoBarDelegate {
// static
void PrintDialogGtk::CreatePrintDialogForPdf(const FilePath& path) {
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableFunction(&PrintDialogGtk::CreateDialogImpl, path));
}
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
index af20db2..3e0c575 100644
--- a/chrome/browser/printing/print_job_worker.cc
+++ b/chrome/browser/printing/print_job_worker.cc
@@ -81,8 +81,8 @@ void PrintJobWorker::GetSettings(bool ask_user_for_settings,
if (ask_user_for_settings) {
#if defined(OS_MACOSX) || defined(USE_X11)
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this, &PrintJobWorker::GetSettingsWithUI,
parent_view, document_page_count,
has_selection));
@@ -118,7 +118,7 @@ void PrintJobWorker::GetSettingsDone(PrintingContext::Result result) {
void PrintJobWorker::GetSettingsWithUI(gfx::NativeView parent_view,
int document_page_count,
bool has_selection) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
printing_context_->AskUserForSettings(
parent_view,