Commit 8b9ba718 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Migrate off base::ThreadPool()-as-a-trait in /components/autofill/core/browser

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=parastoog@google.com

Bug: 1026641
Change-Id: I453fd810f52952b893ab9da89db9eee36f8ceeb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078667
Commit-Queue: Gabriel Charette <gab@chromium.org>
Commit-Queue: Parastoo Geranmayeh <parastoog@google.com>
Reviewed-by: default avatarParastoo Geranmayeh <parastoog@google.com>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745724}
parent 43f1394b
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "components/autofill/core/browser/autocomplete_history_manager.h" #include "components/autofill/core/browser/autocomplete_history_manager.h"
...@@ -723,7 +724,7 @@ bool AutofillManager::MaybeStartVoteUploadProcess( ...@@ -723,7 +724,7 @@ bool AutofillManager::MaybeStartVoteUploadProcess(
// so that we can safely pass the address to the first callback regardless of // so that we can safely pass the address to the first callback regardless of
// the (undefined) order in which the callback parameters are computed. // the (undefined) order in which the callback parameters are computed.
FormStructure* raw_form = form_structure.get(); FormStructure* raw_form = form_structure.get();
base::PostTaskAndReply( base::ThreadPool::PostTaskAndReply(
FROM_HERE, FROM_HERE,
// If the priority is BEST_EFFORT, the task can be preempted, which is // If the priority is BEST_EFFORT, the task can be preempted, which is
// thought to cause high memory usage (as memory is retained by the task // thought to cause high memory usage (as memory is retained by the task
...@@ -733,7 +734,7 @@ bool AutofillManager::MaybeStartVoteUploadProcess( ...@@ -733,7 +734,7 @@ bool AutofillManager::MaybeStartVoteUploadProcess(
// USER_VISIBLE instead of BEST_EFFORT fixes memory usage. Consider // USER_VISIBLE instead of BEST_EFFORT fixes memory usage. Consider
// keeping BEST_EFFORT priority, but manually enforcing a limit on the // keeping BEST_EFFORT priority, but manually enforcing a limit on the
// number of outstanding tasks. https://crbug.com/974249 // number of outstanding tasks. https://crbug.com/974249
{base::ThreadPool(), base::MayBlock(), base::TaskPriority::USER_VISIBLE}, {base::MayBlock(), base::TaskPriority::USER_VISIBLE},
base::BindOnce(&AutofillManager::DeterminePossibleFieldTypesForUpload, base::BindOnce(&AutofillManager::DeterminePossibleFieldTypesForUpload,
copied_profiles, copied_credit_cards, copied_profiles, copied_credit_cards,
last_unlocked_credit_card_cvc_, app_locale_, raw_form), last_unlocked_credit_card_cvc_, app_locale_, raw_form),
......
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