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

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

Issue 2670353003: Use TaskScheduler instead of blocking pool in chrome_views_delegate.cc. (Closed)
Patch Set: USER_BLOCKING Created 3 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698