Introduce support for hosting and connecting to per-WebState Mojo interfaces on iOS |
|||
Issue descriptionOn //content-based platforms, there is the notion of a per-RenderFrameHost InterfaceProvider. The RenderFrame has access to this provider and uses it to connect to per-frame or per-WebContents Mojo interfaces. We will want to share many of these interfaces with iOS. On iOS, there is no equivalent concept to "per-render frame". Instead, these interfaces will be per-WebState. Note that by definition all the interfaces that are shareable with iOS are per-tab (i.e., per-WebContents or per-WebState), precisely because iOS has no concept of any smaller granularity. To enable this use case, we need to introduce the necessary infrastructure for hosting Mojo interfaces in a WebState and being able to connect to a per-WebState interface from a client that is in the context of a particular WebState. This infra should parallel //content's as much as is reasonable, but can't be the same due to the lack of frame granularity.
,
Jul 24 2017
,
Jul 25 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/269aeb0222e38547727acb333ac70db5a45f2996 commit 269aeb0222e38547727acb333ac70db5a45f2996 Author: Colin Blundell <blundell@chromium.org> Date: Tue Jul 25 11:57:33 2017 [iOS] Add support for per-WebState Mojo interfaces //content-based platforms have the concept of per-frame interfaces (i.e., interfaces that are scoped to the connection between a render frame and its corresponding host). These interfaces replace the per-frame IPC between the renderer and browser that was used to implement a given feature (e.g., translate). Some of these interfaces will in the long term be shared with iOS as the process of servicification unfolds, e.g. for features like translate and autofill. In this long-term picture, the browser-side implementation of the Mojo interface will be shared between iOS and other platforms, with a platform-specific client invoking this interface via Mojo (from the renderer process on !iOS, and likely originating from Javascript on iOS). To facilitate this long-term picture, this CL adds corresponding support for per-WebState interfaces on iOS. Note that while the infrastructure is added at the RenderFrame(Host) granularity in //content, on iOS all communication is implicitly occurring within the context of the main frame, and there is thus no equivalent concept to RenderFrameHost. This CL thus adds the infrastructure at the granularity of WebState itself, with method names making it clear that the requests are implicitly coming from the main frame. This CL also adds an EarlGrey test of web_shell that serves as an example usage of this infrastructure. Finally, this CL does not replicate //content's mechanism for ensuring that per-frame interface requests get filtered through service manifest specifications. Setting up this mechanism necessarily adds indirection (as all interface requests go down through the service manager), and it is not clear that there is significant benefit on iOS (where all requests are coming from the browser process in any case). We can always add this support later. Bug: 746447 Change-Id: I54236fc437b1403a363880f9039c43353ea48564 Reviewed-on: https://chromium-review.googlesource.com/582828 Commit-Queue: Colin Blundell <blundell@chromium.org> Reviewed-by: Ken Rockot <rockot@chromium.org> Reviewed-by: Eugene But <eugenebut@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Cr-Commit-Position: refs/heads/master@{#489277} [modify] https://crrev.com/269aeb0222e38547727acb333ac70db5a45f2996/ios/web/public/web_client.h [modify] https://crrev.com/269aeb0222e38547727acb333ac70db5a45f2996/ios/web/public/web_state/web_state.h [modify] https://crrev.com/269aeb0222e38547727acb333ac70db5a45f2996/ios/web/shell/BUILD.gn [modify] https://crrev.com/269aeb0222e38547727acb333ac70db5a45f2996/ios/web/shell/OWNERS [modify] https://crrev.com/269aeb0222e38547727acb333ac70db5a45f2996/ios/web/shell/shell_web_client.h [modify] https://crrev.com/269aeb0222e38547727acb333ac70db5a45f2996/ios/web/shell/shell_web_client.mm [modify] https://crrev.com/269aeb0222e38547727acb333ac70db5a45f2996/ios/web/shell/test/BUILD.gn [modify] https://crrev.com/269aeb0222e38547727acb333ac70db5a45f2996/ios/web/shell/test/service_manager_egtest.mm [add] https://crrev.com/269aeb0222e38547727acb333ac70db5a45f2996/ios/web/shell/web_usage_controller.mojom [modify] https://crrev.com/269aeb0222e38547727acb333ac70db5a45f2996/ios/web/web_state/web_state_impl.h [modify] https://crrev.com/269aeb0222e38547727acb333ac70db5a45f2996/ios/web/web_state/web_state_impl.mm
,
Jul 25 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by jif@chromium.org
, Jul 21 2017