Commit 9d24e562 authored by Minoru Chikamune's avatar Minoru Chikamune Committed by Commit Bot

[MBI] Use per-AgentSchedulingGroup task runners for WidgetBase's mojo interfaces

Context:

per-AgentSchedulingGroup task runners should be used where appropriate.

What this CL does:

Use per-AgentSchedulingGroup task runners for WidgetBase's mojo interfaces instead of per-thread task runners.

Bug: 1105403
Change-Id: I5e59d59520320e50ebccce460da1735b8ee071d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2497784Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Commit-Queue: Minoru Chikamune <chikamune@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821533}
parent 11dbb2f1
...@@ -542,7 +542,8 @@ blink::WebPagePopup* RenderViewImpl::CreatePopup( ...@@ -542,7 +542,8 @@ blink::WebPagePopup* RenderViewImpl::CreatePopup(
// an owning pointer. It is de-referenced by calling Close(). // an owning pointer. It is de-referenced by calling Close().
blink::WebPagePopup* popup_web_widget = blink::WebPagePopup::Create( blink::WebPagePopup* popup_web_widget = blink::WebPagePopup::Create(
popup_widget, std::move(blink_popup_widget_host), popup_widget, std::move(blink_popup_widget_host),
std::move(blink_widget_host), std::move(blink_widget_receiver)); std::move(blink_widget_host), std::move(blink_widget_receiver),
agent_scheduling_group_.agent_group_scheduler().DefaultTaskRunner());
// Adds a self-reference on the |popup_widget| so it will not be destroyed // Adds a self-reference on the |popup_widget| so it will not be destroyed
// when leaving scope. The WebPagePopup takes responsibility for Close()ing // when leaving scope. The WebPagePopup takes responsibility for Close()ing
......
...@@ -60,7 +60,8 @@ class WebPagePopup : public WebWidget { ...@@ -60,7 +60,8 @@ class WebPagePopup : public WebWidget {
popup_widget_host, popup_widget_host,
CrossVariantMojoAssociatedRemote<mojom::WidgetHostInterfaceBase> CrossVariantMojoAssociatedRemote<mojom::WidgetHostInterfaceBase>
widget_host, widget_host,
CrossVariantMojoAssociatedReceiver<mojom::WidgetInterfaceBase> widget); CrossVariantMojoAssociatedReceiver<mojom::WidgetInterfaceBase> widget,
scoped_refptr<base::SingleThreadTaskRunner> task_runner);
// The popup's accessibility tree is connected to the main document's // The popup's accessibility tree is connected to the main document's
// accessibility tree. Access to the popup document is needed to ensure the // accessibility tree. Access to the popup document is needed to ensure the
......
...@@ -253,13 +253,15 @@ WebPagePopupImpl::WebPagePopupImpl( ...@@ -253,13 +253,15 @@ WebPagePopupImpl::WebPagePopupImpl(
CrossVariantMojoAssociatedRemote<mojom::blink::WidgetHostInterfaceBase> CrossVariantMojoAssociatedRemote<mojom::blink::WidgetHostInterfaceBase>
widget_host, widget_host,
CrossVariantMojoAssociatedReceiver<mojom::blink::WidgetInterfaceBase> CrossVariantMojoAssociatedReceiver<mojom::blink::WidgetInterfaceBase>
widget) widget,
scoped_refptr<base::SingleThreadTaskRunner> task_runner)
: web_page_popup_client_(client), : web_page_popup_client_(client),
popup_widget_host_(std::move(popup_widget_host)), popup_widget_host_(std::move(popup_widget_host)),
widget_base_( widget_base_(
std::make_unique<WidgetBase>(this, std::make_unique<WidgetBase>(this,
std::move(widget_host), std::move(widget_host),
std::move(widget), std::move(widget),
task_runner,
/*hidden=*/false, /*hidden=*/false,
/*never_composited=*/false, /*never_composited=*/false,
/*is_for_child_local_root=*/false)) { /*is_for_child_local_root=*/false)) {
...@@ -980,7 +982,8 @@ WebPagePopup* WebPagePopup::Create( ...@@ -980,7 +982,8 @@ WebPagePopup* WebPagePopup::Create(
CrossVariantMojoAssociatedRemote<mojom::blink::WidgetHostInterfaceBase> CrossVariantMojoAssociatedRemote<mojom::blink::WidgetHostInterfaceBase>
widget_host, widget_host,
CrossVariantMojoAssociatedReceiver<mojom::blink::WidgetInterfaceBase> CrossVariantMojoAssociatedReceiver<mojom::blink::WidgetInterfaceBase>
widget) { widget,
scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
CHECK(client); CHECK(client);
// A WebPagePopupImpl instance usually has two references. // A WebPagePopupImpl instance usually has two references.
// - One owned by the instance itself. It represents the visible widget. // - One owned by the instance itself. It represents the visible widget.
...@@ -988,9 +991,9 @@ WebPagePopup* WebPagePopup::Create( ...@@ -988,9 +991,9 @@ WebPagePopup* WebPagePopup::Create(
// WebPagePopupImpl to close. // WebPagePopupImpl to close.
// We need them because the closing operation is asynchronous and the widget // We need them because the closing operation is asynchronous and the widget
// can be closed while the WebViewImpl is unaware of it. // can be closed while the WebViewImpl is unaware of it.
auto popup = base::AdoptRef( auto popup = base::AdoptRef(new WebPagePopupImpl(
new WebPagePopupImpl(client, std::move(popup_widget_host), client, std::move(popup_widget_host), std::move(widget_host),
std::move(widget_host), std::move(widget))); std::move(widget), task_runner));
popup->AddRef(); popup->AddRef();
return popup.get(); return popup.get();
} }
......
...@@ -217,7 +217,8 @@ class CORE_EXPORT WebPagePopupImpl final : public WebPagePopup, ...@@ -217,7 +217,8 @@ class CORE_EXPORT WebPagePopupImpl final : public WebPagePopup,
CrossVariantMojoAssociatedRemote<mojom::blink::WidgetHostInterfaceBase> CrossVariantMojoAssociatedRemote<mojom::blink::WidgetHostInterfaceBase>
widget_host, widget_host,
CrossVariantMojoAssociatedReceiver<mojom::blink::WidgetInterfaceBase> CrossVariantMojoAssociatedReceiver<mojom::blink::WidgetInterfaceBase>
widget); widget,
scoped_refptr<base::SingleThreadTaskRunner> task_runner);
void DestroyPage(); void DestroyPage();
void SetRootLayer(scoped_refptr<cc::Layer>); void SetRootLayer(scoped_refptr<cc::Layer>);
void SetWebView(WebViewImpl* web_view); void SetWebView(WebViewImpl* web_view);
......
...@@ -173,6 +173,7 @@ WebFrameWidgetBase::WebFrameWidgetBase( ...@@ -173,6 +173,7 @@ WebFrameWidgetBase::WebFrameWidgetBase(
: widget_base_(std::make_unique<WidgetBase>(this, : widget_base_(std::make_unique<WidgetBase>(this,
std::move(widget_host), std::move(widget_host),
std::move(widget), std::move(widget),
task_runner,
hidden, hidden,
never_composited, never_composited,
is_for_child_local_root)), is_for_child_local_root)),
......
...@@ -79,6 +79,7 @@ class WidgetCompositorTest : public cc::LayerTreeTest { ...@@ -79,6 +79,7 @@ class WidgetCompositorTest : public cc::LayerTreeTest {
widget_base_ = std::make_unique<WidgetBase>( widget_base_ = std::make_unique<WidgetBase>(
&client_, widget_host_remote.Unbind(), std::move(widget_receiver), &client_, widget_host_remote.Unbind(), std::move(widget_receiver),
base::ThreadTaskRunnerHandle::Get(),
/*is_hidden=*/false, /*is_hidden=*/false,
/*never_composited=*/false, /*never_composited=*/false,
/*is_for_child_local_root=*/false); /*is_for_child_local_root=*/false);
......
...@@ -141,12 +141,13 @@ WidgetBase::WidgetBase( ...@@ -141,12 +141,13 @@ WidgetBase::WidgetBase(
CrossVariantMojoAssociatedRemote<mojom::WidgetHostInterfaceBase> CrossVariantMojoAssociatedRemote<mojom::WidgetHostInterfaceBase>
widget_host, widget_host,
CrossVariantMojoAssociatedReceiver<mojom::WidgetInterfaceBase> widget, CrossVariantMojoAssociatedReceiver<mojom::WidgetInterfaceBase> widget,
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
bool hidden, bool hidden,
bool never_composited, bool never_composited,
bool is_for_child_local_root) bool is_for_child_local_root)
: client_(client), : client_(client),
widget_host_(std::move(widget_host)), widget_host_(std::move(widget_host), task_runner),
receiver_(this, std::move(widget)), receiver_(this, std::move(widget), task_runner),
next_previous_flags_(kInvalidNextPreviousFlagsValue), next_previous_flags_(kInvalidNextPreviousFlagsValue),
use_zoom_for_dsf_(Platform::Current()->IsUseZoomForDSFEnabled()), use_zoom_for_dsf_(Platform::Current()->IsUseZoomForDSFEnabled()),
is_hidden_(hidden), is_hidden_(hidden),
......
...@@ -65,6 +65,7 @@ class PLATFORM_EXPORT WidgetBase : public mojom::blink::Widget, ...@@ -65,6 +65,7 @@ class PLATFORM_EXPORT WidgetBase : public mojom::blink::Widget,
CrossVariantMojoAssociatedRemote<mojom::WidgetHostInterfaceBase> CrossVariantMojoAssociatedRemote<mojom::WidgetHostInterfaceBase>
widget_host, widget_host,
CrossVariantMojoAssociatedReceiver<mojom::WidgetInterfaceBase> widget, CrossVariantMojoAssociatedReceiver<mojom::WidgetInterfaceBase> widget,
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
bool hidden, bool hidden,
bool never_composited, bool never_composited,
bool is_for_child_local_root); bool is_for_child_local_root);
......
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