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

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

Issue 2146803004: Create a content::FrameOwnerProperties struct for IPC transport of WebFrameOwnerProperties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Transport Created 4 years, 5 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "content/child/web_url_loader_impl.h" 46 #include "content/child/web_url_loader_impl.h"
47 #include "content/child/web_url_request_util.h" 47 #include "content/child/web_url_request_util.h"
48 #include "content/child/webmessageportchannel_impl.h" 48 #include "content/child/webmessageportchannel_impl.h"
49 #include "content/child/websocket_bridge.h" 49 #include "content/child/websocket_bridge.h"
50 #include "content/child/weburlresponse_extradata_impl.h" 50 #include "content/child/weburlresponse_extradata_impl.h"
51 #include "content/common/accessibility_messages.h" 51 #include "content/common/accessibility_messages.h"
52 #include "content/common/clipboard_messages.h" 52 #include "content/common/clipboard_messages.h"
53 #include "content/common/content_constants_internal.h" 53 #include "content/common/content_constants_internal.h"
54 #include "content/common/content_security_policy_header.h" 54 #include "content/common/content_security_policy_header.h"
55 #include "content/common/frame_messages.h" 55 #include "content/common/frame_messages.h"
56 #include "content/common/frame_owner_properties.h"
56 #include "content/common/frame_replication_state.h" 57 #include "content/common/frame_replication_state.h"
57 #include "content/common/gpu/client/context_provider_command_buffer.h" 58 #include "content/common/gpu/client/context_provider_command_buffer.h"
58 #include "content/common/input_messages.h" 59 #include "content/common/input_messages.h"
59 #include "content/common/navigation_params.h" 60 #include "content/common/navigation_params.h"
60 #include "content/common/page_messages.h" 61 #include "content/common/page_messages.h"
61 #include "content/common/savable_subframe.h" 62 #include "content/common/savable_subframe.h"
62 #include "content/common/service_worker/service_worker_types.h" 63 #include "content/common/service_worker/service_worker_types.h"
63 #include "content/common/site_isolation_policy.h" 64 #include "content/common/site_isolation_policy.h"
64 #include "content/common/ssl_status_serialization.h" 65 #include "content/common/ssl_status_serialization.h"
65 #include "content/common/swapped_out_messages.h" 66 #include "content/common/swapped_out_messages.h"
(...skipping 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after
2128 void RenderFrameImpl::OnUpdateOpener(int opener_routing_id) { 2129 void RenderFrameImpl::OnUpdateOpener(int opener_routing_id) {
2129 WebFrame* opener = ResolveOpener(opener_routing_id, nullptr); 2130 WebFrame* opener = ResolveOpener(opener_routing_id, nullptr);
2130 frame_->setOpener(opener); 2131 frame_->setOpener(opener);
2131 } 2132 }
2132 2133
2133 void RenderFrameImpl::OnDidUpdateSandboxFlags(blink::WebSandboxFlags flags) { 2134 void RenderFrameImpl::OnDidUpdateSandboxFlags(blink::WebSandboxFlags flags) {
2134 frame_->setFrameOwnerSandboxFlags(flags); 2135 frame_->setFrameOwnerSandboxFlags(flags);
2135 } 2136 }
2136 2137
2137 void RenderFrameImpl::OnSetFrameOwnerProperties( 2138 void RenderFrameImpl::OnSetFrameOwnerProperties(
2138 const blink::WebFrameOwnerProperties& frame_owner_properties) { 2139 const FrameOwnerProperties& frame_owner_properties) {
2139 DCHECK(frame_); 2140 DCHECK(frame_);
2140 frame_->setFrameOwnerProperties(frame_owner_properties); 2141 frame_->setFrameOwnerProperties(
2142 frame_owner_properties.ToWebFrameOwnerProperties());
2141 } 2143 }
2142 2144
2143 void RenderFrameImpl::OnAdvanceFocus(blink::WebFocusType type, 2145 void RenderFrameImpl::OnAdvanceFocus(blink::WebFocusType type,
2144 int32_t source_routing_id) { 2146 int32_t source_routing_id) {
2145 RenderFrameProxy* source_frame = 2147 RenderFrameProxy* source_frame =
2146 RenderFrameProxy::FromRoutingID(source_routing_id); 2148 RenderFrameProxy::FromRoutingID(source_routing_id);
2147 if (!source_frame) 2149 if (!source_frame)
2148 return; 2150 return;
2149 2151
2150 render_view_->webview()->advanceFocusAcrossFrames( 2152 render_view_->webview()->advanceFocusAcrossFrames(
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
2796 // Synchronously notify the browser of a child frame creation to get the 2798 // Synchronously notify the browser of a child frame creation to get the
2797 // routing_id for the RenderFrame. 2799 // routing_id for the RenderFrame.
2798 int child_routing_id = MSG_ROUTING_NONE; 2800 int child_routing_id = MSG_ROUTING_NONE;
2799 FrameHostMsg_CreateChildFrame_Params params; 2801 FrameHostMsg_CreateChildFrame_Params params;
2800 params.parent_routing_id = routing_id_; 2802 params.parent_routing_id = routing_id_;
2801 params.scope = scope; 2803 params.scope = scope;
2802 params.frame_name = base::UTF16ToUTF8(base::StringPiece16(name)); 2804 params.frame_name = base::UTF16ToUTF8(base::StringPiece16(name));
2803 params.frame_unique_name = 2805 params.frame_unique_name =
2804 base::UTF16ToUTF8(base::StringPiece16(unique_name)); 2806 base::UTF16ToUTF8(base::StringPiece16(unique_name));
2805 params.sandbox_flags = sandbox_flags; 2807 params.sandbox_flags = sandbox_flags;
2806 params.frame_owner_properties = frame_owner_properties; 2808 params.frame_owner_properties = FrameOwnerProperties(frame_owner_properties);
2807 Send(new FrameHostMsg_CreateChildFrame(params, &child_routing_id)); 2809 Send(new FrameHostMsg_CreateChildFrame(params, &child_routing_id));
2808 2810
2809 // Allocation of routing id failed, so we can't create a child frame. This can 2811 // Allocation of routing id failed, so we can't create a child frame. This can
2810 // happen if the synchronous IPC message above has failed. 2812 // happen if the synchronous IPC message above has failed.
2811 if (child_routing_id == MSG_ROUTING_NONE) { 2813 if (child_routing_id == MSG_ROUTING_NONE) {
2812 NOTREACHED() << "Failed to allocate routing id for child frame."; 2814 NOTREACHED() << "Failed to allocate routing id for child frame.";
2813 return nullptr; 2815 return nullptr;
2814 } 2816 }
2815 2817
2816 // This method is always called by local frames, never remote frames. 2818 // This method is always called by local frames, never remote frames.
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
2954 header.header_value = base::UTF16ToUTF8(base::StringPiece16(header_value)); 2956 header.header_value = base::UTF16ToUTF8(base::StringPiece16(header_value));
2955 header.type = type; 2957 header.type = type;
2956 header.source = source; 2958 header.source = source;
2957 Send(new FrameHostMsg_DidAddContentSecurityPolicy(routing_id_, header)); 2959 Send(new FrameHostMsg_DidAddContentSecurityPolicy(routing_id_, header));
2958 } 2960 }
2959 2961
2960 void RenderFrameImpl::didChangeFrameOwnerProperties( 2962 void RenderFrameImpl::didChangeFrameOwnerProperties(
2961 blink::WebFrame* child_frame, 2963 blink::WebFrame* child_frame,
2962 const blink::WebFrameOwnerProperties& frame_owner_properties) { 2964 const blink::WebFrameOwnerProperties& frame_owner_properties) {
2963 Send(new FrameHostMsg_DidChangeFrameOwnerProperties( 2965 Send(new FrameHostMsg_DidChangeFrameOwnerProperties(
2964 routing_id_, GetRoutingIdForFrameOrProxy(child_frame), 2966 routing_id_, GetRoutingIdForFrameOrProxy(child_frame),
2965 frame_owner_properties)); 2967 FrameOwnerProperties(frame_owner_properties)));
2966 } 2968 }
2967 2969
2968 void RenderFrameImpl::didMatchCSS( 2970 void RenderFrameImpl::didMatchCSS(
2969 blink::WebLocalFrame* frame, 2971 blink::WebLocalFrame* frame,
2970 const blink::WebVector<blink::WebString>& newly_matching_selectors, 2972 const blink::WebVector<blink::WebString>& newly_matching_selectors,
2971 const blink::WebVector<blink::WebString>& stopped_matching_selectors) { 2973 const blink::WebVector<blink::WebString>& stopped_matching_selectors) {
2972 DCHECK_EQ(frame_, frame); 2974 DCHECK_EQ(frame_, frame);
2973 2975
2974 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, 2976 FOR_EACH_OBSERVER(RenderFrameObserver, observers_,
2975 DidMatchCSS(newly_matching_selectors, 2977 DidMatchCSS(newly_matching_selectors,
(...skipping 3333 matching lines...) Expand 10 before | Expand all | Expand 10 after
6309 // event target. Potentially a Pepper plugin will receive the event. 6311 // event target. Potentially a Pepper plugin will receive the event.
6310 // In order to tell whether a plugin gets the last mouse event and which it 6312 // In order to tell whether a plugin gets the last mouse event and which it
6311 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6313 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6312 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6314 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6313 // |pepper_last_mouse_event_target_|. 6315 // |pepper_last_mouse_event_target_|.
6314 pepper_last_mouse_event_target_ = nullptr; 6316 pepper_last_mouse_event_target_ = nullptr;
6315 #endif 6317 #endif
6316 } 6318 }
6317 6319
6318 } // namespace content 6320 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698