Plumb opener information when creating RenderFrames and
RenderFrameProxies for subframes.
Frame opener updates (via window.open) make it possible for subframes
to have an opener. Currently, when a subframe gains an opener, this
will be forwarded to the browser process and all of the renderer
processes where the subframe has a RenderFrame or a RenderFrameProxy.
Openers are also supposed to be preserved across cross-process frame
navigations. Currently, this is done correctly for top-level frames
(where opener information is sent as part of ViewMsg_New), but not for
subframes: FrameMsg_NewFrame and FrameMsg_NewFrameProxy currently
don't pass any information about the frame's opener.
For example, suppose a frame F1 has two subframes, F2 and F3, all at
site A. Suppose F1 executes a window.open('',F2_name) to update F2's
opener to F1. Now suppose F2 navigates to B. F2's frame in B should
have an opener that points to F1's proxy in B, but currently that's
not the case. Likewise, suppose F3 navigates to C. F2's proxy in C
should have an opener that points to F1's proxy in C.
This CL plumbs opener information through FrameMsg_NewFrame(Proxy) to
make these scenarios work correctly.
BUG=225940
Review URL: https://codereview.chromium.org/1312643002
Cr-Commit-Position: refs/heads/master@{#347072}
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 3299280f..f94639f 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -595,10 +595,12 @@
int proxy_routing_id,
const FrameReplicationState& replicated_frame_state,
bool for_main_frame_navigation) override;
- bool CreateRenderFrameForRenderManager(RenderFrameHost* render_frame_host,
- int parent_routing_id,
- int previous_sibling_routing_id,
- int proxy_routing_id) override;
+ bool CreateRenderFrameForRenderManager(
+ RenderFrameHost* render_frame_host,
+ int proxy_routing_id,
+ int opener_routing_id,
+ int parent_routing_id,
+ int previous_sibling_routing_id) override;
void BeforeUnloadFiredFromRenderManager(
bool proceed,
const base::TimeTicks& proceed_time,