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

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

Issue 1635873003: Replicating WebFrame::uniqueName across renderers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dump-render-tree3
Patch Set: Fixing fallout from the new assert in FrameTree.cpp. Created 4 years, 10 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
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 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 RenderFrameProxy* previous_sibling_proxy = 864 RenderFrameProxy* previous_sibling_proxy =
865 RenderFrameProxy::FromRoutingID(previous_sibling_routing_id); 865 RenderFrameProxy::FromRoutingID(previous_sibling_routing_id);
866 if (previous_sibling_proxy) 866 if (previous_sibling_proxy)
867 previous_sibling_web_frame = previous_sibling_proxy->web_frame(); 867 previous_sibling_web_frame = previous_sibling_proxy->web_frame();
868 868
869 // Create the RenderFrame and WebLocalFrame, linking the two. 869 // Create the RenderFrame and WebLocalFrame, linking the two.
870 render_frame = 870 render_frame =
871 RenderFrameImpl::Create(parent_proxy->render_view(), routing_id); 871 RenderFrameImpl::Create(parent_proxy->render_view(), routing_id);
872 web_frame = parent_web_frame->createLocalChild( 872 web_frame = parent_web_frame->createLocalChild(
873 replicated_state.scope, WebString::fromUTF8(replicated_state.name), 873 replicated_state.scope, WebString::fromUTF8(replicated_state.name),
874 WebString::fromUTF8(replicated_state.unique_name),
874 replicated_state.sandbox_flags, render_frame, 875 replicated_state.sandbox_flags, render_frame,
875 previous_sibling_web_frame, frame_owner_properties); 876 previous_sibling_web_frame, frame_owner_properties);
876 877
877 // The RenderFrame is created and inserted into the frame tree in the above 878 // The RenderFrame is created and inserted into the frame tree in the above
878 // call to createLocalChild. 879 // call to createLocalChild.
879 render_frame->in_frame_tree_ = true; 880 render_frame->in_frame_tree_ = true;
880 } else { 881 } else {
881 RenderFrameProxy* proxy = 882 RenderFrameProxy* proxy =
882 RenderFrameProxy::FromRoutingID(proxy_routing_id); 883 RenderFrameProxy::FromRoutingID(proxy_routing_id);
883 // The remote frame could've been detached while the remote-to-local 884 // The remote frame could've been detached while the remote-to-local
(...skipping 1757 matching lines...) Expand 10 before | Expand all | Expand 10 after
2641 if (!navigation_state->request_committed()) { 2642 if (!navigation_state->request_committed()) {
2642 Send(new FrameHostMsg_DidAccessInitialDocument(routing_id_)); 2643 Send(new FrameHostMsg_DidAccessInitialDocument(routing_id_));
2643 } 2644 }
2644 } 2645 }
2645 } 2646 }
2646 2647
2647 blink::WebFrame* RenderFrameImpl::createChildFrame( 2648 blink::WebFrame* RenderFrameImpl::createChildFrame(
2648 blink::WebLocalFrame* parent, 2649 blink::WebLocalFrame* parent,
2649 blink::WebTreeScopeType scope, 2650 blink::WebTreeScopeType scope,
2650 const blink::WebString& name, 2651 const blink::WebString& name,
2652 const blink::WebString& unique_name,
2651 blink::WebSandboxFlags sandbox_flags, 2653 blink::WebSandboxFlags sandbox_flags,
2652 const blink::WebFrameOwnerProperties& frameOwnerProperties) { 2654 const blink::WebFrameOwnerProperties& frame_owner_properties) {
2653 // Synchronously notify the browser of a child frame creation to get the 2655 // Synchronously notify the browser of a child frame creation to get the
2654 // routing_id for the RenderFrame. 2656 // routing_id for the RenderFrame.
2655 int child_routing_id = MSG_ROUTING_NONE; 2657 int child_routing_id = MSG_ROUTING_NONE;
2656 Send(new FrameHostMsg_CreateChildFrame( 2658 FrameHostMsg_CreateChildFrame_Params params;
2657 routing_id_, scope, base::UTF16ToUTF8(base::StringPiece16(name)), 2659 params.parent_routing_id = routing_id_;
2658 sandbox_flags, frameOwnerProperties, &child_routing_id)); 2660 params.scope = scope;
2661 params.frame_name = base::UTF16ToUTF8(base::StringPiece16(name));
2662 params.frame_unique_name =
2663 base::UTF16ToUTF8(base::StringPiece16(unique_name));
2664 params.sandbox_flags = sandbox_flags;
2665 params.frame_owner_properties = frame_owner_properties;
2666 Send(new FrameHostMsg_CreateChildFrame(params, &child_routing_id));
2659 2667
2660 // Allocation of routing id failed, so we can't create a child frame. This can 2668 // Allocation of routing id failed, so we can't create a child frame. This can
2661 // happen if this RenderFrameImpl's IPCs are being filtered when in swapped 2669 // happen if this RenderFrameImpl's IPCs are being filtered when in swapped
2662 // out state or synchronous IPC message above has failed. 2670 // out state or synchronous IPC message above has failed.
2663 if (child_routing_id == MSG_ROUTING_NONE) { 2671 if (child_routing_id == MSG_ROUTING_NONE) {
2664 NOTREACHED() << "Failed to allocate routing id for child frame."; 2672 NOTREACHED() << "Failed to allocate routing id for child frame.";
2665 return nullptr; 2673 return nullptr;
2666 } 2674 }
2667 2675
2668 // This method is always called by local frames, never remote frames. 2676 // This method is always called by local frames, never remote frames.
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
2762 2770
2763 void RenderFrameImpl::willClose(blink::WebFrame* frame) { 2771 void RenderFrameImpl::willClose(blink::WebFrame* frame) {
2764 DCHECK(!frame_ || frame_ == frame); 2772 DCHECK(!frame_ || frame_ == frame);
2765 2773
2766 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, FrameWillClose()); 2774 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, FrameWillClose());
2767 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(), 2775 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(),
2768 FrameWillClose(frame)); 2776 FrameWillClose(frame));
2769 } 2777 }
2770 2778
2771 void RenderFrameImpl::didChangeName(blink::WebLocalFrame* frame, 2779 void RenderFrameImpl::didChangeName(blink::WebLocalFrame* frame,
2772 const blink::WebString& name) { 2780 const blink::WebString& name,
2781 const blink::WebString& unique_name) {
2773 DCHECK(!frame_ || frame_ == frame); 2782 DCHECK(!frame_ || frame_ == frame);
2774 2783
2775 // TODO(alexmos): According to https://crbug.com/169110, sending window.name 2784 // TODO(alexmos): According to https://crbug.com/169110, sending window.name
2776 // updates may have performance implications for benchmarks like SunSpider. 2785 // updates may have performance implications for benchmarks like SunSpider.
2777 // For now, send these updates only for --site-per-process, which needs to 2786 // For now, send these updates only for --site-per-process, which needs to
2778 // replicate frame names to frame proxies, and when 2787 // replicate frame names to frame proxies, and when
2779 // |report_frame_name_changes| is set (used by <webview>). If needed, this 2788 // |report_frame_name_changes| is set (used by <webview>). If needed, this
2780 // can be optimized further by only sending the update if there are any 2789 // can be optimized further by only sending the update if there are any
2781 // remote frames in the frame tree, or delaying and batching up IPCs if 2790 // remote frames in the frame tree, or delaying and batching up IPCs if
2782 // updates are happening too frequently. 2791 // updates are happening too frequently.
2783 if (SiteIsolationPolicy::AreCrossProcessFramesPossible() || 2792 if (SiteIsolationPolicy::AreCrossProcessFramesPossible() ||
2784 render_view_->renderer_preferences_.report_frame_name_changes) { 2793 render_view_->renderer_preferences_.report_frame_name_changes) {
2785 Send(new FrameHostMsg_DidChangeName( 2794 Send(new FrameHostMsg_DidChangeName(
2786 routing_id_, base::UTF16ToUTF8(base::StringPiece16(name)))); 2795 routing_id_, base::UTF16ToUTF8(base::StringPiece16(name)),
2796 base::UTF16ToUTF8(base::StringPiece16(unique_name))));
2787 } 2797 }
2788 } 2798 }
2789 2799
2790 void RenderFrameImpl::didEnforceStrictMixedContentChecking() { 2800 void RenderFrameImpl::didEnforceStrictMixedContentChecking() {
2791 Send(new FrameHostMsg_EnforceStrictMixedContentChecking(routing_id_)); 2801 Send(new FrameHostMsg_EnforceStrictMixedContentChecking(routing_id_));
2792 } 2802 }
2793 2803
2794 void RenderFrameImpl::didChangeSandboxFlags(blink::WebFrame* child_frame, 2804 void RenderFrameImpl::didChangeSandboxFlags(blink::WebFrame* child_frame,
2795 blink::WebSandboxFlags flags) { 2805 blink::WebSandboxFlags flags) {
2796 Send(new FrameHostMsg_DidChangeSandboxFlags( 2806 Send(new FrameHostMsg_DidChangeSandboxFlags(
(...skipping 3328 matching lines...) Expand 10 before | Expand all | Expand 10 after
6125 int match_count, 6135 int match_count,
6126 int ordinal, 6136 int ordinal,
6127 const WebRect& selection_rect, 6137 const WebRect& selection_rect,
6128 bool final_status_update) { 6138 bool final_status_update) {
6129 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, 6139 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count,
6130 selection_rect, ordinal, 6140 selection_rect, ordinal,
6131 final_status_update)); 6141 final_status_update));
6132 } 6142 }
6133 6143
6134 } // namespace content 6144 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698