Reland "Convert FrameMsg_SetWebUIProperty and FrameHostMsg_WebUISend to mojo interfaces"
This is a reland of 2c6f0159f6573eb59523352e311e4f56d9b65e0c
The original CL was reverted because this CL had introduced 4%
flakiness for OOBE tests on ChromeOS.
There were two kinds of regression issues with the origin CL. One was
that WebUI APIs didn't work after a crash and reload since the old Mojo
connections were kept for WebUI, and another thing was that
BrowserInterfaceBroker was not ready but it was used in
WebUIExtensionData ctor.
This CL fixes the above regressions.
- Resets WebUI Mojo connections when the render frame is exited, and adds
a test case.
- Connects WebUI Mojo connections without BrowserInterfaceBroker
dependence right after AllBindings is called.
Original change's description:
> Convert FrameMsg_SetWebUIProperty and FrameHostMsg_WebUISend to mojo interfaces
>
> This CL converts FrameMsg_SetWebUIProperty to WebUI mojo interface
> and FrameHostMsg_WebUISend to WebUIHost mojo interface, and
> introduces those mojo interfaces newly.
>
> Bug: 1041074
> Change-Id: Ifd47bca7b919647bd7163758826537f7d201dc85
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2097795
> Reviewed-by: Roman Sorokin [CET] <[email protected]>
> Reviewed-by: Alexander Alekseev <[email protected]>
> Reviewed-by: Dave Tapuska <[email protected]>
> Reviewed-by: Kinuko Yasuda <[email protected]>
> Reviewed-by: Kentaro Hara <[email protected]>
> Commit-Queue: Miyoung Shin <[email protected]>
> Cr-Commit-Position: refs/heads/master@{#768092}
Bug: 1041074
Change-Id: Id6f6e0903f9816bd4cc65d8da00e2739c9fbc4d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2215650
Commit-Queue: Miyoung Shin <[email protected]>
Reviewed-by: Dave Tapuska <[email protected]>
Reviewed-by: Alexander Alekseev <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Mihai Sardarescu <[email protected]>
Reviewed-by: Nasko Oskov <[email protected]>
Cr-Commit-Position: refs/heads/master@{#787654}
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index dee7a308..302ff009 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -39,6 +39,7 @@
#include "content/common/render_accessibility.mojom.h"
#include "content/common/renderer.mojom.h"
#include "content/common/unique_name_helper.h"
+#include "content/common/web_ui.mojom.h"
#include "content/public/common/browser_controls_state.h"
#include "content/public/common/fullscreen_video_element.mojom.h"
#include "content/public/common/previews_state.h"
@@ -540,6 +541,8 @@
// mojom::FrameBindingsControl implementation:
void AllowBindings(int32_t enabled_bindings_flags) override;
void EnableMojoJsBindings() override;
+ void BindWebUI(mojo::PendingReceiver<mojom::WebUI> Receiver,
+ mojo::PendingRemote<mojom::WebUIHost> remote) override;
// These mirror mojom::NavigationClient, called by NavigationClient.
void CommitNavigation(
@@ -1137,6 +1140,8 @@
// Send |callback| our AndroidOverlay routing token.
void RequestOverlayRoutingToken(media::RoutingTokenCallback callback);
+ void BindWebUIReceiver(mojo::PendingReceiver<mojom::WebUI> receiver);
+
void ShowDeferredContextMenu(const UntrustworthyContextMenuParams& params);
// Build DidCommitProvisionalLoad_Params based on the frame internal state.