Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1213)

Unified Diff: chrome/browser/ui/views/chrome_views_delegate.cc

Issue 2375663002: Replace MessageLoop::current()->task_runner() with ThreadTaskRunnerHandle::Get(). (Closed)
Patch Set: rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/chrome_views_delegate.cc
diff --git a/chrome/browser/ui/views/chrome_views_delegate.cc b/chrome/browser/ui/views/chrome_views_delegate.cc
index 7e14f716b79fa46fe11904417152b812532d0be1..470b548cbae0b6c2a37696002827a6ad579ff9d6 100644
--- a/chrome/browser/ui/views/chrome_views_delegate.cc
+++ b/chrome/browser/ui/views/chrome_views_delegate.cc
@@ -7,10 +7,12 @@
#include <memory>
#include "base/location.h"
+#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
@@ -272,6 +274,8 @@ views::ViewsDelegate::ProcessMenuAcceleratorResult
ChromeViewsDelegate::ProcessAcceleratorWhileMenuShowing(
const ui::Accelerator& accelerator) {
#if defined(USE_ASH)
+ DCHECK(base::MessageLoopForUI::IsCurrent());
+
// Early return because mash chrome does not have access to ash::Shell
if (chrome::IsRunningInMash())
return views::ViewsDelegate::ProcessMenuAcceleratorResult::LEAVE_MENU_OPEN;
@@ -283,7 +287,7 @@ ChromeViewsDelegate::ProcessAcceleratorWhileMenuShowing(
accelerator);
if (accelerator_controller->ShouldCloseMenuAndRepostAccelerator(
accelerator)) {
- base::MessageLoopForUI::current()->task_runner()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(ProcessAcceleratorNow, accelerator));
return views::ViewsDelegate::ProcessMenuAcceleratorResult::CLOSE_MENU;
}
« no previous file with comments | « chrome/browser/ui/ash/media_delegate_chromeos.cc ('k') | chrome/browser/ui/views/menu_model_adapter_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698