Commit 5f5140b6 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Migrate off base::ThreadPool()-as-a-trait in /content/common/mac/font_loader.mm

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=mark@chromium.org

Bug: 1026641
Change-Id: I32abc8694280a33819067901636915b2be5f12dd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078421
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: default avatarMark Mentovai <mark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745582}
parent 2f734e25
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
#include "base/mac/scoped_cftyperef.h" #include "base/mac/scoped_cftyperef.h"
#import "base/mac/scoped_nsobject.h" #import "base/mac/scoped_nsobject.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "base/task/post_task.h" #include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/threading/scoped_blocking_call.h" #include "base/threading/scoped_blocking_call.h"
namespace content { namespace content {
...@@ -132,9 +133,9 @@ void FontLoader::LoadFont(const base::string16& font_name, ...@@ -132,9 +133,9 @@ void FontLoader::LoadFont(const base::string16& font_name,
// a user installing a third-party font manager. See crbug.com/72727. Web page // a user installing a third-party font manager. See crbug.com/72727. Web page
// rendering can't continue until a font is returned. // rendering can't continue until a font is returned.
constexpr base::TaskTraits kTraits = { constexpr base::TaskTraits kTraits = {
base::ThreadPool(), base::MayBlock(), base::TaskPriority::USER_VISIBLE, base::MayBlock(), base::TaskPriority::USER_VISIBLE,
base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}; base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN};
base::PostTaskAndReplyWithResult( base::ThreadPool::PostTaskAndReplyWithResult(
FROM_HERE, kTraits, FROM_HERE, kTraits,
base::BindOnce(&LoadFontOnFileThread, font_name, font_point_size), base::BindOnce(&LoadFontOnFileThread, font_name, font_point_size),
base::BindOnce(&ReplyOnUIThread, std::move(callback))); base::BindOnce(&ReplyOnUIThread, 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