fix: ensure ready-to-show event is fired (#25932)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
This commit is contained in:
Shelley Vohr
2020-10-14 18:02:36 -07:00
committed by GitHub
parent ccaea19e32
commit 13722f83e3
9 changed files with 31 additions and 34 deletions

View File

@@ -128,6 +128,16 @@ void ElectronRenderFrameObserver::OnDestruct() {
delete this;
}
void ElectronRenderFrameObserver::DidMeaningfulLayout(
blink::WebMeaningfulLayout layout_type) {
if (layout_type == blink::WebMeaningfulLayout::kVisuallyNonEmpty) {
mojo::Remote<mojom::ElectronBrowser> browser_remote;
render_frame_->GetRemoteInterfaces()->GetInterface(
browser_remote.BindNewPipeAndPassReceiver());
browser_remote->OnFirstNonEmptyLayout();
}
}
void ElectronRenderFrameObserver::CreateIsolatedWorldContext() {
auto* frame = render_frame_->GetWebFrame();
blink::WebIsolatedWorldInfo info;

View File

@@ -33,6 +33,7 @@ class ElectronRenderFrameObserver : public content::RenderFrameObserver {
void WillReleaseScriptContext(v8::Local<v8::Context> context,
int world_id) override;
void OnDestruct() override;
void DidMeaningfulLayout(blink::WebMeaningfulLayout layout_type) override;
private:
bool ShouldNotifyClient(int world_id);