Commit 7d1c0894 authored by Minoru Chikamune's avatar Minoru Chikamune Committed by Commit Bot

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

Context:

Per-AgentSchedulingGroup task runners should be used where appropriate.

What this CL does:

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

Bug: 1105403
Change-Id: I799dca8fc4425f7f8459c2964de838e292a76edc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2497785
Commit-Queue: Minoru Chikamune <chikamune@chromium.org>
Reviewed-by: default avatarTal Pressman <talp@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821552}
parent fcdfb37a
...@@ -508,8 +508,11 @@ void WebViewImpl::CloseWindowSoon() { ...@@ -508,8 +508,11 @@ void WebViewImpl::CloseWindowSoon() {
// DestroyView IPC. So instead, post a message back to the message loop, which // DestroyView IPC. So instead, post a message back to the message loop, which
// won't run until the JS is complete, and then the // won't run until the JS is complete, and then the
// RouteCloseEvent/RequestClose request can be sent. // RouteCloseEvent/RequestClose request can be sent.
Thread::MainThread()->GetTaskRunner()->PostTask( GetPage()
FROM_HERE, WTF::Bind(&WebViewImpl::DoDeferredCloseWindowSoon, ->GetPageScheduler()
->GetAgentGroupScheduler()
.DefaultTaskRunner()
->PostTask(FROM_HERE, WTF::Bind(&WebViewImpl::DoDeferredCloseWindowSoon,
weak_ptr_factory_.GetWeakPtr())); weak_ptr_factory_.GetWeakPtr()));
} }
...@@ -541,7 +544,9 @@ WebViewImpl::WebViewImpl( ...@@ -541,7 +544,9 @@ WebViewImpl::WebViewImpl(
maximum_zoom_level_(PageZoomFactorToZoomLevel(kMaximumPageZoomFactor)), maximum_zoom_level_(PageZoomFactorToZoomLevel(kMaximumPageZoomFactor)),
does_composite_(does_composite), does_composite_(does_composite),
fullscreen_controller_(std::make_unique<FullscreenController>(this)), fullscreen_controller_(std::make_unique<FullscreenController>(this)),
receiver_(this, std::move(page_handle)) { receiver_(this,
std::move(page_handle),
agent_group_scheduler.DefaultTaskRunner()) {
if (!web_view_client_) if (!web_view_client_)
DCHECK(!does_composite_); DCHECK(!does_composite_);
Page::PageClients page_clients; Page::PageClients page_clients;
...@@ -2638,7 +2643,11 @@ void WebViewImpl::DidAttachLocalMainFrame() { ...@@ -2638,7 +2643,11 @@ void WebViewImpl::DidAttachLocalMainFrame() {
local_frame->WasAttachedAsLocalMainFrame(); local_frame->WasAttachedAsLocalMainFrame();
local_frame->GetRemoteNavigationAssociatedInterfaces()->GetInterface( local_frame->GetRemoteNavigationAssociatedInterfaces()->GetInterface(
local_main_frame_host_remote_.BindNewEndpointAndPassReceiver()); local_main_frame_host_remote_.BindNewEndpointAndPassReceiver(
GetPage()
->GetPageScheduler()
->GetAgentGroupScheduler()
.DefaultTaskRunner()));
if (does_composite_) { if (does_composite_) {
// When attaching a local main frame, set up any state on the compositor. // When attaching a local main frame, set up any state on the compositor.
...@@ -2661,7 +2670,11 @@ void WebViewImpl::DidAttachRemoteMainFrame() { ...@@ -2661,7 +2670,11 @@ void WebViewImpl::DidAttachRemoteMainFrame() {
remote_frame->WasAttachedAsRemoteMainFrame(); remote_frame->WasAttachedAsRemoteMainFrame();
remote_frame->GetRemoteAssociatedInterfaces()->GetInterface( remote_frame->GetRemoteAssociatedInterfaces()->GetInterface(
remote_main_frame_host_remote_.BindNewEndpointAndPassReceiver()); remote_main_frame_host_remote_.BindNewEndpointAndPassReceiver(
GetPage()
->GetPageScheduler()
->GetAgentGroupScheduler()
.DefaultTaskRunner()));
} }
void WebViewImpl::DidDetachLocalMainFrame() { void WebViewImpl::DidDetachLocalMainFrame() {
......
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