OLD | NEW |
---|---|
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 Loading... | |
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, | |
567 int proxy_routing_id, | 568 int proxy_routing_id, |
568 const FrameReplicationState& replicated_state, | 569 const FrameReplicationState& replicated_state, |
569 CompositorDependencies* compositor_deps, | 570 CompositorDependencies* compositor_deps, |
570 const FrameMsg_NewFrame_WidgetParams& widget_params) { | 571 const FrameMsg_NewFrame_WidgetParams& widget_params) { |
571 // TODO(nasko): For now, this message is only sent for subframes, as the | 572 // TODO(nasko): For now, this message is only sent for subframes, as the |
572 // top level frame is created when the RenderView is created through the | 573 // top level frame is created when the RenderView is created through the |
573 // ViewMsg_New IPC. | 574 // ViewMsg_New IPC. |
574 CHECK_NE(MSG_ROUTING_NONE, parent_routing_id); | 575 CHECK_NE(MSG_ROUTING_NONE, parent_routing_id); |
575 | 576 |
576 blink::WebLocalFrame* web_frame; | 577 blink::WebLocalFrame* web_frame; |
577 RenderFrameImpl* render_frame; | 578 RenderFrameImpl* render_frame; |
578 if (proxy_routing_id == MSG_ROUTING_NONE) { | 579 if (proxy_routing_id == MSG_ROUTING_NONE) { |
579 RenderFrameProxy* parent_proxy = | 580 RenderFrameProxy* parent_proxy = |
580 RenderFrameProxy::FromRoutingID(parent_routing_id); | 581 RenderFrameProxy::FromRoutingID(parent_routing_id); |
581 // If the browser is sending a valid parent routing id, it should already | 582 // If the browser is sending a valid parent routing id, it should already |
582 // be created and registered. | 583 // be created and registered. |
583 CHECK(parent_proxy); | 584 CHECK(parent_proxy); |
584 blink::WebRemoteFrame* parent_web_frame = parent_proxy->web_frame(); | 585 blink::WebRemoteFrame* parent_web_frame = parent_proxy->web_frame(); |
585 | 586 |
587 blink::WebFrame* previous_sibling_web_frame = nullptr; | |
nasko
2015/05/04 17:16:56
Wouldn't RFP::FromRoutingID return nullptr if not
alexmos
2015/05/04 21:18:04
It will, but that ends up in the previous_sibling_
nasko
2015/05/04 22:02:13
Acknowledged.
| |
588 if (RenderFrameProxy* previous_sibling_proxy = | |
589 RenderFrameProxy::FromRoutingID(previous_sibling_routing_id)) { | |
nasko
2015/05/04 17:16:56
nit: Separate the variable declaration and functio
alexmos
2015/05/04 21:18:04
Done.
| |
590 previous_sibling_web_frame = previous_sibling_proxy->web_frame(); | |
591 } | |
592 | |
nasko
2015/05/04 17:16:56
nit: What about (D)CHECKing the condition of MSG_R
alexmos
2015/05/04 21:18:04
That's not necessarily the case, I think -- there
nasko
2015/05/04 22:02:13
Acknowledged.
| |
586 // Create the RenderFrame and WebLocalFrame, linking the two. | 593 // Create the RenderFrame and WebLocalFrame, linking the two. |
587 render_frame = | 594 render_frame = |
588 RenderFrameImpl::Create(parent_proxy->render_view(), routing_id); | 595 RenderFrameImpl::Create(parent_proxy->render_view(), routing_id); |
589 web_frame = parent_web_frame->createLocalChild( | 596 web_frame = parent_web_frame->createLocalChild( |
590 WebString::fromUTF8(replicated_state.name), | 597 WebString::fromUTF8(replicated_state.name), |
591 ContentToWebSandboxFlags(replicated_state.sandbox_flags), render_frame); | 598 ContentToWebSandboxFlags(replicated_state.sandbox_flags), render_frame, |
599 previous_sibling_web_frame); | |
592 } else { | 600 } else { |
593 RenderFrameProxy* proxy = | 601 RenderFrameProxy* proxy = |
594 RenderFrameProxy::FromRoutingID(proxy_routing_id); | 602 RenderFrameProxy::FromRoutingID(proxy_routing_id); |
595 CHECK(proxy); | 603 CHECK(proxy); |
596 render_frame = RenderFrameImpl::Create(proxy->render_view(), routing_id); | 604 render_frame = RenderFrameImpl::Create(proxy->render_view(), routing_id); |
597 web_frame = blink::WebLocalFrame::create(render_frame); | 605 web_frame = blink::WebLocalFrame::create(render_frame); |
598 render_frame->proxy_routing_id_ = proxy_routing_id; | 606 render_frame->proxy_routing_id_ = proxy_routing_id; |
599 web_frame->initializeToReplaceRemoteFrame( | 607 web_frame->initializeToReplaceRemoteFrame( |
600 proxy->web_frame(), WebString::fromUTF8(replicated_state.name), | 608 proxy->web_frame(), WebString::fromUTF8(replicated_state.name), |
601 ContentToWebSandboxFlags(replicated_state.sandbox_flags)); | 609 ContentToWebSandboxFlags(replicated_state.sandbox_flags)); |
(...skipping 4236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4838 #elif defined(ENABLE_BROWSER_CDMS) | 4846 #elif defined(ENABLE_BROWSER_CDMS) |
4839 cdm_manager_, | 4847 cdm_manager_, |
4840 #endif | 4848 #endif |
4841 this); | 4849 this); |
4842 } | 4850 } |
4843 | 4851 |
4844 return cdm_factory_; | 4852 return cdm_factory_; |
4845 } | 4853 } |
4846 | 4854 |
4847 } // namespace content | 4855 } // namespace content |
OLD | NEW |