Commit a7e56442 authored by Hajime Hoshi's avatar Hajime Hoshi Committed by Commit Bot

Use appropriate tasks at RenderWidgetCompositor

This is part of efforts to replace base::ThreadTaskRunnerHandle::Get()
with other appropriate task runners in the renderer.

Bug: 786332
Change-Id: Ic63ac5a7cef4546603ec211c81fa64c49595cee2
Reviewed-on: https://chromium-review.googlesource.com/805576Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521614}
parent 32786661
...@@ -1010,7 +1010,7 @@ void RenderWidgetCompositor::LayoutAndPaintAsync( ...@@ -1010,7 +1010,7 @@ void RenderWidgetCompositor::LayoutAndPaintAsync(
layout_and_paint_async_callback_ = callback; layout_and_paint_async_callback_ = callback;
if (CompositeIsSynchronous()) { if (CompositeIsSynchronous()) {
base::ThreadTaskRunnerHandle::Get()->PostTask( layer_tree_host_->GetTaskRunnerProvider()->MainThreadTaskRunner()->PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce(&RenderWidgetCompositor::LayoutAndUpdateLayers, base::BindOnce(&RenderWidgetCompositor::LayoutAndUpdateLayers,
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
...@@ -1071,7 +1071,7 @@ void RenderWidgetCompositor::CompositeAndReadbackAsync( ...@@ -1071,7 +1071,7 @@ void RenderWidgetCompositor::CompositeAndReadbackAsync(
// be installed after layout which will happen as a part of the commit, for // be installed after layout which will happen as a part of the commit, for
// widgets that delay the creation of their output surface. // widgets that delay the creation of their output surface.
if (CompositeIsSynchronous()) { if (CompositeIsSynchronous()) {
base::ThreadTaskRunnerHandle::Get()->PostTask( layer_tree_host_->GetTaskRunnerProvider()->MainThreadTaskRunner()->PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce(&RenderWidgetCompositor::SynchronouslyComposite, base::BindOnce(&RenderWidgetCompositor::SynchronouslyComposite,
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
...@@ -1152,7 +1152,7 @@ void RenderWidgetCompositor::RequestDecode( ...@@ -1152,7 +1152,7 @@ void RenderWidgetCompositor::RequestDecode(
// in this case we actually need a commit to transfer the decode requests to // in this case we actually need a commit to transfer the decode requests to
// the impl side. So, force a commit to happen. // the impl side. So, force a commit to happen.
if (CompositeIsSynchronous()) { if (CompositeIsSynchronous()) {
base::ThreadTaskRunnerHandle::Get()->PostTask( layer_tree_host_->GetTaskRunnerProvider()->MainThreadTaskRunner()->PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce(&RenderWidgetCompositor::SynchronouslyComposite, base::BindOnce(&RenderWidgetCompositor::SynchronouslyComposite,
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
...@@ -1228,7 +1228,7 @@ void RenderWidgetCompositor::DidFailToInitializeLayerTreeFrameSink() { ...@@ -1228,7 +1228,7 @@ void RenderWidgetCompositor::DidFailToInitializeLayerTreeFrameSink() {
return; return;
} }
layer_tree_frame_sink_request_failed_while_invisible_ = false; layer_tree_frame_sink_request_failed_while_invisible_ = false;
base::ThreadTaskRunnerHandle::Get()->PostTask( layer_tree_host_->GetTaskRunnerProvider()->MainThreadTaskRunner()->PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce(&RenderWidgetCompositor::RequestNewLayerTreeFrameSink, base::BindOnce(&RenderWidgetCompositor::RequestNewLayerTreeFrameSink,
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
...@@ -1292,7 +1292,8 @@ void RenderWidgetCompositor::SetContentSourceId(uint32_t id) { ...@@ -1292,7 +1292,8 @@ void RenderWidgetCompositor::SetContentSourceId(uint32_t id) {
void RenderWidgetCompositor::NotifySwapTime(ReportTimeCallback callback) { void RenderWidgetCompositor::NotifySwapTime(ReportTimeCallback callback) {
QueueSwapPromise(std::make_unique<ReportTimeSwapPromise>( QueueSwapPromise(std::make_unique<ReportTimeSwapPromise>(
std::move(callback), base::ThreadTaskRunnerHandle::Get())); std::move(callback),
layer_tree_host_->GetTaskRunnerProvider()->MainThreadTaskRunner()));
} }
void RenderWidgetCompositor::RequestBeginMainFrameNotExpected(bool new_state) { void RenderWidgetCompositor::RequestBeginMainFrameNotExpected(bool new_state) {
......
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