OOPIF: Specify previous sibling frames when creating RenderFrames.
commit134cdb8c234847ebde156e46cad95be3221dc66b
authoralexmos <alexmos@chromium.org>
Tue, 5 May 2015 19:50:28 +0000 (5 12:50 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 5 May 2015 19:51:10 +0000 (5 19:51 +0000)
treebf51165c4e5d12ffd20c81f4a871342a7ccd2152
parent51d04a1d341fe739beaff1528095f025a66f3fcc
OOPIF: Specify previous sibling frames when creating RenderFrames.

When initializing a new renderer for an OOP frame, the current
behavior is to first create all the RenderFrameProxies, and then to
create the new RenderFrame, appending it as its parent's last child in
the frame tree.  This disregards the order of sibling frames and thus
may break indexed window access (e.g., window.frames[2]).

This CL passes the previous sibling's routing ID in the
FrameMsg_NewFrame message, so that the new frame can be inserted in
the correct place in the frame tree.  Note that we don't need to do
this for RenderFrameProxies, as those are already created in the
correct order (by CreateProxiesForSiteInstance) when initializing a
new renderer process.

Corresponding Blink CL: https://codereview.chromium.org/1119823003/

BUG=478792

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

Cr-Commit-Position: refs/heads/master@{#328384}
16 files changed:
content/browser/frame_host/frame_tree_node.cc
content/browser/frame_host/frame_tree_node.h
content/browser/frame_host/frame_tree_unittest.cc
content/browser/frame_host/render_frame_host_impl.cc
content/browser/frame_host/render_frame_host_impl.h
content/browser/frame_host/render_frame_host_manager.cc
content/browser/frame_host/render_frame_host_manager.h
content/browser/site_per_process_browsertest.cc
content/browser/web_contents/web_contents_impl.cc
content/browser/web_contents/web_contents_impl.h
content/common/frame_messages.h
content/renderer/render_frame_impl.cc
content/renderer/render_frame_impl.h
content/renderer/render_frame_impl_browsertest.cc
content/renderer/render_thread_impl.cc
content/renderer/render_thread_impl.h