diff options
author | jyasskin@chromium.org <jyasskin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-02 06:41:18 +0000 |
---|---|---|
committer | jyasskin@chromium.org <jyasskin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-02 06:41:18 +0000 |
commit | a4a46be32d27e4961512f35b85f9b25ced8bee29 (patch) | |
tree | 356805526e43d60654b529ed044c17a332ff52f8 | |
parent | 66e8fe6e3b21d65778b3d600fdda5e07b2b66727 (diff) | |
download | chromium_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
61 files changed, 212 insertions, 211 deletions
diff --git a/chrome/browser/ui/android/javascript_app_modal_dialog_android.cc b/chrome/browser/ui/android/javascript_app_modal_dialog_android.cc index 5db966c..c46e1ff 100644 --- a/chrome/browser/ui/android/javascript_app_modal_dialog_android.cc +++ b/chrome/browser/ui/android/javascript_app_modal_dialog_android.cc @@ -45,7 +45,7 @@ int JavascriptAppModalDialogAndroid::GetAppModalDialogButtons() const { } void JavascriptAppModalDialogAndroid::ShowAppModalDialog() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); JNIEnv* env = AttachCurrentThread(); // Keep a strong ref to the parent window while we make the call to java to diff --git a/chrome/browser/ui/android/login_prompt_android.cc b/chrome/browser/ui/android/login_prompt_android.cc index 8dd465b..f832a40 100644 --- a/chrome/browser/ui/android/login_prompt_android.cc +++ b/chrome/browser/ui/android/login_prompt_android.cc @@ -30,7 +30,7 @@ class LoginHandlerAndroid : public LoginHandler { virtual void OnAutofillDataAvailable( const base::string16& username, const base::string16& password) OVERRIDE { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(chrome_http_auth_handler_.get() != NULL); chrome_http_auth_handler_->OnAutofillDataAvailable( username, password); @@ -40,7 +40,7 @@ class LoginHandlerAndroid : public LoginHandler { virtual void BuildViewForPasswordManager( PasswordManager* manager, const base::string16& explanation) OVERRIDE { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // Get pointer to TabAndroid content::WebContents* web_contents = GetWebContentsForLogin(); diff --git a/chrome/browser/ui/android/ssl_client_certificate_request.cc b/chrome/browser/ui/android/ssl_client_certificate_request.cc index a6f3359..51d0549 100644 --- a/chrome/browser/ui/android/ssl_client_certificate_request.cc +++ b/chrome/browser/ui/android/ssl_client_certificate_request.cc @@ -37,7 +37,7 @@ typedef net::OpenSSLClientKeyStore::ScopedEVP_PKEY ScopedEVP_PKEY; void RecordClientCertificateKey( const scoped_refptr<net::X509Certificate>& client_cert, ScopedEVP_PKEY private_key) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); net::OpenSSLClientKeyStore::GetInstance()->RecordClientCertPrivateKey( client_cert.get(), private_key.get()); } @@ -46,7 +46,7 @@ void StartClientCertificateRequest( const net::SSLCertRequestInfo* cert_request_info, ui::WindowAndroid* window, const chrome::SelectCertificateCallback& callback) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); // Ensure that callback(NULL) is posted as a task on the UI thread // in case of an error. @@ -147,7 +147,7 @@ static void OnSystemRequestCompletion( jlong request_id, jobjectArray encoded_chain_ref, jobject private_key_ref) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); // Take back ownership of the request object. scoped_ptr<chrome::SelectCertificateCallback> callback( @@ -234,7 +234,7 @@ void ShowSSLClientCertificateSelector( ui::WindowAndroid* window = WindowAndroidHelper::FromWebContents(contents)->GetWindowAndroid(); DCHECK(window); - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); StartClientCertificateRequest(cert_request_info, window, callback); } diff --git a/chrome/browser/ui/app_list/app_list_service_mac.mm b/chrome/browser/ui/app_list/app_list_service_mac.mm index 470f484..19641ca 100644 --- a/chrome/browser/ui/app_list/app_list_service_mac.mm +++ b/chrome/browser/ui/app_list/app_list_service_mac.mm @@ -106,7 +106,7 @@ ShellIntegration::ShortcutInfo GetAppListShortcutInfo( } void CreateAppListShim(const base::FilePath& profile_path) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); WebApplicationInfo web_app_info; ShellIntegration::ShortcutInfo shortcut_info = GetAppListShortcutInfo(profile_path); diff --git a/chrome/browser/ui/ash/screenshot_taker.cc b/chrome/browser/ui/ash/screenshot_taker.cc index 4c5f72d..4359865 100644 --- a/chrome/browser/ui/ash/screenshot_taker.cc +++ b/chrome/browser/ui/ash/screenshot_taker.cc @@ -68,7 +68,7 @@ const char kImageClipboardFormatPrefix[] = "<img src='data:image/png;base64,"; const char kImageClipboardFormatSuffix[] = "'>"; void CopyScreenshotToClipboard(scoped_refptr<base::RefCountedString> png_data) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); std::string encoded; base::Base64Encode(png_data->data(), &encoded); @@ -445,7 +445,7 @@ void ScreenshotTaker::HandleTakePartialScreenshot( base::FilePath()); return; } - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); base::FilePath screenshot_directory; if (!screenshot_directory_for_test_.empty()) { @@ -510,7 +510,7 @@ Notification* ScreenshotTaker::CreateNotification( void ScreenshotTaker::ShowNotification( ScreenshotTakerObserver::Result screenshot_result, const base::FilePath& screenshot_path) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); #if defined(OS_CHROMEOS) // Do not show a notification that a screenshot was taken while no user is // logged in, since it is confusing for the user to get a message about it diff --git a/chrome/browser/ui/auto_login_prompter.cc b/chrome/browser/ui/auto_login_prompter.cc index ad502ba..9526e4e 100644 --- a/chrome/browser/ui/auto_login_prompter.cc +++ b/chrome/browser/ui/auto_login_prompter.cc @@ -95,7 +95,7 @@ void AutoLoginPrompter::ShowInfoBarUIThread(Params params, const GURL& url, int child_id, int route_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); WebContents* web_contents = tab_util::GetWebContentsByID(child_id, route_id); if (!web_contents) return; diff --git a/chrome/browser/ui/cocoa/dock_icon.mm b/chrome/browser/ui/cocoa/dock_icon.mm index f6bf5ae..7b38acb 100644 --- a/chrome/browser/ui/cocoa/dock_icon.mm +++ b/chrome/browser/ui/cocoa/dock_icon.mm @@ -218,7 +218,7 @@ const int64 kUpdateFrequencyMs = 200; } - (void)updateIcon { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); static base::TimeDelta updateFrequency = base::TimeDelta::FromMilliseconds(kUpdateFrequencyMs); @@ -236,7 +236,7 @@ const int64 kUpdateFrequencyMs = 200; } - (void)setDownloads:(int)downloads { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); NSDockTile* dockTile = [[NSApplication sharedApplication] dockTile]; DockTileView* dockTileView = (DockTileView*)([dockTile contentView]); @@ -247,7 +247,7 @@ const int64 kUpdateFrequencyMs = 200; } - (void)setIndeterminate:(BOOL)indeterminate { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); NSDockTile* dockTile = [[NSApplication sharedApplication] dockTile]; DockTileView* dockTileView = (DockTileView*)([dockTile contentView]); @@ -258,7 +258,7 @@ const int64 kUpdateFrequencyMs = 200; } - (void)setProgress:(float)progress { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); NSDockTile* dockTile = [[NSApplication sharedApplication] dockTile]; DockTileView* dockTileView = (DockTileView*)([dockTile contentView]); diff --git a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm index 69f3180..f6fb43a 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm @@ -299,7 +299,7 @@ class ExtensionLoadedNotificationObserver // Override -[BaseBubbleController showWindow:] to tweak bubble location and // set up UI elements. - (void)showWindow:(id)sender { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // Load nib and calculate height based on messages to be shown. NSWindow* window = [self initializeWindow]; diff --git a/chrome/browser/ui/cocoa/login_prompt_cocoa.mm b/chrome/browser/ui/cocoa/login_prompt_cocoa.mm index 4866f22..8f4201e 100644 --- a/chrome/browser/ui/cocoa/login_prompt_cocoa.mm +++ b/chrome/browser/ui/cocoa/login_prompt_cocoa.mm @@ -46,7 +46,7 @@ class LoginHandlerMac : public LoginHandler, virtual void OnAutofillDataAvailable( const base::string16& username, const base::string16& password) OVERRIDE { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); [sheet_controller_ autofillLogin:base::SysUTF16ToNSString(username) password:base::SysUTF16ToNSString(password)]; @@ -57,7 +57,7 @@ class LoginHandlerMac : public LoginHandler, virtual void BuildViewForPasswordManager( PasswordManager* manager, const base::string16& explanation) OVERRIDE { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); sheet_controller_.reset( [[LoginHandlerSheet alloc] initWithLoginHandler:this]); @@ -92,7 +92,7 @@ class LoginHandlerMac : public LoginHandler, // Overridden from ConstrainedWindowMacDelegate: virtual void OnConstrainedWindowClosed( ConstrainedWindowMac* window) OVERRIDE { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); SetModel(NULL); ReleaseSoon(); @@ -102,12 +102,12 @@ class LoginHandlerMac : public LoginHandler, void OnLoginPressed(const base::string16& username, const base::string16& password) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); SetAuth(username, password); } void OnCancelPressed() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); CancelAuth(); } diff --git a/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm b/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm index c7ad387..e1e228a 100644 --- a/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm +++ b/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm @@ -76,7 +76,7 @@ void ShowSSLClientCertificateSelector( const net::HttpNetworkSession* network_session, net::SSLCertRequestInfo* cert_request_info, const SelectCertificateCallback& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // The dialog manages its own lifetime. SSLClientCertificateSelectorCocoa* selector = [[SSLClientCertificateSelectorCocoa alloc] diff --git a/chrome/browser/ui/crypto_module_delegate_nss.cc b/chrome/browser/ui/crypto_module_delegate_nss.cc index f4e90f2..4829a4a 100644 --- a/chrome/browser/ui/crypto_module_delegate_nss.cc +++ b/chrome/browser/ui/crypto_module_delegate_nss.cc @@ -24,7 +24,7 @@ ChromeNSSCryptoModuleDelegate::~ChromeNSSCryptoModuleDelegate() {} bool ChromeNSSCryptoModuleDelegate::InitializeSlot( content::ResourceContext* context, const base::Closure& initialization_complete_callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(!slot_); base::Callback<void(crypto::ScopedPK11Slot)> get_slot_callback; if (!initialization_complete_callback.is_null()) @@ -67,7 +67,7 @@ std::string ChromeNSSCryptoModuleDelegate::RequestPassword( void ChromeNSSCryptoModuleDelegate::ShowDialog(const std::string& slot_name, bool retry) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); ShowCryptoModulePasswordDialog( slot_name, retry, diff --git a/chrome/browser/ui/crypto_module_password_dialog_nss.cc b/chrome/browser/ui/crypto_module_password_dialog_nss.cc index 7c290da..5569fc4 100644 --- a/chrome/browser/ui/crypto_module_password_dialog_nss.cc +++ b/chrome/browser/ui/crypto_module_password_dialog_nss.cc @@ -60,11 +60,11 @@ SlotUnlocker::SlotUnlocker(const net::CryptoModuleList& modules, parent_(parent), callback_(callback), retry_(PR_FALSE) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); } void SlotUnlocker::Start() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); for (; current_ < modules_.size(); ++current_) { if (ShouldShowDialog(modules_[current_].get())) { @@ -127,7 +127,7 @@ void UnlockSlotsIfNecessary(const net::CryptoModuleList& modules, const net::HostPortPair& server, gfx::NativeWindow parent, const base::Closure& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); for (size_t i = 0; i < modules.size(); ++i) { if (ShouldShowDialog(modules[i].get())) { (new SlotUnlocker(modules, reason, server, parent, callback))->Start(); diff --git a/chrome/browser/ui/extensions/extension_install_ui_default.cc b/chrome/browser/ui/extensions/extension_install_ui_default.cc index 6fa1d4a..043d341 100644 --- a/chrome/browser/ui/extensions/extension_install_ui_default.cc +++ b/chrome/browser/ui/extensions/extension_install_ui_default.cc @@ -276,7 +276,7 @@ void ExtensionInstallUIDefault::OnInstallSuccess(const Extension* extension, void ExtensionInstallUIDefault::OnInstallFailure( const extensions::CrxInstallerError& error) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (disable_failure_ui_for_tests() || skip_post_install_ui()) return; diff --git a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc index a9d721d..625b2a8 100644 --- a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc @@ -75,7 +75,7 @@ CreateApplicationShortcutsDialogGtk::CreateApplicationShortcutsDialogGtk( favicon_pixbuf_(NULL), create_dialog_(NULL), error_dialog_(NULL) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // Will be balanced by Release later. AddRef(); @@ -194,7 +194,7 @@ void CreateApplicationShortcutsDialogGtk::CreateDialogBox(GtkWindow* parent) { } CreateApplicationShortcutsDialogGtk::~CreateApplicationShortcutsDialogGtk() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); gtk_widget_destroy(create_dialog_); @@ -206,7 +206,7 @@ CreateApplicationShortcutsDialogGtk::~CreateApplicationShortcutsDialogGtk() { void CreateApplicationShortcutsDialogGtk::OnCreateDialogResponse( GtkWidget* widget, int response) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (response == GTK_RESPONSE_ACCEPT) { ShellIntegration::ShortcutLocations creation_locations; @@ -236,14 +236,14 @@ void CreateApplicationShortcutsDialogGtk::OnErrorDialogResponse( void CreateApplicationShortcutsDialogGtk::CreateDesktopShortcut( const ShellIntegration::ShortcutInfo& shortcut_info, const ShellIntegration::ShortcutLocations& creation_locations) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); ShellIntegrationLinux::CreateDesktopShortcut(shortcut_info, creation_locations); Release(); } void CreateApplicationShortcutsDialogGtk::ShowErrorDialog() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // Hide the create dialog so that the user can no longer interact with it. gtk_widget_hide(create_dialog_); @@ -355,7 +355,7 @@ void CreateChromeApplicationShortcutsDialogGtk::OnShortcutInfoLoaded( void CreateChromeApplicationShortcutsDialogGtk::CreateDesktopShortcut( const ShellIntegration::ShortcutInfo& shortcut_info, const ShellIntegration::ShortcutLocations& creation_locations) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); if (web_app::CreateShortcutsOnFileThread( shortcut_info, creation_locations, diff --git a/chrome/browser/ui/gtk/login_prompt_gtk.cc b/chrome/browser/ui/gtk/login_prompt_gtk.cc index 51b0bf6..194a043 100644 --- a/chrome/browser/ui/gtk/login_prompt_gtk.cc +++ b/chrome/browser/ui/gtk/login_prompt_gtk.cc @@ -51,7 +51,7 @@ class LoginHandlerGtk : public LoginHandler { virtual void OnAutofillDataAvailable( const base::string16& username, const base::string16& password) OVERRIDE { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // NOTE: Would be nice to use gtk_entry_get_text_length, but it is fairly // new and not always in our GTK version. @@ -69,7 +69,7 @@ class LoginHandlerGtk : public LoginHandler { virtual void BuildViewForPasswordManager( PasswordManager* manager, const base::string16& explanation) OVERRIDE { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); root_.reset(gtk_vbox_new(FALSE, ui::kContentAreaBorder)); g_object_ref_sink(root_.get()); @@ -175,7 +175,7 @@ void LoginHandlerGtk::OnCancelClicked(GtkWidget* sender) { void LoginHandlerGtk::OnPromptHierarchyChanged(GtkWidget* sender, GtkWidget* previous_toplevel) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!gtk_widget_is_toplevel(gtk_widget_get_toplevel(ok_))) return; @@ -193,7 +193,7 @@ LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, } void LoginHandlerGtk::OnDestroy(GtkWidget* widget) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // The web contents modal dialog is going to delete itself; clear our pointer. dialog_ = NULL; diff --git a/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc b/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc index 07f6d11..8af6d86 100644 --- a/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc +++ b/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc @@ -397,7 +397,7 @@ void ShowSSLClientCertificateSelector( const net::HttpNetworkSession* network_session, net::SSLCertRequestInfo* cert_request_info, const base::Callback<void(net::X509Certificate*)>& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); (new SSLClientCertificateSelector( contents, network_session, cert_request_info, callback))->Show(); } diff --git a/chrome/browser/ui/gtk/web_contents_modal_dialog_manager_gtk.cc b/chrome/browser/ui/gtk/web_contents_modal_dialog_manager_gtk.cc index 5eba5a9..6d6dc6c 100644 --- a/chrome/browser/ui/gtk/web_contents_modal_dialog_manager_gtk.cc +++ b/chrome/browser/ui/gtk/web_contents_modal_dialog_manager_gtk.cc @@ -122,7 +122,7 @@ class NativeWebContentsModalDialogManagerGtk void NativeWebContentsModalDialogManagerGtk::OnHierarchyChanged( GtkWidget* sender, GtkWidget* previous_toplevel) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (!gtk_widget_is_toplevel(gtk_widget_get_toplevel(sender))) return; @@ -132,7 +132,7 @@ void NativeWebContentsModalDialogManagerGtk::OnHierarchyChanged( void NativeWebContentsModalDialogManagerGtk::OnDestroy( GtkWidget* sender) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (shown_widget_ == sender) { // The containing view may already be destroyed on tab shutdown. diff --git a/chrome/browser/ui/libgtk2ui/app_indicator_icon.cc b/chrome/browser/ui/libgtk2ui/app_indicator_icon.cc index 1586288..7ef1c40 100644 --- a/chrome/browser/ui/libgtk2ui/app_indicator_icon.cc +++ b/chrome/browser/ui/libgtk2ui/app_indicator_icon.cc @@ -262,7 +262,7 @@ void AppIndicatorIcon::RefreshPlatformContextMenu() { } void AppIndicatorIcon::SetImageFromFile(const base::FilePath& icon_file_path) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (icon_file_path.empty()) return; diff --git a/chrome/browser/ui/libgtk2ui/print_dialog_gtk2.cc b/chrome/browser/ui/libgtk2ui/print_dialog_gtk2.cc index 06cb926..ad36c46 100644 --- a/chrome/browser/ui/libgtk2ui/print_dialog_gtk2.cc +++ b/chrome/browser/ui/libgtk2ui/print_dialog_gtk2.cc @@ -120,7 +120,7 @@ class GtkPrinterList { // static printing::PrintDialogGtkInterface* PrintDialogGtk2::CreatePrintDialog( PrintingContextLinux* context) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); return new PrintDialogGtk2(context); } @@ -133,7 +133,7 @@ PrintDialogGtk2::PrintDialogGtk2(PrintingContextLinux* context) } PrintDialogGtk2::~PrintDialogGtk2() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (dialog_) { gtk_widget_destroy(dialog_); @@ -385,7 +385,7 @@ void PrintDialogGtk2::OnResponse(GtkWidget* dialog, int response_id) { void PrintDialogGtk2::SendDocumentToPrinter( const base::string16& document_name) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // If |printer_| is NULL then somehow the GTK printer list changed out under // us. In which case, just bail out. diff --git a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl.cc b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl.cc index 450f2b4..68ff6b8 100644 --- a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl.cc +++ b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl.cc @@ -35,7 +35,7 @@ base::FilePath* SelectFileDialogImpl::last_opened_path_ = NULL; ui::SelectFileDialog* SelectFileDialogImpl::Create( ui::SelectFileDialog::Listener* listener, ui::SelectFilePolicy* policy) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (use_kde_ == UNKNOWN) { // Start out assumimg we are not going to use KDE. use_kde_ = NO_KDE; diff --git a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_kde.cc b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_kde.cc index 784d561..b0c121b 100644 --- a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_kde.cc +++ b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_kde.cc @@ -238,7 +238,7 @@ bool SelectFileDialogImplKDE::HasMultipleFileTypeChoicesImpl() { } std::string SelectFileDialogImplKDE::GetMimeTypeFilterString() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); std::string filter_string; // We need a filter set because the same mime type can appear multiple times. std::set<std::string> filter_set; @@ -265,7 +265,7 @@ std::string SelectFileDialogImplKDE::GetMimeTypeFilterString() { } void SelectFileDialogImplKDE::CallKDialogOutput(const KDialogParams& params) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); CommandLine::StringVector cmd_vector; cmd_vector.push_back(kKdialogBinary); CommandLine command_line(cmd_vector); @@ -441,19 +441,19 @@ void SelectFileDialogImplKDE::SelectSingleFileHelper(const std::string& output, void SelectFileDialogImplKDE::OnSelectSingleFileDialogResponse( const std::string& output, int exit_code, void* params) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); SelectSingleFileHelper(output, exit_code, params, false); } void SelectFileDialogImplKDE::OnSelectSingleFolderDialogResponse( const std::string& output, int exit_code, void* params) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); SelectSingleFileHelper(output, exit_code, params, true); } void SelectFileDialogImplKDE::OnSelectMultiFileDialogResponse( const std::string& output, int exit_code, void* params) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); VLOG(1) << "[kdialog] MultiFileResponse: " << output; if (exit_code != 0 || output.empty()) { diff --git a/chrome/browser/ui/login/login_prompt.cc b/chrome/browser/ui/login/login_prompt.cc index f677f96..92bdd6f 100644 --- a/chrome/browser/ui/login/login_prompt.cc +++ b/chrome/browser/ui/login/login_prompt.cc @@ -123,7 +123,7 @@ void LoginHandler::SetPasswordManager(PasswordManager* password_manager) { } WebContents* LoginHandler::GetWebContentsForLogin() const { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); content::RenderFrameHost* rfh = content::RenderFrameHost::FromID( render_process_host_id_, render_frame_id_); @@ -132,7 +132,7 @@ WebContents* LoginHandler::GetWebContentsForLogin() const { void LoginHandler::SetAuth(const base::string16& username, const base::string16& password) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (TestAndSetAuthHandled()) return; @@ -185,7 +185,7 @@ void LoginHandler::CancelAuth() { void LoginHandler::Observe(int type, const content::NotificationSource& source, const content::NotificationDetails& details) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(type == chrome::NOTIFICATION_AUTH_SUPPLIED || type == chrome::NOTIFICATION_AUTH_CANCELLED); @@ -244,7 +244,7 @@ void LoginHandler::SetModel(LoginModel* model) { } void LoginHandler::NotifyAuthNeeded() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (WasAuthHandled()) return; @@ -282,7 +282,7 @@ void LoginHandler::ReleaseSoon() { } void LoginHandler::AddObservers() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // This is probably OK; we need to listen to everything and we break out of // the Observe() if we aren't handling the same auth_info(). @@ -294,14 +294,14 @@ void LoginHandler::AddObservers() { } void LoginHandler::RemoveObservers() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); registrar_.reset(); } void LoginHandler::NotifyAuthSupplied(const base::string16& username, const base::string16& password) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(WasAuthHandled()); WebContents* requesting_contents = GetWebContentsForLogin(); @@ -321,7 +321,7 @@ void LoginHandler::NotifyAuthSupplied(const base::string16& username, } void LoginHandler::NotifyAuthCancelled() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(WasAuthHandled()); content::NotificationService* service = @@ -350,7 +350,7 @@ bool LoginHandler::TestAndSetAuthHandled() { // Calls SetAuth from the IO loop. void LoginHandler::SetAuthDeferred(const base::string16& username, const base::string16& password) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (request_) { request_->SetAuth(net::AuthCredentials(username, password)); @@ -360,7 +360,7 @@ void LoginHandler::SetAuthDeferred(const base::string16& username, // Calls CancelAuth from the IO loop. void LoginHandler::CancelAuthDeferred() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (request_) { request_->CancelAuth(); @@ -372,7 +372,7 @@ void LoginHandler::CancelAuthDeferred() { // Closes the view_contents from the UI loop. void LoginHandler::CloseContentsDeferred() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); CloseDialog(); } diff --git a/chrome/browser/ui/metro_pin_tab_helper_win.cc b/chrome/browser/ui/metro_pin_tab_helper_win.cc index 15a47e2..311acbb 100644 --- a/chrome/browser/ui/metro_pin_tab_helper_win.cc +++ b/chrome/browser/ui/metro_pin_tab_helper_win.cc @@ -179,7 +179,7 @@ PinPageTaskRunner::PinPageTaskRunner(const base::string16& title, favicon_(favicon) {} void PinPageTaskRunner::Run() { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); content::BrowserThread::PostTask( content::BrowserThread::FILE, @@ -188,7 +188,7 @@ void PinPageTaskRunner::Run() { } void PinPageTaskRunner::RunOnFileThread() { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); base::string16 tile_id = GenerateTileId(url_); base::FilePath logo_dir = GetTileImagesDir(); @@ -277,7 +277,7 @@ MetroPinTabHelper::FaviconChooser::FaviconChooser( best_candidate_(history_bitmap) {} void MetroPinTabHelper::FaviconChooser::UseChosenCandidate() { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); scoped_refptr<PinPageTaskRunner> runner( new PinPageTaskRunner(title_, url_, best_candidate_)); runner->Run(); @@ -290,7 +290,7 @@ void MetroPinTabHelper::FaviconChooser::UpdateCandidate( const std::vector<SkBitmap>& bitmaps) { const int kMaxIconSize = 32; - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); std::set<int>::iterator iter = in_progress_requests_.find(id); // Check that this request is one of ours. diff --git a/chrome/browser/ui/network_profile_bubble.cc b/chrome/browser/ui/network_profile_bubble.cc index b611d59b..736f7f41 100644 --- a/chrome/browser/ui/network_profile_bubble.cc +++ b/chrome/browser/ui/network_profile_bubble.cc @@ -1,4 +1,5 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/ui/network_profile_bubble.h" @@ -90,7 +91,7 @@ bool NetworkProfileBubble::ShouldCheckNetworkProfile(Profile* profile) { // static void NetworkProfileBubble::CheckNetworkProfile( const base::FilePath& profile_folder) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); // On Windows notify the users if their profiles are located on a network // share as we don't officially support this setup yet. // However we don't want to bother users on Cytrix setups as those have no diff --git a/chrome/browser/ui/sync/one_click_signin_helper.cc b/chrome/browser/ui/sync/one_click_signin_helper.cc index ba1b097..957d7b3 100644 --- a/chrome/browser/ui/sync/one_click_signin_helper.cc +++ b/chrome/browser/ui/sync/one_click_signin_helper.cc @@ -783,7 +783,7 @@ bool OneClickSigninHelper::CanOffer(content::WebContents* web_contents, CanOfferFor can_offer_for, const std::string& email, std::string* error_message) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); VLOG(1) << "OneClickSigninHelper::CanOffer"; if (error_message) @@ -1058,7 +1058,7 @@ void OneClickSigninHelper::ShowInfoBarUIThread( const GURL& continue_url, int child_id, int route_id) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); content::WebContents* web_contents = tab_util::GetWebContentsByID(child_id, route_id); diff --git a/chrome/browser/ui/views/app_list/win/app_list_service_win.cc b/chrome/browser/ui/views/app_list/win/app_list_service_win.cc index b445d0b..9783c8e 100644 --- a/chrome/browser/ui/views/app_list/win/app_list_service_win.cc +++ b/chrome/browser/ui/views/app_list/win/app_list_service_win.cc @@ -206,7 +206,7 @@ void CreateAppListShortcuts( const base::FilePath& user_data_dir, const base::string16& app_model_id, const ShellIntegration::ShortcutLocations& creation_locations) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); // Shortcut paths under which to create shortcuts. std::vector<base::FilePath> shortcut_paths = diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc b/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc index 44bc4d8..18b5b82 100644 --- a/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc +++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc @@ -90,7 +90,7 @@ void ChromeNativeAppWindowViewsWin::ActivateParentDesktopIfNecessary() { void ChromeNativeAppWindowViewsWin::OnShortcutInfoLoaded( const ShellIntegration::ShortcutInfo& shortcut_info) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); HWND hwnd = GetNativeAppWindowHWND(); diff --git a/chrome/browser/ui/views/download/download_danger_prompt_views.cc b/chrome/browser/ui/views/download/download_danger_prompt_views.cc index 233503f..1fad5d7 100644 --- a/chrome/browser/ui/views/download/download_danger_prompt_views.cc +++ b/chrome/browser/ui/views/download/download_danger_prompt_views.cc @@ -169,7 +169,7 @@ base::string16 DownloadDangerPromptViews::GetWindowTitle() const { } void DownloadDangerPromptViews::DeleteDelegate() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); delete this; } @@ -183,21 +183,21 @@ ui::ModalType DownloadDangerPromptViews::GetModalType() const { } bool DownloadDangerPromptViews::Cancel() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); RunDone(CANCEL); return true; } bool DownloadDangerPromptViews::Accept() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); RunDone(ACCEPT); return true; } bool DownloadDangerPromptViews::Close() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); RunDone(DISMISS); return true; diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc index 180d47e..f9eabf6 100644 --- a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc +++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc @@ -386,7 +386,7 @@ void ShowExtensionInstallDialogImpl( const ExtensionInstallPrompt::ShowParams& show_params, ExtensionInstallPrompt::Delegate* delegate, const ExtensionInstallPrompt::Prompt& prompt) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); CreateBrowserModalDialogViews( new ExtensionInstallDialogView(show_params.navigator, delegate, prompt), show_params.parent_window)->Show(); diff --git a/chrome/browser/ui/views/login_prompt_views.cc b/chrome/browser/ui/views/login_prompt_views.cc index af77e99..651926d 100644 --- a/chrome/browser/ui/views/login_prompt_views.cc +++ b/chrome/browser/ui/views/login_prompt_views.cc @@ -65,7 +65,7 @@ class LoginHandlerViews : public LoginHandler, } virtual void WindowClosing() OVERRIDE { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); WebContents* tab = GetWebContentsForLogin(); if (tab) @@ -78,7 +78,7 @@ class LoginHandlerViews : public LoginHandler, } virtual void DeleteDelegate() OVERRIDE { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // The widget is going to delete itself; clear our pointer. dialog_ = NULL; @@ -96,14 +96,14 @@ class LoginHandlerViews : public LoginHandler, } virtual bool Cancel() OVERRIDE { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); CancelAuth(); return true; } virtual bool Accept() OVERRIDE { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); SetAuth(login_view_->GetUsername(), login_view_->GetPassword()); return true; @@ -128,7 +128,7 @@ class LoginHandlerViews : public LoginHandler, virtual void BuildViewForPasswordManager( PasswordManager* manager, const base::string16& explanation) OVERRIDE { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // Create a new LoginView and set the model for it. The model (password // manager) is owned by the WebContents, but the view is parented to the diff --git a/chrome/browser/ui/views/ssl_client_certificate_selector.cc b/chrome/browser/ui/views/ssl_client_certificate_selector.cc index 991bc94..7dfcc4a 100644 --- a/chrome/browser/ui/views/ssl_client_certificate_selector.cc +++ b/chrome/browser/ui/views/ssl_client_certificate_selector.cc @@ -309,7 +309,7 @@ void ShowSSLClientCertificateSelector( net::SSLCertRequestInfo* cert_request_info, const chrome::SelectCertificateCallback& callback) { DVLOG(1) << __FUNCTION__ << " " << contents; - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); (new SSLClientCertificateSelector( contents, network_session, cert_request_info, callback))->Init(); } diff --git a/chrome/browser/ui/web_applications/web_app_ui.cc b/chrome/browser/ui/web_applications/web_app_ui.cc index 596764b..759491a 100644 --- a/chrome/browser/ui/web_applications/web_app_ui.cc +++ b/chrome/browser/ui/web_applications/web_app_ui.cc @@ -144,7 +144,7 @@ void UpdateShortcutWorker::Observe( void UpdateShortcutWorker::DownloadIcon() { // FetchIcon must run on UI thread because it relies on WebContents // to download the icon. - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (web_contents_ == NULL) { DeleteMe(); // We are done if underlying WebContents is gone. @@ -202,7 +202,7 @@ void UpdateShortcutWorker::DidDownloadFavicon( } void UpdateShortcutWorker::CheckExistingShortcuts() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); // Locations to check to shortcut_paths. struct { @@ -249,7 +249,7 @@ void UpdateShortcutWorker::UpdateShortcuts() { } void UpdateShortcutWorker::UpdateShortcutsOnFileThread() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); base::FilePath web_app_path = web_app::GetWebAppDataDirectory( profile_path_, shortcut_info_.extension_id, shortcut_info_.url); @@ -309,7 +309,7 @@ void UpdateShortcutWorker::DeleteMe() { } void UpdateShortcutWorker::DeleteMeOnUIThread() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); delete this; } #endif // defined(OS_WIN) 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); |