Commit 536ccb0c authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Migrate off base::ThreadPool()-as-a-trait in /chrome/browser/chromeos/printing

This CL is a logical no-op.

It manually covers the use cases the script
(https://crbug.com/1026641#c22) didn't cover in
https://chromium-review.googlesource.com/c/chromium/src/+/2026350.

A few of the affected files were also migrated to
content::GetUIThreadTaskRunner() whenever surrounding code consistency
was at stake (but the bulk of that migration is staged to happen after
this one so this wasn't a priority in this batch).

Most files intentionally kept base/task/post_task.h as an include. It is
still required because of a cyclical dependency during the migration
preventing base/task/thread_pool.h from implicitly providing
base/task/task_traits.h to its users (callers that explicitly store
TaskTraits and include task_traits.h don't have this problem). The
post_task.h include will be cleaned up in a later phase.

This CL was uploaded by git cl split.

R=luum@chromium.org

Bug: 1026641
Change-Id: Ic6135c8097475da7f2fa19c33b317156c424223d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078668Reviewed-by: default avatarLuum Habtemariam <luum@chromium.org>
Commit-Queue: Luum Habtemariam <luum@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745649}
parent 23e8ffcb
......@@ -13,6 +13,7 @@
#include "base/strings/string_util.h"
#include "base/task/post_task.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/task_runner_util.h"
#include "base/version.h"
#include "chrome/browser/chromeos/printing/printer_info.h"
......@@ -203,10 +204,8 @@ void QueryIppPrinter(const std::string& host,
// QueryPrinterImpl could block on a network call for a noticable amount of
// time (100s of ms). Also the user is waiting on this result. Thus, run at
// USER_VISIBLE with MayBlock.
base::PostTaskAndReplyWithResult(
FROM_HERE,
base::TaskTraits{base::ThreadPool(), base::TaskPriority::USER_VISIBLE,
base::MayBlock()},
base::ThreadPool::PostTaskAndReplyWithResult(
FROM_HERE, {base::TaskPriority::USER_VISIBLE, base::MayBlock()},
base::BindOnce(&QueryPrinterImpl, host, port, path, encrypted),
base::BindOnce(&OnPrinterQueried, std::move(callback)));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment