summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/webui
diff options
context:
space:
mode:
authorjyasskin@chromium.org <jyasskin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-02 06:41:18 +0000
committerjyasskin@chromium.org <jyasskin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-02 06:41:18 +0000
commita4a46be32d27e4961512f35b85f9b25ced8bee29 (patch)
tree356805526e43d60654b529ed044c17a332ff52f8 /chrome/browser/ui/webui
parent66e8fe6e3b21d65778b3d600fdda5e07b2b66727 (diff)
downloadchromium_src-a4a46be32d27e4961512f35b85f9b25ced8bee29.zip
chromium_src-a4a46be32d27e4961512f35b85f9b25ced8bee29.tar.gz
chromium_src-a4a46be32d27e4961512f35b85f9b25ced8bee29.tar.bz2
Replace DCHECK(BrowserThread::CurrentlyOn) with DCHECK_CURRENTLY_ON in chrome/browser/ui.
This is a follow-up to https://src.chromium.org/viewvc/chrome?revision=256913&view=revision that makes error messages more descriptive. It was automatically produced with git grep -l 'DCHECK(.*CurrentlyOn' chrome/browser/ui |xargs sed -i -e 's/DCHECK(BrowserThread::CurrentlyOn(\([^)]*\)))/DCHECK_CURRENTLY_ON(\1)/' -e 's/DCHECK(content::BrowserThread::CurrentlyOn(\([^)]*\)))/DCHECK_CURRENTLY_ON(\1)/' TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/220123003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261086 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/webui')
-rw-r--r--chrome/browser/ui/webui/about_ui.cc16
-rw-r--r--chrome/browser/ui/webui/app_launcher_page_ui.cc2
-rw-r--r--chrome/browser/ui/webui/app_list/start_page_ui.cc2
-rw-r--r--chrome/browser/ui/webui/chromeos/cryptohome_web_ui_handler.cc2
-rw-r--r--chrome/browser/ui/webui/chromeos/drive_internals_ui.cc66
-rw-r--r--chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc6
-rw-r--r--chrome/browser/ui/webui/chromeos/mobile_setup_dialog.cc4
-rw-r--r--chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc6
-rw-r--r--chrome/browser/ui/webui/help/version_updater_win.cc4
-rw-r--r--chrome/browser/ui/webui/memory_internals/memory_internals_handler.cc2
-rw-r--r--chrome/browser/ui/webui/memory_internals/memory_internals_proxy.cc8
-rw-r--r--chrome/browser/ui/webui/net_export_ui.cc12
-rw-r--r--chrome/browser/ui/webui/net_internals/net_internals_ui.cc34
-rw-r--r--chrome/browser/ui/webui/ntp/android/bookmarks_handler.cc8
-rw-r--r--chrome/browser/ui/webui/ntp/android/ntp_resource_cache_android.cc2
-rw-r--r--chrome/browser/ui/webui/ntp/android/promo_handler.cc4
-rw-r--r--chrome/browser/ui/webui/ntp/new_tab_ui.cc2
-rw-r--r--chrome/browser/ui/webui/ntp/ntp_resource_cache.cc4
-rw-r--r--chrome/browser/ui/webui/options/advanced_options_utils_linux.cc6
-rw-r--r--chrome/browser/ui/webui/options/browser_options_handler.cc4
-rw-r--r--chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc2
-rw-r--r--chrome/browser/ui/webui/options/manage_profile_handler.cc4
-rw-r--r--chrome/browser/ui/webui/performance_monitor/performance_monitor_handler.cc16
-rw-r--r--chrome/browser/ui/webui/print_preview/print_preview_handler.cc8
-rw-r--r--chrome/browser/ui/webui/profiler_ui.cc2
-rw-r--r--chrome/browser/ui/webui/set_as_default_browser_ui.cc8
-rw-r--r--chrome/browser/ui/webui/sync_internals_message_handler.cc2
-rw-r--r--chrome/browser/ui/webui/theme_source.cc6
-rw-r--r--chrome/browser/ui/webui/version_handler.cc4
29 files changed, 123 insertions, 123 deletions
diff --git a/chrome/browser/ui/webui/about_ui.cc b/chrome/browser/ui/webui/about_ui.cc
index 41c4b1e..d1c97fa 100644
--- a/chrome/browser/ui/webui/about_ui.cc
+++ b/chrome/browser/ui/webui/about_ui.cc
@@ -242,7 +242,7 @@ class ChromeOSTermsHandler
virtual ~ChromeOSTermsHandler() {}
void StartOnUIThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (path_ == chrome::kOemEulaURLPath) {
// Load local OEM EULA from the disk.
BrowserThread::PostTask(
@@ -258,7 +258,7 @@ class ChromeOSTermsHandler
}
void OnOnlineEULAFetched(ChromeOSOnlineTermsHandler* loader) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
loader->GetResponseResult(&contents_);
if (contents_.empty()) {
// Load local ChromeOS terms from the file.
@@ -271,7 +271,7 @@ class ChromeOSTermsHandler
}
void LoadOemEulaFileOnFileThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
const chromeos::StartupCustomizationDocument* customization =
chromeos::StartupCustomizationDocument::GetInstance();
if (customization->IsReady()) {
@@ -306,7 +306,7 @@ class ChromeOSTermsHandler
}
void ResponseOnUIThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// If we fail to load Chrome OS EULA from disk, load it from resources.
// Do nothing if OEM EULA load failed.
if (contents_.empty() && path_ != chrome::kOemEulaURLPath)
@@ -530,14 +530,14 @@ class AboutDnsHandler : public base::RefCountedThreadSafe<AboutDnsHandler> {
const content::URLDataSource::GotDataCallback& callback)
: profile_(profile),
callback_(callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
virtual ~AboutDnsHandler() {}
// Calls FinishOnUIThread() on completion.
void StartOnUIThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
chrome_browser_net::Predictor* predictor = profile_->GetNetworkPredictor();
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
@@ -545,7 +545,7 @@ class AboutDnsHandler : public base::RefCountedThreadSafe<AboutDnsHandler> {
}
void StartOnIOThread(chrome_browser_net::Predictor* predictor) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
std::string data;
AppendHeader(&data, 0, "About DNS");
@@ -559,7 +559,7 @@ class AboutDnsHandler : public base::RefCountedThreadSafe<AboutDnsHandler> {
}
void FinishOnUIThread(const std::string& data) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
std::string data_copy(data);
callback_.Run(base::RefCountedString::TakeString(&data_copy));
}
diff --git a/chrome/browser/ui/webui/app_launcher_page_ui.cc b/chrome/browser/ui/webui/app_launcher_page_ui.cc
index 1de9db3..d4e43b8 100644
--- a/chrome/browser/ui/webui/app_launcher_page_ui.cc
+++ b/chrome/browser/ui/webui/app_launcher_page_ui.cc
@@ -94,7 +94,7 @@ void AppLauncherPageUI::HTMLSource::StartDataRequest(
int render_process_id,
int render_frame_id,
const content::URLDataSource::GotDataCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
NTPResourceCache* resource = AppResourceCacheFactory::GetForProfile(profile_);
resource->set_should_show_most_visited_page(false);
diff --git a/chrome/browser/ui/webui/app_list/start_page_ui.cc b/chrome/browser/ui/webui/app_list/start_page_ui.cc
index aadae58..e265762 100644
--- a/chrome/browser/ui/webui/app_list/start_page_ui.cc
+++ b/chrome/browser/ui/webui/app_list/start_page_ui.cc
@@ -35,7 +35,7 @@ const char* kHotwordFilenames[] = {
void LoadModelData(const base::FilePath& base_dir,
const std::string& path,
const content::WebUIDataSource::GotDataCallback& callback) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
// Will be owned by |callback|.
scoped_refptr<base::RefCountedString> data(new base::RefCountedString());
base::ReadFileToString(base_dir.AppendASCII(path), &(data->data()));
diff --git a/chrome/browser/ui/webui/chromeos/cryptohome_web_ui_handler.cc b/chrome/browser/ui/webui/chromeos/cryptohome_web_ui_handler.cc
index 9587dbf..733db37 100644
--- a/chrome/browser/ui/webui/chromeos/cryptohome_web_ui_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/cryptohome_web_ui_handler.cc
@@ -50,7 +50,7 @@ void CryptohomeWebUIHandler::OnPageLoaded(const base::ListValue* args) {
void CryptohomeWebUIHandler::DidGetNSSUtilInfoOnUIThread(
bool is_tpm_token_ready) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::FundamentalValue is_tpm_token_ready_value(is_tpm_token_ready);
SetCryptohomeProperty("is-tpm-token-ready", is_tpm_token_ready_value);
diff --git a/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc b/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc
index 31e5ddd..e5398f5 100644
--- a/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc
@@ -120,7 +120,7 @@ void GetFreeDiskSpace(const base::FilePath& home_path,
// Formats |entry| into text.
std::string FormatEntry(const base::FilePath& path,
const drive::ResourceEntry& entry) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
using base::StringAppendF;
@@ -313,7 +313,7 @@ class DriveInternalsWebUIHandler : public content::WebUIMessageHandler {
void DriveInternalsWebUIHandler::OnGetAboutResource(
google_apis::GDataErrorCode status,
scoped_ptr<google_apis::AboutResource> parsed_about_resource) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (status != google_apis::HTTP_SUCCESS) {
LOG(ERROR) << "Failed to get about resource";
@@ -337,7 +337,7 @@ void DriveInternalsWebUIHandler::OnGetAboutResource(
void DriveInternalsWebUIHandler::OnGetAppList(
google_apis::GDataErrorCode status,
scoped_ptr<google_apis::AppList> parsed_app_list) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (status != google_apis::HTTP_SUCCESS) {
LOG(ERROR) << "Failed to get app list";
@@ -393,7 +393,7 @@ void DriveInternalsWebUIHandler::RegisterMessages() {
drive::DriveIntegrationService*
DriveInternalsWebUIHandler::GetIntegrationService() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
Profile* profile = Profile::FromWebUI(web_ui());
drive::DriveIntegrationService* service =
@@ -404,14 +404,14 @@ DriveInternalsWebUIHandler::GetIntegrationService() {
}
drive::DriveServiceInterface* DriveInternalsWebUIHandler::GetDriveService() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
Profile* profile = Profile::FromWebUI(web_ui());
return drive::util::GetDriveServiceByProfile(profile);
}
drive::DebugInfoCollector* DriveInternalsWebUIHandler::GetDebugInfoCollector() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
drive::DriveIntegrationService* integration_service = GetIntegrationService();
return integration_service ?
@@ -419,7 +419,7 @@ drive::DebugInfoCollector* DriveInternalsWebUIHandler::GetDebugInfoCollector() {
}
void DriveInternalsWebUIHandler::OnPageLoaded(const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
drive::DriveIntegrationService* integration_service =
GetIntegrationService();
@@ -455,7 +455,7 @@ void DriveInternalsWebUIHandler::OnPageLoaded(const base::ListValue* args) {
}
void DriveInternalsWebUIHandler::UpdateDriveRelatedPreferencesSection() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
const char* kDriveRelatedPreferences[] = {
prefs::kDisableDrive,
@@ -481,7 +481,7 @@ void DriveInternalsWebUIHandler::UpdateDriveRelatedPreferencesSection() {
void DriveInternalsWebUIHandler::UpdateConnectionStatusSection(
drive::DriveServiceInterface* drive_service) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(drive_service);
std::string status;
@@ -514,7 +514,7 @@ void DriveInternalsWebUIHandler::UpdateConnectionStatusSection(
void DriveInternalsWebUIHandler::UpdateAboutResourceSection(
drive::DriveServiceInterface* drive_service) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(drive_service);
drive_service->GetAboutResource(
@@ -524,7 +524,7 @@ void DriveInternalsWebUIHandler::UpdateAboutResourceSection(
void DriveInternalsWebUIHandler::UpdateAppListSection(
drive::DriveServiceInterface* drive_service) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(drive_service);
drive_service->GetAppList(
@@ -534,7 +534,7 @@ void DriveInternalsWebUIHandler::UpdateAppListSection(
void DriveInternalsWebUIHandler::UpdateLocalMetadataSection(
drive::DebugInfoCollector* debug_info_collector) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(debug_info_collector);
debug_info_collector->GetMetadata(
@@ -544,7 +544,7 @@ void DriveInternalsWebUIHandler::UpdateLocalMetadataSection(
void DriveInternalsWebUIHandler::OnGetFilesystemMetadataForLocal(
const drive::FileSystemMetadata& metadata) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::DictionaryValue local_metadata;
local_metadata.SetDouble("account-largest-changestamp-local",
@@ -554,7 +554,7 @@ void DriveInternalsWebUIHandler::OnGetFilesystemMetadataForLocal(
}
void DriveInternalsWebUIHandler::ClearAccessToken(const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
drive::DriveServiceInterface* drive_service = GetDriveService();
if (drive_service)
@@ -563,7 +563,7 @@ void DriveInternalsWebUIHandler::ClearAccessToken(const base::ListValue* args) {
void DriveInternalsWebUIHandler::ClearRefreshToken(
const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
drive::DriveServiceInterface* drive_service = GetDriveService();
if (drive_service)
@@ -572,7 +572,7 @@ void DriveInternalsWebUIHandler::ClearRefreshToken(
void DriveInternalsWebUIHandler::ResetDriveFileSystem(
const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
drive::DriveIntegrationService* integration_service =
GetIntegrationService();
@@ -584,21 +584,21 @@ void DriveInternalsWebUIHandler::ResetDriveFileSystem(
}
void DriveInternalsWebUIHandler::ResetFinished(bool success) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
web_ui()->CallJavascriptFunction("updateResetStatus",
base::FundamentalValue(success));
}
void DriveInternalsWebUIHandler::ListFileEntries(const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
UpdateFileSystemContentsSection();
}
void DriveInternalsWebUIHandler::UpdateDeltaUpdateStatusSection(
drive::DebugInfoCollector* debug_info_collector) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(debug_info_collector);
debug_info_collector->GetMetadata(
@@ -609,7 +609,7 @@ void DriveInternalsWebUIHandler::UpdateDeltaUpdateStatusSection(
void DriveInternalsWebUIHandler::OnGetFilesystemMetadataForDeltaUpdate(
const drive::FileSystemMetadata& metadata) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
Profile* profile = Profile::FromWebUI(web_ui());
drive::DriveNotificationManager* drive_notification_manager =
@@ -635,7 +635,7 @@ void DriveInternalsWebUIHandler::OnGetFilesystemMetadataForDeltaUpdate(
void DriveInternalsWebUIHandler::UpdateInFlightOperationsSection(
drive::JobListInterface* job_list) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(job_list);
std::vector<drive::JobInfo> info_list = job_list->GetJobInfoList();
@@ -658,7 +658,7 @@ void DriveInternalsWebUIHandler::UpdateInFlightOperationsSection(
}
void DriveInternalsWebUIHandler::UpdateGCacheContentsSection() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Start updating the GCache contents section.
Profile* profile = Profile::FromWebUI(web_ui());
@@ -678,7 +678,7 @@ void DriveInternalsWebUIHandler::UpdateGCacheContentsSection() {
}
void DriveInternalsWebUIHandler::UpdateFileSystemContentsSection() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
drive::DebugInfoCollector* debug_info_collector = GetDebugInfoCollector();
if (!debug_info_collector)
@@ -701,7 +701,7 @@ void DriveInternalsWebUIHandler::UpdateFileSystemContentsSection() {
}
void DriveInternalsWebUIHandler::UpdateLocalStorageUsageSection() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Propagate the amount of local free space in bytes.
base::FilePath home_path;
@@ -720,7 +720,7 @@ void DriveInternalsWebUIHandler::UpdateLocalStorageUsageSection() {
void DriveInternalsWebUIHandler::UpdateCacheContentsSection(
drive::DebugInfoCollector* debug_info_collector) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(debug_info_collector);
debug_info_collector->IterateFileCache(
@@ -730,7 +730,7 @@ void DriveInternalsWebUIHandler::UpdateCacheContentsSection(
}
void DriveInternalsWebUIHandler::UpdateEventLogSection() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
drive::DriveIntegrationService* integration_service =
GetIntegrationService();
@@ -761,7 +761,7 @@ void DriveInternalsWebUIHandler::UpdateEventLogSection() {
}
void DriveInternalsWebUIHandler::UpdatePathConfigurationsSection() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
Profile* const profile = Profile::FromWebUI(web_ui());
@@ -791,7 +791,7 @@ void DriveInternalsWebUIHandler::UpdatePathConfigurationsSection() {
void DriveInternalsWebUIHandler::OnGetGCacheContents(
base::ListValue* gcache_contents,
base::DictionaryValue* gcache_summary) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(gcache_contents);
DCHECK(gcache_summary);
@@ -804,7 +804,7 @@ void DriveInternalsWebUIHandler::OnGetResourceEntryByPath(
const base::FilePath& path,
drive::FileError error,
scoped_ptr<drive::ResourceEntry> entry) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (error == drive::FILE_ERROR_OK) {
DCHECK(entry.get());
@@ -817,7 +817,7 @@ void DriveInternalsWebUIHandler::OnReadDirectoryByPath(
const base::FilePath& parent_path,
drive::FileError error,
scoped_ptr<drive::ResourceEntryVector> entries) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (error == drive::FILE_ERROR_OK) {
DCHECK(entries.get());
@@ -851,7 +851,7 @@ void DriveInternalsWebUIHandler::OnReadDirectoryByPath(
void DriveInternalsWebUIHandler::UpdateCacheEntry(
const std::string& local_id,
const drive::FileCacheEntry& cache_entry) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Convert |cache_entry| into a dictionary.
base::DictionaryValue value;
@@ -866,7 +866,7 @@ void DriveInternalsWebUIHandler::UpdateCacheEntry(
void DriveInternalsWebUIHandler::OnGetFreeDiskSpace(
base::DictionaryValue* local_storage_summary) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(local_storage_summary);
web_ui()->CallJavascriptFunction(
@@ -874,7 +874,7 @@ void DriveInternalsWebUIHandler::OnGetFreeDiskSpace(
}
void DriveInternalsWebUIHandler::OnPeriodicUpdate(const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
drive::DriveIntegrationService* integration_service =
GetIntegrationService();
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
index baef5d8..50640da 100644
--- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
@@ -108,7 +108,7 @@ const char kSourceAccountPicker[] = "account-picker";
// The Task posted to PostTaskAndReply in StartClearingDnsCache on the IO
// thread.
void ClearDnsCache(IOThread* io_thread) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (browser_shutdown::IsTryingToQuit())
return;
@@ -963,7 +963,7 @@ void SigninScreenHandler::ShowSigninScreenForCreds(
}
void SigninScreenHandler::OnCookiesCleared(base::Closure on_clear_callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
cookies_cleared_ = true;
on_clear_callback.Run();
}
@@ -1007,7 +1007,7 @@ void SigninScreenHandler::Observe(int type,
}
void SigninScreenHandler::OnDnsCleared() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
dns_clear_task_running_ = false;
dns_cleared_ = true;
ShowSigninScreenIfReady();
diff --git a/chrome/browser/ui/webui/chromeos/mobile_setup_dialog.cc b/chrome/browser/ui/webui/chromeos/mobile_setup_dialog.cc
index edd4a0d..0a8a692 100644
--- a/chrome/browser/ui/webui/chromeos/mobile_setup_dialog.cc
+++ b/chrome/browser/ui/webui/chromeos/mobile_setup_dialog.cc
@@ -66,13 +66,13 @@ class MobileSetupDialogDelegate : public WebDialogDelegate {
// static
void MobileSetupDialog::Show(const std::string& service_path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
MobileSetupDialogDelegate::GetInstance()->ShowDialog(service_path);
}
// static
MobileSetupDialogDelegate* MobileSetupDialogDelegate::GetInstance() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return Singleton<MobileSetupDialogDelegate>::get();
}
diff --git a/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc b/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
index 06a809c..d51fa03 100644
--- a/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
@@ -469,7 +469,7 @@ void SimUnlockHandler::CancelDialog() {
void SimUnlockHandler::EnterCode(const std::string& code,
SimUnlockCode code_type) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
pending_pin_operation_ = true;
@@ -703,7 +703,7 @@ void SimUnlockHandler::HandleSimStatusInitialize(const base::ListValue* args) {
}
void SimUnlockHandler::InitializeSimStatus() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// TODO(armansito): For now, we're initializing the device path to the first
// available cellular device. We should try to obtain a specific device here,
// as there can be multiple cellular devices present.
@@ -718,7 +718,7 @@ void SimUnlockHandler::InitializeSimStatus() {
}
void SimUnlockHandler::ProceedToPukInput() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
ProcessSimCardState(GetCellularDevice());
}
diff --git a/chrome/browser/ui/webui/help/version_updater_win.cc b/chrome/browser/ui/webui/help/version_updater_win.cc
index b6b38e5..e3708d3 100644
--- a/chrome/browser/ui/webui/help/version_updater_win.cc
+++ b/chrome/browser/ui/webui/help/version_updater_win.cc
@@ -243,7 +243,7 @@ void VersionUpdaterWin::UpdateStatus(GoogleUpdateUpgradeResult result,
void VersionUpdaterWin::GotInstalledVersion(const Version& version) {
// This must be called on the UI thread so that callback_ can be called.
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Make sure that the latest version is running and if not,
// notify the user by setting the status to NEARLY_UPDATED.
@@ -287,7 +287,7 @@ BOOL CALLBACK WindowEnumeration(HWND window, LPARAM param) {
HWND VersionUpdaterWin::GetElevationParent() {
// Look for a visible window belonging to the UI thread.
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
HWND window = NULL;
EnumThreadWindows(GetCurrentThreadId(),
WindowEnumeration,
diff --git a/chrome/browser/ui/webui/memory_internals/memory_internals_handler.cc b/chrome/browser/ui/webui/memory_internals/memory_internals_handler.cc
index 2506360..8869a2e 100644
--- a/chrome/browser/ui/webui/memory_internals/memory_internals_handler.cc
+++ b/chrome/browser/ui/webui/memory_internals/memory_internals_handler.cc
@@ -24,7 +24,7 @@ MemoryInternalsHandler::~MemoryInternalsHandler() {
}
void MemoryInternalsHandler::RegisterMessages() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
proxy_->Attach(this);
// Set callback functions called by JavaScript messages.
diff --git a/chrome/browser/ui/webui/memory_internals/memory_internals_proxy.cc b/chrome/browser/ui/webui/memory_internals/memory_internals_proxy.cc
index d7c6d97..f596074 100644
--- a/chrome/browser/ui/webui/memory_internals/memory_internals_proxy.cc
+++ b/chrome/browser/ui/webui/memory_internals/memory_internals_proxy.cc
@@ -183,17 +183,17 @@ MemoryInternalsProxy::MemoryInternalsProxy()
base::Bind(&MemoryInternalsProxy::OnRendererAvailable, this))) {}
void MemoryInternalsProxy::Attach(MemoryInternalsHandler* handler) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
handler_ = handler;
}
void MemoryInternalsProxy::Detach() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
handler_ = NULL;
}
void MemoryInternalsProxy::StartFetch(const base::ListValue* list) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Clear previous information before fetching new information.
information_->Clear();
@@ -337,7 +337,7 @@ void MemoryInternalsProxy::FinishCollection() {
void MemoryInternalsProxy::CallJavaScriptFunctionOnUIThread(
const std::string& function, const base::Value& args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
std::vector<const base::Value*> args_vector(1, &args);
base::string16 update =
diff --git a/chrome/browser/ui/webui/net_export_ui.cc b/chrome/browser/ui/webui/net_export_ui.cc
index 70caf26..9b18f31 100644
--- a/chrome/browser/ui/webui/net_export_ui.cc
+++ b/chrome/browser/ui/webui/net_export_ui.cc
@@ -110,7 +110,7 @@ NetExportMessageHandler::~NetExportMessageHandler() {
}
void NetExportMessageHandler::RegisterMessages() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
web_ui()->RegisterMessageCallback(
"getExportNetLogInfo",
@@ -184,7 +184,7 @@ void NetExportMessageHandler::ProcessNetLogCommand(
return;
}
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE_USER_BLOCKING));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE_USER_BLOCKING);
net_log_temp_file->ProcessCommand(command);
SendExportNetLogInfo(net_export_message_handler, net_log_temp_file);
}
@@ -192,7 +192,7 @@ void NetExportMessageHandler::ProcessNetLogCommand(
// static
base::FilePath NetExportMessageHandler::GetNetLogFileName(
NetLogTempFile* net_log_temp_file) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE_USER_BLOCKING));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE_USER_BLOCKING);
base::FilePath net_export_file_path;
net_log_temp_file->GetFilePath(&net_export_file_path);
return net_export_file_path;
@@ -202,7 +202,7 @@ base::FilePath NetExportMessageHandler::GetNetLogFileName(
void NetExportMessageHandler::SendExportNetLogInfo(
base::WeakPtr<NetExportMessageHandler> net_export_message_handler,
NetLogTempFile* net_log_temp_file) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE_USER_BLOCKING));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE_USER_BLOCKING);
base::Value* value = net_log_temp_file->GetState();
if (!BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
@@ -218,7 +218,7 @@ void NetExportMessageHandler::SendExportNetLogInfo(
void NetExportMessageHandler::SendEmail(const base::FilePath& file_to_send) {
if (file_to_send.empty())
return;
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
#if defined(OS_ANDROID)
std::string email;
@@ -236,7 +236,7 @@ void NetExportMessageHandler::SendEmail(const base::FilePath& file_to_send) {
void NetExportMessageHandler::OnExportNetLogInfoChanged(base::Value* arg) {
scoped_ptr<base::Value> value(arg);
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
web_ui()->CallJavascriptFunction(
"NetExportView.getInstance().onExportNetLogInfoChanged", *arg);
}
diff --git a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc
index 07ae093..c5962b7 100644
--- a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc
+++ b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc
@@ -294,7 +294,7 @@ void WriteDebugLogToFileCompleted(const StoreDebugLogsCallback& callback,
PassPlatformFile pass_platform_file,
const base::FilePath& file_path,
bool succeeded) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!succeeded) {
bool posted = base::WorkerPool::PostTaskAndReply(FROM_HERE,
base::Bind(&CloseAndDeleteDebugLogFile, pass_platform_file, file_path),
@@ -315,7 +315,7 @@ void WriteDebugLogToFile(const StoreDebugLogsCallback& callback,
bool created,
PlatformFileError error,
const base::FilePath& file_path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!created) {
LOG(ERROR) <<
"Can't create debug log file: " << file_path.AsUTF8Unsafe() << ", " <<
@@ -339,7 +339,7 @@ void WriteDebugLogToFile(const StoreDebugLogsCallback& callback,
// failure) on the worker pool, prior to calling |callback|.
void StoreDebugLogs(const base::FilePath& fileshelf,
const StoreDebugLogsCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!callback.is_null());
DebugLogFileHelper* helper = new DebugLogFileHelper();
bool posted = base::WorkerPool::PostTaskAndReply(FROM_HERE,
@@ -642,7 +642,7 @@ NetInternalsMessageHandler::~NetInternalsMessageHandler() {
}
void NetInternalsMessageHandler::RegisterMessages() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
Profile* profile = Profile::FromWebUI(web_ui());
@@ -807,7 +807,7 @@ void NetInternalsMessageHandler::SendJavascriptCommand(
base::Value* arg) {
scoped_ptr<base::Value> command_value(new base::StringValue(command));
scoped_ptr<base::Value> value(arg);
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (value.get()) {
web_ui()->CallJavascriptFunction("g_browser.receive",
*command_value.get(),
@@ -833,7 +833,7 @@ void NetInternalsMessageHandler::OnClearBrowserCache(
void NetInternalsMessageHandler::OnGetPrerenderInfo(
const base::ListValue* list) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::DictionaryValue* value = NULL;
prerender::PrerenderManager* prerender_manager = prerender_manager_.get();
@@ -849,7 +849,7 @@ void NetInternalsMessageHandler::OnGetPrerenderInfo(
void NetInternalsMessageHandler::OnGetHistoricNetworkStats(
const base::ListValue* list) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::Value* historic_network_info =
ChromeNetworkDelegate::HistoricNetworkStatsInfoToValue();
SendJavascriptCommand("receivedHistoricNetworkStats", historic_network_info);
@@ -857,7 +857,7 @@ void NetInternalsMessageHandler::OnGetHistoricNetworkStats(
void NetInternalsMessageHandler::OnGetExtensionInfo(
const base::ListValue* list) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::ListValue* extension_list = new base::ListValue();
Profile* profile = Profile::FromWebUI(web_ui());
extensions::ExtensionSystem* extension_system =
@@ -989,17 +989,17 @@ NetInternalsMessageHandler::IOThreadImpl::IOThreadImpl(
io_thread_(io_thread),
main_context_getter_(main_context_getter),
was_webui_deleted_(false) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
AddRequestContextGetter(main_context_getter);
}
NetInternalsMessageHandler::IOThreadImpl::~IOThreadImpl() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
void NetInternalsMessageHandler::IOThreadImpl::AddRequestContextGetter(
net::URLRequestContextGetter* context_getter) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
context_getters_.push_back(context_getter);
}
@@ -1007,7 +1007,7 @@ void NetInternalsMessageHandler::IOThreadImpl::CallbackHelper(
MessageHandler method,
scoped_refptr<IOThreadImpl> io_thread,
const base::ListValue* list) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// We need to make a copy of the value in order to pass it over to the IO
// thread. |list_copy| will be deleted when the task is destroyed. The called
@@ -1021,7 +1021,7 @@ void NetInternalsMessageHandler::IOThreadImpl::CallbackHelper(
}
void NetInternalsMessageHandler::IOThreadImpl::Detach() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// Unregister with network stack to observe events.
if (net_log())
net_log()->RemoveThreadSafeObserver(this);
@@ -1031,13 +1031,13 @@ void NetInternalsMessageHandler::IOThreadImpl::Detach() {
}
void NetInternalsMessageHandler::IOThreadImpl::OnWebUIDeleted() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
was_webui_deleted_ = true;
}
void NetInternalsMessageHandler::IOThreadImpl::OnRendererReady(
const base::ListValue* list) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// If we have any pending entries, go ahead and get rid of them, so they won't
// appear before the REQUEST_ALIVE events we add for currently active
@@ -1757,7 +1757,7 @@ void NetInternalsMessageHandler::IOThreadImpl::SendJavascriptCommand(
void NetInternalsMessageHandler::IOThreadImpl::AddEntryToQueue(
base::Value* entry) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!pending_entries_.get()) {
pending_entries_.reset(new base::ListValue());
BrowserThread::PostDelayedTask(
@@ -1769,7 +1769,7 @@ void NetInternalsMessageHandler::IOThreadImpl::AddEntryToQueue(
}
void NetInternalsMessageHandler::IOThreadImpl::PostPendingEntries() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (pending_entries_.get())
SendJavascriptCommand("receivedLogEntries", pending_entries_.release());
}
diff --git a/chrome/browser/ui/webui/ntp/android/bookmarks_handler.cc b/chrome/browser/ui/webui/ntp/android/bookmarks_handler.cc
index 88ca506..40bb7b0 100644
--- a/chrome/browser/ui/webui/ntp/android/bookmarks_handler.cc
+++ b/chrome/browser/ui/webui/ntp/android/bookmarks_handler.cc
@@ -143,7 +143,7 @@ void BookmarksHandler::RegisterMessages() {
}
void BookmarksHandler::HandleGetBookmarks(const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
bookmark_data_requested_ = true;
if (!AreModelsLoaded())
@@ -157,7 +157,7 @@ void BookmarksHandler::HandleGetBookmarks(const base::ListValue* args) {
}
void BookmarksHandler::HandleDeleteBookmark(const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!AreModelsLoaded())
return;
@@ -184,7 +184,7 @@ void BookmarksHandler::HandleDeleteBookmark(const base::ListValue* args) {
}
void BookmarksHandler::HandleEditBookmark(const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!AreModelsLoaded())
return;
@@ -434,7 +434,7 @@ void BookmarksHandler::BookmarkModelChanged() {
void BookmarksHandler::HandleCreateHomeScreenBookmarkShortcut(
const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!AreModelsLoaded())
return;
diff --git a/chrome/browser/ui/webui/ntp/android/ntp_resource_cache_android.cc b/chrome/browser/ui/webui/ntp/android/ntp_resource_cache_android.cc
index 793d314..c76a5c69 100644
--- a/chrome/browser/ui/webui/ntp/android/ntp_resource_cache_android.cc
+++ b/chrome/browser/ui/webui/ntp/android/ntp_resource_cache_android.cc
@@ -53,7 +53,7 @@ NTPResourceCache::WindowType NTPResourceCache::GetWindowType(
}
base::RefCountedMemory* NTPResourceCache::GetNewTabHTML(WindowType win_type) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Android uses same html/css for incognito NTP and normal NTP
if (!new_tab_html_.get())
CreateNewTabHTML();
diff --git a/chrome/browser/ui/webui/ntp/android/promo_handler.cc b/chrome/browser/ui/webui/ntp/android/promo_handler.cc
index ac39f23..239ae31 100644
--- a/chrome/browser/ui/webui/ntp/android/promo_handler.cc
+++ b/chrome/browser/ui/webui/ntp/android/promo_handler.cc
@@ -146,7 +146,7 @@ void PromoHandler::Observe(int type,
}
void PromoHandler::HandlePromoSendEmail(const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
Profile* profile = Profile::FromBrowserContext(
web_ui()->GetWebContents()->GetBrowserContext());
if (!profile)
@@ -209,7 +209,7 @@ void PromoHandler::HandleGetPromotions(const base::ListValue* /*args*/) {
}
void PromoHandler::HandleRecordImpression(const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(args && !args->empty());
RecordPromotionImpression(base::UTF16ToASCII(ExtractStringValue(args)));
}
diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
index 2392516..aab5d1d 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
@@ -355,7 +355,7 @@ void NewTabUI::NewTabHTMLSource::StartDataRequest(
int render_process_id,
int render_frame_id,
const content::URLDataSource::GotDataCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
std::map<std::string, std::pair<std::string, int> >::iterator it =
resource_map_.find(path);
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
index 7d93f06..c2a4f15 100644
--- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
@@ -228,7 +228,7 @@ NTPResourceCache::WindowType NTPResourceCache::GetWindowType(
}
base::RefCountedMemory* NTPResourceCache::GetNewTabHTML(WindowType win_type) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (win_type == GUEST) {
if (!new_tab_guest_html_.get())
CreateNewTabGuestHTML();
@@ -248,7 +248,7 @@ base::RefCountedMemory* NTPResourceCache::GetNewTabHTML(WindowType win_type) {
}
base::RefCountedMemory* NTPResourceCache::GetNewTabCSS(WindowType win_type) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (win_type == GUEST) {
if (!new_tab_guest_css_.get())
CreateNewTabGuestCSS();
diff --git a/chrome/browser/ui/webui/options/advanced_options_utils_linux.cc b/chrome/browser/ui/webui/options/advanced_options_utils_linux.cc
index f1c3790..72da754 100644
--- a/chrome/browser/ui/webui/options/advanced_options_utils_linux.cc
+++ b/chrome/browser/ui/webui/options/advanced_options_utils_linux.cc
@@ -45,7 +45,7 @@ namespace {
// Show the proxy config URL in the given tab.
void ShowLinuxProxyConfigUrl(int render_process_id, int render_view_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
scoped_ptr<base::Environment> env(base::Environment::Create());
const char* name = base::nix::GetDesktopEnvironmentName(env.get());
if (name)
@@ -62,7 +62,7 @@ void ShowLinuxProxyConfigUrl(int render_process_id, int render_view_id) {
// Start the given proxy configuration utility.
bool StartProxyConfigUtil(const char* command[]) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
// base::LaunchProcess() returns true ("success") if the fork()
// succeeds, but not necessarily the exec(). We'd like to be able to
// use StartProxyConfigUtil() to search possible options and stop on
@@ -105,7 +105,7 @@ bool StartProxyConfigUtil(const char* command[]) {
// failure to do so, show the Linux proxy config URL in a new tab instead.
void DetectAndStartProxyConfigUtil(int render_process_id,
int render_view_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
scoped_ptr<base::Environment> env(base::Environment::Create());
bool launched = false;
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index 3ee6534..a71d734 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -936,7 +936,7 @@ void BrowserOptionsHandler::CheckAutoLaunch(
base::WeakPtr<BrowserOptionsHandler> weak_this,
const base::FilePath& profile_path) {
#if defined(OS_WIN)
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
// Auto-launch is not supported for secondary profiles yet.
if (profile_path.BaseName().value() !=
@@ -961,7 +961,7 @@ void BrowserOptionsHandler::CheckAutoLaunchCallback(
bool is_in_auto_launch_group,
bool will_launch_at_login) {
#if defined(OS_WIN)
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (is_in_auto_launch_group) {
web_ui()->RegisterMessageCallback("toggleAutoLaunch",
diff --git a/chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc
index 014c86f..2c0732e 100644
--- a/chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc
@@ -220,7 +220,7 @@ void ChangePictureOptionsHandler::HandleDiscardPhoto(
void ChangePictureOptionsHandler::HandlePhotoTaken(
const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
std::string image_url;
if (!args || args->GetSize() != 1 || !args->GetString(0, &image_url))
NOTREACHED();
diff --git a/chrome/browser/ui/webui/options/manage_profile_handler.cc b/chrome/browser/ui/webui/options/manage_profile_handler.cc
index 7c3bdd9..de47e8b 100644
--- a/chrome/browser/ui/webui/options/manage_profile_handler.cc
+++ b/chrome/browser/ui/webui/options/manage_profile_handler.cc
@@ -392,7 +392,7 @@ void ManageProfileHandler::ProfileIconSelectionChanged(
void ManageProfileHandler::RequestHasProfileShortcuts(
const base::ListValue* args) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(ProfileShortcutManager::IsFeatureEnabled());
base::FilePath profile_file_path;
@@ -443,7 +443,7 @@ void ManageProfileHandler::OnCreateManagedUserPrefChange() {
}
void ManageProfileHandler::OnHasProfileShortcuts(bool has_shortcuts) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
const base::FundamentalValue has_shortcuts_value(has_shortcuts);
web_ui()->CallJavascriptFunction(
diff --git a/chrome/browser/ui/webui/performance_monitor/performance_monitor_handler.cc b/chrome/browser/ui/webui/performance_monitor/performance_monitor_handler.cc
index c908853..59eae7d 100644
--- a/chrome/browser/ui/webui/performance_monitor/performance_monitor_handler.cc
+++ b/chrome/browser/ui/webui/performance_monitor/performance_monitor_handler.cc
@@ -424,13 +424,13 @@ void PerformanceMonitorHandler::RegisterMessages() {
void PerformanceMonitorHandler::ReturnResults(const std::string& function,
const base::Value* results) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
web_ui()->CallJavascriptFunction(function, *results);
}
void PerformanceMonitorHandler::HandleGetActiveIntervals(
const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
CHECK_EQ(2u, args->GetSize());
double double_time = 0.0;
CHECK(args->GetDouble(0, &double_time));
@@ -449,7 +449,7 @@ void PerformanceMonitorHandler::HandleGetActiveIntervals(
void PerformanceMonitorHandler::HandleGetFlagEnabled(
const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
CHECK_EQ(0u, args->GetSize());
scoped_ptr<base::Value> value(base::Value::CreateBooleanValue(
CommandLine::ForCurrentProcess()->HasSwitch(
@@ -459,7 +459,7 @@ void PerformanceMonitorHandler::HandleGetFlagEnabled(
void PerformanceMonitorHandler::HandleGetAggregationTypes(
const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
CHECK_EQ(0u, args->GetSize());
base::ListValue results;
for (int i = 0; i < AGGREGATION_METHOD_NUMBER_OF_METHODS; ++i) {
@@ -473,7 +473,7 @@ void PerformanceMonitorHandler::HandleGetAggregationTypes(
void PerformanceMonitorHandler::HandleGetEventTypes(
const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
CHECK_EQ(0u, args->GetSize());
base::ListValue results;
for (int i = 0; i < EVENT_CATEGORY_NUMBER_OF_CATEGORIES; ++i)
@@ -483,7 +483,7 @@ void PerformanceMonitorHandler::HandleGetEventTypes(
}
void PerformanceMonitorHandler::HandleGetEvents(const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
CHECK_EQ(3u, args->GetSize());
const base::ListValue* event_type_list;
@@ -516,7 +516,7 @@ void PerformanceMonitorHandler::HandleGetEvents(const base::ListValue* args) {
void PerformanceMonitorHandler::HandleGetMetricTypes(
const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
CHECK_EQ(0u, args->GetSize());
base::ListValue results;
for (int i = 0; i < METRIC_CATEGORY_NUMBER_OF_CATEGORIES; ++i)
@@ -526,7 +526,7 @@ void PerformanceMonitorHandler::HandleGetMetricTypes(
}
void PerformanceMonitorHandler::HandleGetMetrics(const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
CHECK_EQ(5u, args->GetSize());
const base::ListValue* metric_type_list;
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
index 69eb4ed..a6ec0c6 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -260,7 +260,7 @@ void ReportPrintSettingsStats(const base::DictionaryValue& settings) {
// Callback that stores a PDF file on disk.
void PrintToPdfCallback(printing::Metafile* metafile,
const base::FilePath& path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
metafile->SaveTo(path);
// |metafile| must be deleted on the UI thread.
BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, metafile);
@@ -268,7 +268,7 @@ void PrintToPdfCallback(printing::Metafile* metafile,
std::string GetDefaultPrinterOnFileThread(
scoped_refptr<printing::PrintBackend> print_backend) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
std::string default_printer = print_backend->GetDefaultPrinterName();
VLOG(1) << "Default Printer: " << default_printer;
@@ -278,7 +278,7 @@ std::string GetDefaultPrinterOnFileThread(
void EnumeratePrintersOnFileThread(
scoped_refptr<printing::PrintBackend> print_backend,
base::ListValue* printers) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
VLOG(1) << "Enumerate printers start";
printing::PrinterList printer_list;
@@ -332,7 +332,7 @@ void GetPrinterCapabilitiesOnFileThread(
const std::string& printer_name,
const GetPrinterCapabilitiesSuccessCallback& success_cb,
const GetPrinterCapabilitiesFailureCallback& failure_cb) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
DCHECK(!printer_name.empty());
VLOG(1) << "Get printer capabilities start for " << printer_name;
diff --git a/chrome/browser/ui/webui/profiler_ui.cc b/chrome/browser/ui/webui/profiler_ui.cc
index 4df4a7a..3f9f2f1 100644
--- a/chrome/browser/ui/webui/profiler_ui.cc
+++ b/chrome/browser/ui/webui/profiler_ui.cc
@@ -129,7 +129,7 @@ class ProfilerMessageHandler : public WebUIMessageHandler {
};
void ProfilerMessageHandler::RegisterMessages() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
web_ui()->RegisterMessageCallback("getData",
base::Bind(&ProfilerMessageHandler::OnGetData, base::Unretained(this)));
diff --git a/chrome/browser/ui/webui/set_as_default_browser_ui.cc b/chrome/browser/ui/webui/set_as_default_browser_ui.cc
index 19b0b0a..dbaa853 100644
--- a/chrome/browser/ui/webui/set_as_default_browser_ui.cc
+++ b/chrome/browser/ui/webui/set_as_default_browser_ui.cc
@@ -154,7 +154,7 @@ void SetAsDefaultBrowserHandler::RegisterMessages() {
void SetAsDefaultBrowserHandler::SetDefaultWebClientUIState(
ShellIntegration::DefaultWebClientUIState state) {
// The callback is expected to be invoked once the procedure has completed.
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!set_default_returned_)
return;
@@ -190,7 +190,7 @@ void SetAsDefaultBrowserHandler::HandleLaunchSetDefaultBrowserFlow(
void SetAsDefaultBrowserHandler::ConcludeInteraction(
MakeChromeDefaultResult interaction_result) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (response_delegate_)
response_delegate_->SetDialogInteractionResult(interaction_result);
@@ -387,7 +387,7 @@ void SetAsDefaultBrowserDialogImpl::OnBrowserRemoved(Browser* browser) {
void SetAsDefaultBrowserDialogImpl::
AttemptImmersiveFirstRunRestartOnFileThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
// If the sentinel was created for this launch, remove it before restarting
// in immersive mode so that the user is taken through the full first-run
@@ -413,7 +413,7 @@ SetAsDefaultBrowserUI::SetAsDefaultBrowserUI(content::WebUI* web_ui)
// static
void SetAsDefaultBrowserUI::Show(Profile* profile, Browser* browser) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
SetAsDefaultBrowserDialogImpl* dialog =
new SetAsDefaultBrowserDialogImpl(profile, browser);
dialog->ShowDialog();
diff --git a/chrome/browser/ui/webui/sync_internals_message_handler.cc b/chrome/browser/ui/webui/sync_internals_message_handler.cc
index 93ba008..e7869c2 100644
--- a/chrome/browser/ui/webui/sync_internals_message_handler.cc
+++ b/chrome/browser/ui/webui/sync_internals_message_handler.cc
@@ -39,7 +39,7 @@ SyncInternalsMessageHandler::~SyncInternalsMessageHandler() {
}
void SyncInternalsMessageHandler::RegisterMessages() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
web_ui()->RegisterMessageCallback(
"registerForEvents",
diff --git a/chrome/browser/ui/webui/theme_source.cc b/chrome/browser/ui/webui/theme_source.cc
index 0f676c5..46b9db9 100644
--- a/chrome/browser/ui/webui/theme_source.cc
+++ b/chrome/browser/ui/webui/theme_source.cc
@@ -70,7 +70,7 @@ void ThemeSource::StartDataRequest(
if (uncached_path == kNewTabCSSPath ||
uncached_path == kNewIncognitoTabCSSPath) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
callback.Run(css_bytes_.get());
return;
@@ -139,7 +139,7 @@ void ThemeSource::SendThemeBitmap(
int resource_id,
ui::ScaleFactor scale_factor) {
if (ThemeProperties::IsThemeableImage(resource_id)) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
ui::ThemeProvider* tp = ThemeServiceFactory::GetForProfile(profile_);
DCHECK(tp);
@@ -147,7 +147,7 @@ void ThemeSource::SendThemeBitmap(
resource_id, scale_factor));
callback.Run(image_data.get());
} else {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
const ResourceBundle& rb = ResourceBundle::GetSharedInstance();
callback.Run(rb.LoadDataResourceBytesForScale(resource_id, scale_factor));
}
diff --git a/chrome/browser/ui/webui/version_handler.cc b/chrome/browser/ui/webui/version_handler.cc
index 6a1af51..8530492 100644
--- a/chrome/browser/ui/webui/version_handler.cc
+++ b/chrome/browser/ui/webui/version_handler.cc
@@ -25,7 +25,7 @@ namespace {
void GetFilePaths(const base::FilePath& profile_path,
base::string16* exec_path_out,
base::string16* profile_path_out) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
base::FilePath executable_path = base::MakeAbsoluteFilePath(
CommandLine::ForCurrentProcess()->GetProgram());
@@ -116,7 +116,7 @@ void VersionHandler::HandleRequestVersionInfo(const base::ListValue* args) {
void VersionHandler::OnGotFilePaths(base::string16* executable_path_data,
base::string16* profile_path_data) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
base::StringValue exec_path(*executable_path_data);
base::StringValue profile_path(*profile_path_data);