Fix an issue with speculative frame cleanup in OOPIFs

When the beforeunload handler is ACKed by the OOPIF process with "do not
proceed", the corresponding speculative frame is cleaned up. When the
speculative frame is in the parent frame's process it will set the
EmbeddedContentView of the owner element to nullptr. This is incorrect
as the navigation has been canceled.

This CL will avoid setting the EmbeddedContentView to nullptr when the
ContentFrame() is not equal to Document::GetFrame() (i.e., speculative)
and also the EmbeddedContentView is a RemoteFrameView.

Bug: 578349, 673170, 807772
Change-Id: Ic6f5a16ae6f02bfbe11238851936ee323472a407
Reviewed-on: https://chromium-review.googlesource.com/898028
Commit-Queue: Ehsan Karamad <ekaramad@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Ehsan Karamad <ekaramad@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534795}
5 files changed