Commit 3df1ee77 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Call blink::mojom::LocalFrameHost::DocumentOnLoadCompleted() earlier

Today, this mojo call comes from LocalFrameClientImpl::DispatchDidHandleOnloadEvents(),
which used to make sense when RenderFrameImpl::DispatchDidHandleOnloadEvents()
used to send the respective message to content::mojom::FrameHost interface,
and calling observers.

Now that this mojo message got moved from content.mojom.FrameHost to
blink.mojom.LocalFrameHost [1], it seems logical to call it from out
of LocalFrameClientImpl class.

BUG=1043760
R=dtapuska@chromium.org

Change-Id: Ie3917cca5fa687a3d7ede91970321c6d1aa8f3a8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2014763Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Auto-Submit: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#734053}
parent 5dd9bf9e
......@@ -3636,6 +3636,9 @@ void Document::ImplicitClose() {
if (domWindow())
domWindow()->DocumentWasClosed();
if (GetFrame() && GetFrame()->IsMainFrame())
GetFrame()->GetLocalFrameHostRemote().DocumentOnLoadCompleted();
if (GetFrame()) {
GetFrame()->Client()->DispatchDidHandleOnloadEvents();
Loader()->GetApplicationCacheHost()->StopDeferringEvents();
......
......@@ -387,8 +387,6 @@ void LocalFrameClientImpl::DispatchDidLoadResourceFromMemoryCache(
}
void LocalFrameClientImpl::DispatchDidHandleOnloadEvents() {
if (!web_frame_->Parent())
web_frame_->GetFrame()->GetLocalFrameHostRemote().DocumentOnLoadCompleted();
if (web_frame_->Client())
web_frame_->Client()->DidHandleOnloadEvents();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment