Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1538)

Unified Diff: components/guest_view/browser/guest_view_message_filter.cc

Issue 2472253002: Fix navigation requests starting too early and not getting associated with the <webview>. (Closed)
Patch Set: nits Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/frame_tree_node.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/guest_view/browser/guest_view_message_filter.cc
diff --git a/components/guest_view/browser/guest_view_message_filter.cc b/components/guest_view/browser/guest_view_message_filter.cc
index bb17ea69d4abe3c977883d56dfe2b5e8474a5e13..03aefe803a3c3b5b7eba3cde8fc6d3cfaf05885b 100644
--- a/components/guest_view/browser/guest_view_message_filter.cc
+++ b/components/guest_view/browser/guest_view_message_filter.cc
@@ -133,12 +133,6 @@ void GuestViewMessageFilter::OnAttachToEmbedderFrame(
auto* embedder_frame = RenderFrameHost::FromID(
render_process_id_, embedder_local_render_frame_id);
- // Attach this inner WebContents |guest_web_contents| to the outer
- // WebContents |owner_web_contents|. The outer WebContents's
- // frame |embedder_frame| hosts the inner WebContents.
- guest_web_contents->AttachToOuterWebContentsFrame(owner_web_contents,
- embedder_frame);
-
// Update the guest manager about the attachment.
// This sets up the embedder and guest pairing information inside
// the manager.
@@ -151,6 +145,14 @@ void GuestViewMessageFilter::OnAttachToEmbedderFrame(
guest->WillAttach(
owner_web_contents, element_instance_id, false,
base::Bind(&GuestViewMessageFilter::WillAttachCallback, this, guest));
+
+ // Attach this inner WebContents |guest_web_contents| to the outer
+ // WebContents |owner_web_contents|. The outer WebContents's
+ // frame |embedder_frame| hosts the inner WebContents.
+ // NOTE: this must be called last, because it could unblock pending requests
+ // which depend on the WebViewGuest being initialized which happens above.
+ guest_web_contents->AttachToOuterWebContentsFrame(owner_web_contents,
+ embedder_frame);
}
void GuestViewMessageFilter::WillAttachCallback(GuestViewBase* guest) {
« no previous file with comments | « no previous file | content/browser/frame_host/frame_tree_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698