Reland: Move dispatchDidFirstVisuallyNonEmptyLayout into WebViewImpl.

This removes a user of didLayoutWithPendingStylesheets() and instead moves
the call to dispatchDidFirstVisuallyNonEmptyLayout into WebViewImpl so the
notification to the embedder is tied to the pumping of frames. This changes the
behavior of this notification to only dispatch for the top level frame,
but Chromium already has a check for that:

https://chromium.googlesource.com/chromium/src/+/976d4d9a2735bdc11e5a641c84b6382566d48f1d/content/renderer/render_frame_impl.cc#3472

RenderFrameImpl::didFirstVisuallyNonEmptyLayout's first check is

if (frame->parent())
    return;

so we already ignore all frames that are not the main frame. Future patches will
clean up this interface so it's obvious this really only happens for the main
frame.

This was originally comitted as r200664, but got reverted due to making a test
flaky in Chromium that was depending on very specific timing of this callback.
That test was fixed by:
https://crrev.com/0ea17fce0d5218c909985e2216051eab79419463

BUG=521692
R=dglazkov@chromium.org

Review URL: https://codereview.chromium.org/1295053002

git-svn-id: svn://svn.chromium.org/blink/trunk@200934 bbb929c8-8fbe-4397-9dbb-9b2b20218538
4 files changed
tree: e5a16032ac3ed20b0f16a2b0a935c246b1bbc59b
  1. third_party/