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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 1118083004: Revert of OOPIF: Specify previous sibling frames when creating new RenderFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months 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 unified diff | Download patch
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_frame_impl_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 g_routing_id_frame_map.Get().find(routing_id); 557 g_routing_id_frame_map.Get().find(routing_id);
558 if (iter != g_routing_id_frame_map.Get().end()) 558 if (iter != g_routing_id_frame_map.Get().end())
559 return iter->second; 559 return iter->second;
560 return NULL; 560 return NULL;
561 } 561 }
562 562
563 // static 563 // static
564 void RenderFrameImpl::CreateFrame( 564 void RenderFrameImpl::CreateFrame(
565 int routing_id, 565 int routing_id,
566 int parent_routing_id, 566 int parent_routing_id,
567 int previous_sibling_routing_id,
568 int proxy_routing_id, 567 int proxy_routing_id,
569 const FrameReplicationState& replicated_state, 568 const FrameReplicationState& replicated_state,
570 CompositorDependencies* compositor_deps, 569 CompositorDependencies* compositor_deps,
571 const FrameMsg_NewFrame_WidgetParams& widget_params) { 570 const FrameMsg_NewFrame_WidgetParams& widget_params) {
572 // TODO(nasko): For now, this message is only sent for subframes, as the 571 // TODO(nasko): For now, this message is only sent for subframes, as the
573 // top level frame is created when the RenderView is created through the 572 // top level frame is created when the RenderView is created through the
574 // ViewMsg_New IPC. 573 // ViewMsg_New IPC.
575 CHECK_NE(MSG_ROUTING_NONE, parent_routing_id); 574 CHECK_NE(MSG_ROUTING_NONE, parent_routing_id);
576 575
577 blink::WebLocalFrame* web_frame; 576 blink::WebLocalFrame* web_frame;
578 RenderFrameImpl* render_frame; 577 RenderFrameImpl* render_frame;
579 if (proxy_routing_id == MSG_ROUTING_NONE) { 578 if (proxy_routing_id == MSG_ROUTING_NONE) {
580 RenderFrameProxy* parent_proxy = 579 RenderFrameProxy* parent_proxy =
581 RenderFrameProxy::FromRoutingID(parent_routing_id); 580 RenderFrameProxy::FromRoutingID(parent_routing_id);
582 // If the browser is sending a valid parent routing id, it should already 581 // If the browser is sending a valid parent routing id, it should already
583 // be created and registered. 582 // be created and registered.
584 CHECK(parent_proxy); 583 CHECK(parent_proxy);
585 blink::WebRemoteFrame* parent_web_frame = parent_proxy->web_frame(); 584 blink::WebRemoteFrame* parent_web_frame = parent_proxy->web_frame();
586 585
587 blink::WebFrame* previous_sibling_web_frame = nullptr;
588 RenderFrameProxy* previous_sibling_proxy =
589 RenderFrameProxy::FromRoutingID(previous_sibling_routing_id);
590 if (previous_sibling_proxy)
591 previous_sibling_web_frame = previous_sibling_proxy->web_frame();
592
593 // Create the RenderFrame and WebLocalFrame, linking the two. 586 // Create the RenderFrame and WebLocalFrame, linking the two.
594 render_frame = 587 render_frame =
595 RenderFrameImpl::Create(parent_proxy->render_view(), routing_id); 588 RenderFrameImpl::Create(parent_proxy->render_view(), routing_id);
596 web_frame = parent_web_frame->createLocalChild( 589 web_frame = parent_web_frame->createLocalChild(
597 WebString::fromUTF8(replicated_state.name), 590 WebString::fromUTF8(replicated_state.name),
598 ContentToWebSandboxFlags(replicated_state.sandbox_flags), render_frame, 591 ContentToWebSandboxFlags(replicated_state.sandbox_flags), render_frame);
599 previous_sibling_web_frame);
600 } else { 592 } else {
601 RenderFrameProxy* proxy = 593 RenderFrameProxy* proxy =
602 RenderFrameProxy::FromRoutingID(proxy_routing_id); 594 RenderFrameProxy::FromRoutingID(proxy_routing_id);
603 CHECK(proxy); 595 CHECK(proxy);
604 render_frame = RenderFrameImpl::Create(proxy->render_view(), routing_id); 596 render_frame = RenderFrameImpl::Create(proxy->render_view(), routing_id);
605 web_frame = blink::WebLocalFrame::create(render_frame); 597 web_frame = blink::WebLocalFrame::create(render_frame);
606 render_frame->proxy_routing_id_ = proxy_routing_id; 598 render_frame->proxy_routing_id_ = proxy_routing_id;
607 web_frame->initializeToReplaceRemoteFrame( 599 web_frame->initializeToReplaceRemoteFrame(
608 proxy->web_frame(), WebString::fromUTF8(replicated_state.name), 600 proxy->web_frame(), WebString::fromUTF8(replicated_state.name),
609 ContentToWebSandboxFlags(replicated_state.sandbox_flags)); 601 ContentToWebSandboxFlags(replicated_state.sandbox_flags));
(...skipping 4236 matching lines...) Expand 10 before | Expand all | Expand 10 after
4846 #elif defined(ENABLE_BROWSER_CDMS) 4838 #elif defined(ENABLE_BROWSER_CDMS)
4847 cdm_manager_, 4839 cdm_manager_,
4848 #endif 4840 #endif
4849 this); 4841 this);
4850 } 4842 }
4851 4843
4852 return cdm_factory_; 4844 return cdm_factory_;
4853 } 4845 }
4854 4846
4855 } // namespace content 4847 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_frame_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698