Commit 61811e0a authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

[base] Make PostTask destination explicit in /content/renderer

Task APIs v3 will all have an explicit destination. In the past
"default traits" meant ThreadPool. These CLs are thus a no-op
except for the few callers that clearly wanted to post a QuitClosure()
on the current thread (posting a QuitClosure() to a parallel task will
merely bounce it back to the current thread anyways). Those few callers
were migrated to ThreadTaskRunnerHandle::Get().

These changes are thus required to phase out task APIs v2 (post_task.h)
Design doc: https://docs.google.com/document/d/1tssusPykvx3g0gvbvU4HxGyn3MjJlIylnsH13-Tv6s4/edit

This specific change is a subset of
https://chromium-review.googlesource.com/c/chromium/src/+/2216733

This CL was uploaded by git cl split.

R=dcheng@chromium.org

Bug: 1026641
Change-Id: Ifcae70690c28466e17c93ea1b122dc8c48f205f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2217208
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772637}
parent 76f55708
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "base/stl_util.h" #include "base/stl_util.h"
#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/test/bind_test_util.h" #include "base/test/bind_test_util.h"
#include "base/test/gmock_callback_support.h" #include "base/test/gmock_callback_support.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
...@@ -1547,7 +1546,8 @@ TEST_F(RenderViewImplTest, EditContextGetLayoutBoundsAndInputPanelPolicy) { ...@@ -1547,7 +1546,8 @@ TEST_F(RenderViewImplTest, EditContextGetLayoutBoundsAndInputPanelPolicy) {
// This RunLoop is waiting for EditContext to be created and layout bounds // This RunLoop is waiting for EditContext to be created and layout bounds
// to be updated in the EditContext. // to be updated in the EditContext.
base::RunLoop run_loop; base::RunLoop run_loop;
base::PostTask(FROM_HERE, run_loop.QuitClosure()); base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
run_loop.QuitClosure());
run_loop.Run(); run_loop.Run();
// Update the IME status and verify if our IME backend sends an IPC message // Update the IME status and verify if our IME backend sends an IPC message
...@@ -1591,7 +1591,8 @@ TEST_F(RenderViewImplTest, EditContextGetLayoutBoundsWithFloatingValues) { ...@@ -1591,7 +1591,8 @@ TEST_F(RenderViewImplTest, EditContextGetLayoutBoundsWithFloatingValues) {
// This RunLoop is waiting for EditContext to be created and layout bounds // This RunLoop is waiting for EditContext to be created and layout bounds
// to be updated in the EditContext. // to be updated in the EditContext.
base::RunLoop run_loop; base::RunLoop run_loop;
base::PostTask(FROM_HERE, run_loop.QuitClosure()); base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
run_loop.QuitClosure());
run_loop.Run(); run_loop.Run();
// Update the IME status and verify if our IME backend sends an IPC message // Update the IME status and verify if our IME backend sends an IPC message
// to notify layout bounds of the EditContext. // to notify layout bounds of the EditContext.
...@@ -1629,7 +1630,8 @@ TEST_F(RenderViewImplTest, ActiveElementGetLayoutBounds) { ...@@ -1629,7 +1630,8 @@ TEST_F(RenderViewImplTest, ActiveElementGetLayoutBounds) {
ExecuteJavaScriptForTests("document.getElementById('test').focus();"); ExecuteJavaScriptForTests("document.getElementById('test').focus();");
// This RunLoop is waiting for focus to be processed for the active element. // This RunLoop is waiting for focus to be processed for the active element.
base::RunLoop run_loop; base::RunLoop run_loop;
base::PostTask(FROM_HERE, run_loop.QuitClosure()); base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
run_loop.QuitClosure());
run_loop.Run(); run_loop.Run();
// Update the IME status and verify if our IME backend sends an IPC message // Update the IME status and verify if our IME backend sends an IPC message
// to notify layout bounds of the EditContext. // to notify layout bounds of the EditContext.
......
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