@@ -152,35 +152,6 @@ void BrowserWindow::DidFirstVisuallyNonEmptyPaint() {
152152 auto * const view = web_contents ()->GetRenderWidgetHostView ();
153153 view->Show ();
154154 view->SetSize (window ()->GetContentSize ());
155-
156- // Emit the ReadyToShow event in next tick in case of pending drawing work.
157- base::ThreadTaskRunnerHandle::Get ()->PostTask (
158- FROM_HERE, base::BindOnce (
159- [](base::WeakPtr<BrowserWindow> self) {
160- if (self && !self->did_ready_to_show_fired_ ) {
161- self->did_ready_to_show_fired_ = true ;
162- self->Emit (" ready-to-show" );
163- }
164- },
165- GetWeakPtr ()));
166- }
167-
168- void BrowserWindow::DidFinishLoad (content::RenderFrameHost* render_frame_host,
169- const GURL& validated_url) {
170- // The DidFirstVisuallyNonEmptyPaint event is not very stable that, sometimes
171- // on some machines it might not be fired, and the actual behavior depends on
172- // the version of Chromium.
173- // To work around this bug, we ensure the ready-to-show event is emitted if it
174- // has not been emitted in did-finish-load event.
175- // Note that we use did-finish-load event instead of dom-ready event because
176- // the latter may actually be emitted before the ready-to-show event.
177- // See also https://github.com/electron/electron/issues/7779.
178- if (window ()->IsVisible () || did_ready_to_show_fired_)
179- return ;
180- if (render_frame_host->GetParent ()) // child frame
181- return ;
182- did_ready_to_show_fired_ = true ;
183- Emit (" ready-to-show" );
184155}
185156
186157void BrowserWindow::BeforeUnloadDialogCancelled () {
0 commit comments