[MBI]: Move RouteProvider impl from ChildThreadImpl => RenderThreadImpl
This CL moves the RouteProvider implementation from ChildThreadImpl,
to RenderThreadImpl. This is because RenderThreadImpl is the only type
of ChildThread(Impl) that uses this functionality, therefore this CL
creates a healthier boundary between render threads and child threads.
At the same time, it simplifies a nasty code path present in both
RenderFrameImpl/RenderFrameProxy::GetRemoteAssociatedInterfaces() that
separates a "production" path vs a "test" path. We do this by
introducing the GetRemoteRouteProvider() method on the RenderThread
public API, and providing two implementations:
- RenderThreadImpl
- Responsible for returning a legitimate mojom::RouteProvider* that
will be hooked up to a real cross-process implementation
- ChildThreadImpl
- Responsible for providing a dummy mojom::RouteProvider* bound to
nothing, so that the messages sent over it are simply drained
This is a reasonable tradeoff over the alternative solution of
introducing a MockAgentSchedulingGroup to handle cases where its
RenderThread is a MockRenderThread. If things regarding RenderThread
should be mocked, then it makes sense for RenderThread implementations
to mock them, as opposed to have mocks appear in both MockRenderThread
*and* MockAgentSchedulingGroup, which is slightly more awkward and
cumbersome.
Bug: 1111231, 1132901
Change-Id: I903553a67f14d22d654556c4398d169196763a76
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2433793
Commit-Queue: Dominic Farolino <dom@chromium.org>
Reviewed-by:
Kouhei Ueno <kouhei@chromium.org>
Reviewed-by:
Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811451}
Showing
Please register or sign in to comment