Commit 8a65d550 authored by Lucas Furukawa Gadani's avatar Lucas Furukawa Gadani Committed by Commit Bot

Don't allow OOPIF-based guests to receive events before being attached.

Receiving events before attachment can cause races, as the guest may
not have a RenderFrameProxy.

Bug: 747125
Change-Id: I01a20215a7ee04f657ff8e65f70d562c87a33887
Reviewed-on: https://chromium-review.googlesource.com/591931Reviewed-by: default avatarEhsan Karamad <ekaramad@chromium.org>
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491131}
parent c58221c0
......@@ -16,6 +16,7 @@
#include "components/guest_view/common/guest_view_messages.h"
#include "components/zoom/page_zoom.h"
#include "components/zoom/zoom_controller.h"
#include "content/public/browser/guest_mode.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
......@@ -744,7 +745,9 @@ void GuestViewBase::DispatchEventToGuestProxy(
}
void GuestViewBase::DispatchEventToView(std::unique_ptr<GuestViewEvent> event) {
if (attached() || can_owner_receive_events()) {
if ((attached() && pending_events_.empty()) ||
(can_owner_receive_events() &&
!content::GuestMode::IsCrossProcessFrameGuest(web_contents()))) {
event->Dispatch(this, view_instance_id_);
return;
}
......
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