diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-20 08:59:52 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-20 08:59:52 +0000 |
commit | 9d434e21296a0e506552e3a660101efa3403a2fe (patch) | |
tree | 803c1135d85c4f2cfd461f8cff4b59ba155c3da1 /chrome | |
parent | b52692395da5bc509a76cb88aa6cb456eda3a82e (diff) | |
download | chromium_src-9d434e21296a0e506552e3a660101efa3403a2fe.zip chromium_src-9d434e21296a0e506552e3a660101efa3403a2fe.tar.gz chromium_src-9d434e21296a0e506552e3a660101efa3403a2fe.tar.bz2 |
Removes MessageLoop::Type checks in favor of IsCurrent on MessageLoops.
This is part of removing the MessageLoop::Type enum.
BUG=none
TEST=none
R=darin@chromium.org
Review URL: https://codereview.chromium.org/141683005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245882 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/chrome_browser_main.cc | 2 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/screen_locker.cc | 8 | ||||
-rw-r--r-- | chrome/browser/external_protocol/external_protocol_handler.cc | 6 | ||||
-rw-r--r-- | chrome/browser/jankometer.cc | 4 | ||||
-rw-r--r-- | chrome/browser/printing/print_job.cc | 2 | ||||
-rw-r--r-- | chrome/browser/printing/printer_query.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/external_protocol_dialog.mm | 2 | ||||
-rw-r--r-- | chrome/browser/ui/gtk/protocol_dialog_gtk.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/views/uninstall_view.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/views/user_data_dir_dialog_view.cc | 2 | ||||
-rw-r--r-- | chrome/test/chromedriver/chrome/adb_impl.cc | 2 |
11 files changed, 17 insertions, 17 deletions
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index cb17608..a0640ad 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc @@ -1576,7 +1576,7 @@ bool ChromeBrowserMainParts::MainMessageLoopRun(int* result_code) { startup_timer_->SignalStartupComplete( performance_monitor::StartupTimer::STARTUP_NORMAL); - DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); + DCHECK(base::MessageLoopForUI::IsCurrent()); #if !defined(USE_AURA) && defined(TOOLKIT_VIEWS) views::AcceleratorHandler accelerator_handler; base::RunLoop run_loop(&accelerator_handler); diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc index f91a742..1383912 100644 --- a/chrome/browser/chromeos/login/screen_locker.cc +++ b/chrome/browser/chromeos/login/screen_locker.cc @@ -247,7 +247,7 @@ void ScreenLocker::OnLoginSuccess(const UserContext& user_context) { } void ScreenLocker::UnlockOnLoginSuccess() { - DCHECK(base::MessageLoop::current()->type() == base::MessageLoop::TYPE_UI); + DCHECK(base::MessageLoopForUI::IsCurrent()); if (!authentication_capture_.get()) { LOG(WARNING) << "Call to UnlockOnLoginSuccess without previous " << "authentication success."; @@ -339,7 +339,7 @@ void ScreenLocker::SetLoginStatusConsumer( // static void ScreenLocker::Show() { content::RecordAction(UserMetricsAction("ScreenLocker_Show")); - DCHECK(base::MessageLoop::current()->type() == base::MessageLoop::TYPE_UI); + DCHECK(base::MessageLoopForUI::IsCurrent()); // Check whether the currently logged in user is a guest account and if so, // refuse to lock the screen (crosbug.com/23764). @@ -376,7 +376,7 @@ void ScreenLocker::Show() { // static void ScreenLocker::Hide() { - DCHECK(base::MessageLoop::current()->type() == base::MessageLoop::TYPE_UI); + DCHECK(base::MessageLoopForUI::IsCurrent()); // For a guest/demo user, screen_locker_ would have never been initialized. if (UserManager::Get()->IsLoggedInAsGuest() || UserManager::Get()->IsLoggedInAsDemoUser()) { @@ -413,7 +413,7 @@ void ScreenLocker::InitClass() { ScreenLocker::~ScreenLocker() { VLOG(1) << "Destroying ScreenLocker " << this; - DCHECK(base::MessageLoop::current()->type() == base::MessageLoop::TYPE_UI); + DCHECK(base::MessageLoopForUI::IsCurrent()); if (authenticator_.get()) authenticator_->SetConsumer(NULL); diff --git a/chrome/browser/external_protocol/external_protocol_handler.cc b/chrome/browser/external_protocol/external_protocol_handler.cc index 752949a..b414261 100644 --- a/chrome/browser/external_protocol/external_protocol_handler.cc +++ b/chrome/browser/external_protocol/external_protocol_handler.cc @@ -103,7 +103,7 @@ class ExternalDefaultProtocolObserver virtual void SetDefaultWebClientUIState( ShellIntegration::DefaultWebClientUIState state) OVERRIDE { - DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); + DCHECK(base::MessageLoopForUI::IsCurrent()); // If we are still working out if we're the default, or we've found // out we definately are the default, we end here. @@ -256,7 +256,7 @@ void ExternalProtocolHandler::LaunchUrlWithDelegate(const GURL& url, int render_process_host_id, int tab_contents_id, Delegate* delegate) { - DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); + DCHECK(base::MessageLoopForUI::IsCurrent()); // Escape the input scheme to be sure that the command does not // have parameters unexpected by the external program. @@ -311,6 +311,6 @@ void ExternalProtocolHandler::RegisterPrefs(PrefRegistrySimple* registry) { // static void ExternalProtocolHandler::PermitLaunchUrl() { - DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); + DCHECK(base::MessageLoopForUI::IsCurrent()); g_accept_requests = true; } diff --git a/chrome/browser/jankometer.cc b/chrome/browser/jankometer.cc index a5d841d..a159064 100644 --- a/chrome/browser/jankometer.cc +++ b/chrome/browser/jankometer.cc @@ -280,14 +280,14 @@ class UIJankObserver : public base::RefCountedThreadSafe<UIJankObserver>, // attach to the current thread, so this function can be invoked on another // thread to attach it. void AttachToCurrentThread() { - DCHECK_EQ(base::MessageLoop::current()->type(), base::MessageLoop::TYPE_UI); + DCHECK(base::MessageLoopForUI::IsCurrent()); base::MessageLoopForUI::current()->AddObserver(this); base::MessageLoop::current()->AddTaskObserver(this); } // Detaches the observer to the current thread's message loop. void DetachFromCurrentThread() { - DCHECK_EQ(base::MessageLoop::current()->type(), base::MessageLoop::TYPE_UI); + DCHECK(base::MessageLoopForUI::IsCurrent()); base::MessageLoop::current()->RemoveTaskObserver(this); base::MessageLoopForUI::current()->RemoveObserver(this); } diff --git a/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc index ae5a4fd..a899b17 100644 --- a/chrome/browser/printing/print_job.cc +++ b/chrome/browser/printing/print_job.cc @@ -44,7 +44,7 @@ PrintJob::PrintJob() DCHECK(ui_message_loop_); // This is normally a UI message loop, but in unit tests, the message loop is // of the 'default' type. - DCHECK(ui_message_loop_->type() == base::MessageLoop::TYPE_UI || + DCHECK(base::MessageLoopForUI::IsCurrent() || ui_message_loop_->type() == base::MessageLoop::TYPE_DEFAULT); ui_message_loop_->AddDestructionObserver(this); } diff --git a/chrome/browser/printing/printer_query.cc b/chrome/browser/printing/printer_query.cc index d05900e..6770e57 100644 --- a/chrome/browser/printing/printer_query.cc +++ b/chrome/browser/printing/printer_query.cc @@ -20,7 +20,7 @@ PrinterQuery::PrinterQuery() is_print_dialog_box_shown_(false), cookie_(PrintSettings::NewCookie()), last_status_(PrintingContext::FAILED) { - DCHECK_EQ(io_message_loop_->type(), base::MessageLoop::TYPE_IO); + DCHECK(base::MessageLoopForIO::IsCurrent()); } PrinterQuery::~PrinterQuery() { diff --git a/chrome/browser/ui/cocoa/external_protocol_dialog.mm b/chrome/browser/ui/cocoa/external_protocol_dialog.mm index e497d86..16332fd 100644 --- a/chrome/browser/ui/cocoa/external_protocol_dialog.mm +++ b/chrome/browser/ui/cocoa/external_protocol_dialog.mm @@ -40,7 +40,7 @@ void ExternalProtocolHandler::RunExternalProtocolDialog( - (id)initWithGURL:(const GURL*)url renderProcessHostId:(int)renderProcessHostId routingId:(int)routingId { - DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); + DCHECK(base::MessageLoopForUI::IsCurrent()); if (!(self = [super init])) return nil; diff --git a/chrome/browser/ui/gtk/protocol_dialog_gtk.cc b/chrome/browser/ui/gtk/protocol_dialog_gtk.cc index f982d3a..b5d0209 100644 --- a/chrome/browser/ui/gtk/protocol_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/protocol_dialog_gtk.cc @@ -44,7 +44,7 @@ ProtocolDialogGtk::ProtocolDialogGtk( scoped_ptr<const ProtocolDialogDelegate> delegate) : delegate_(delegate.Pass()), creation_time_(base::TimeTicks::Now()) { - DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); + DCHECK(base::MessageLoopForUI::IsCurrent()); dialog_ = gtk_dialog_new_with_buttons( base::UTF16ToUTF8(delegate_->GetTitleText()).c_str(), diff --git a/chrome/browser/ui/views/uninstall_view.cc b/chrome/browser/ui/views/uninstall_view.cc index d97741a..f640cfe 100644 --- a/chrome/browser/ui/views/uninstall_view.cc +++ b/chrome/browser/ui/views/uninstall_view.cc @@ -169,7 +169,7 @@ base::string16 UninstallView::GetItemAt(int index) { namespace chrome { int ShowUninstallBrowserPrompt(bool show_delete_profile) { - DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); + DCHECK(base::MessageLoopForUI::IsCurrent()); int result = content::RESULT_CODE_NORMAL_EXIT; views::AcceleratorHandler accelerator_handler; diff --git a/chrome/browser/ui/views/user_data_dir_dialog_view.cc b/chrome/browser/ui/views/user_data_dir_dialog_view.cc index 2288ddd..6effe52 100644 --- a/chrome/browser/ui/views/user_data_dir_dialog_view.cc +++ b/chrome/browser/ui/views/user_data_dir_dialog_view.cc @@ -103,7 +103,7 @@ void UserDataDirDialogView::FileSelectionCanceled(void* params) { namespace chrome { base::FilePath ShowUserDataDirDialog(const base::FilePath& user_data_dir) { - DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); + DCHECK(base::MessageLoopForUI::IsCurrent()); // When the window closes, it will delete itself. UserDataDirDialogView* dialog = new UserDataDirDialogView(user_data_dir); views::DialogDelegate::CreateDialogWidget(dialog, NULL, NULL)->Show(); diff --git a/chrome/test/chromedriver/chrome/adb_impl.cc b/chrome/test/chromedriver/chrome/adb_impl.cc index 0fa1478..c4a38f8 100644 --- a/chrome/test/chromedriver/chrome/adb_impl.cc +++ b/chrome/test/chromedriver/chrome/adb_impl.cc @@ -64,7 +64,7 @@ class ResponseBuffer : public base::RefCountedThreadSafe<ResponseBuffer> { void ExecuteCommandOnIOThread( const std::string& command, scoped_refptr<ResponseBuffer> response_buffer, int port) { - CHECK(base::MessageLoop::current()->IsType(base::MessageLoop::TYPE_IO)); + CHECK(base::MessageLoopForIO::IsCurrent()); AdbClientSocket::AdbQuery(port, command, base::Bind(&ResponseBuffer::OnResponse, response_buffer)); } |