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 10ebf3b74831db495af773c9d3aba5ef244d9bda..83af691a6fa6da3fa73ba1567dd76ec29ffe9afe 100644 |
--- a/chrome/browser/ui/views/chrome_views_delegate.cc |
+++ b/chrome/browser/ui/views/chrome_views_delegate.cc |
@@ -12,6 +12,7 @@ |
#include "base/single_thread_task_runner.h" |
#include "base/strings/string_util.h" |
#include "base/strings/utf_string_conversions.h" |
+#include "base/task_scheduler/post_task.h" |
#include "base/threading/sequenced_worker_pool.h" |
#include "base/threading/thread_task_runner_handle.h" |
#include "base/time/time.h" |
@@ -43,7 +44,6 @@ |
#include <dwmapi.h> |
#include <shellapi.h> |
#include "base/profiler/scoped_tracker.h" |
-#include "base/task_runner_util.h" |
#include "base/win/windows_version.h" |
#include "chrome/browser/win/app_icon.h" |
#include "ui/base/win/shell.h" |
@@ -506,15 +506,14 @@ int ChromeViewsDelegate::GetAppbarAutohideEdges(HMONITOR monitor, |
// spins a modal loop which could cause callers to be reentered. To avoid |
// that we retrieve the taskbar state in a worker thread. |
if (monitor && !in_autohide_edges_callback_) { |
- base::PostTaskAndReplyWithResult( |
- content::BrowserThread::GetBlockingPool(), |
- FROM_HERE, |
- base::Bind(&GetAppbarAutohideEdgesOnWorkerThread, |
- monitor), |
+ // TODO(robliao): Annotate this task with .WithCOM() once supported. |
+ // https://crbug.com/662122 |
fdoray
2017/02/17 20:47:23
Currently, all TaskScheduler threads are CoInitial
|
+ base::PostTaskWithTraitsAndReplyWithResult( |
+ FROM_HERE, base::TaskTraits().MayBlock().WithPriority( |
+ base::TaskPriority::USER_BLOCKING), |
+ base::Bind(&GetAppbarAutohideEdgesOnWorkerThread, monitor), |
base::Bind(&ChromeViewsDelegate::OnGotAppbarAutohideEdges, |
- weak_factory_.GetWeakPtr(), |
- callback, |
- monitor, |
+ weak_factory_.GetWeakPtr(), callback, monitor, |
appbar_autohide_edge_map_[monitor])); |
} |
return appbar_autohide_edge_map_[monitor]; |