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 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" | 170 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" |
170 #include "third_party/WebKit/public/platform/WebString.h" | 171 #include "third_party/WebKit/public/platform/WebString.h" |
171 #include "third_party/WebKit/public/platform/WebURL.h" | 172 #include "third_party/WebKit/public/platform/WebURL.h" |
172 #include "third_party/WebKit/public/platform/WebURLError.h" | 173 #include "third_party/WebKit/public/platform/WebURLError.h" |
173 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 174 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
174 #include "third_party/WebKit/public/platform/WebVector.h" | 175 #include "third_party/WebKit/public/platform/WebVector.h" |
175 #include "third_party/WebKit/public/web/WebColorSuggestion.h" | 176 #include "third_party/WebKit/public/web/WebColorSuggestion.h" |
176 #include "third_party/WebKit/public/web/WebConsoleMessage.h" | 177 #include "third_party/WebKit/public/web/WebConsoleMessage.h" |
177 #include "third_party/WebKit/public/web/WebDocument.h" | 178 #include "third_party/WebKit/public/web/WebDocument.h" |
178 #include "third_party/WebKit/public/web/WebFindOptions.h" | 179 #include "third_party/WebKit/public/web/WebFindOptions.h" |
| 180 #include "third_party/WebKit/public/web/WebFrameOwnerProperties.h" |
179 #include "third_party/WebKit/public/web/WebFrameSerializer.h" | 181 #include "third_party/WebKit/public/web/WebFrameSerializer.h" |
180 #include "third_party/WebKit/public/web/WebFrameSerializerCacheControlPolicy.h" | 182 #include "third_party/WebKit/public/web/WebFrameSerializerCacheControlPolicy.h" |
181 #include "third_party/WebKit/public/web/WebFrameWidget.h" | 183 #include "third_party/WebKit/public/web/WebFrameWidget.h" |
182 #include "third_party/WebKit/public/web/WebKit.h" | 184 #include "third_party/WebKit/public/web/WebKit.h" |
183 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 185 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
184 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" | 186 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" |
185 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" | 187 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" |
186 #include "third_party/WebKit/public/web/WebPlugin.h" | 188 #include "third_party/WebKit/public/web/WebPlugin.h" |
187 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 189 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
188 #include "third_party/WebKit/public/web/WebPluginDocument.h" | 190 #include "third_party/WebKit/public/web/WebPluginDocument.h" |
(...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2121 void RenderFrameImpl::OnUpdateOpener(int opener_routing_id) { | 2123 void RenderFrameImpl::OnUpdateOpener(int opener_routing_id) { |
2122 WebFrame* opener = ResolveOpener(opener_routing_id, nullptr); | 2124 WebFrame* opener = ResolveOpener(opener_routing_id, nullptr); |
2123 frame_->setOpener(opener); | 2125 frame_->setOpener(opener); |
2124 } | 2126 } |
2125 | 2127 |
2126 void RenderFrameImpl::OnDidUpdateSandboxFlags(blink::WebSandboxFlags flags) { | 2128 void RenderFrameImpl::OnDidUpdateSandboxFlags(blink::WebSandboxFlags flags) { |
2127 frame_->setFrameOwnerSandboxFlags(flags); | 2129 frame_->setFrameOwnerSandboxFlags(flags); |
2128 } | 2130 } |
2129 | 2131 |
2130 void RenderFrameImpl::OnSetFrameOwnerProperties( | 2132 void RenderFrameImpl::OnSetFrameOwnerProperties( |
2131 const blink::WebFrameOwnerProperties& frame_owner_properties) { | 2133 const FrameOwnerProperties& frame_owner_properties) { |
2132 DCHECK(frame_); | 2134 DCHECK(frame_); |
2133 frame_->setFrameOwnerProperties(frame_owner_properties); | 2135 frame_->setFrameOwnerProperties( |
| 2136 frame_owner_properties.ToWebFrameOwnerProperties()); |
2134 } | 2137 } |
2135 | 2138 |
2136 void RenderFrameImpl::OnAdvanceFocus(blink::WebFocusType type, | 2139 void RenderFrameImpl::OnAdvanceFocus(blink::WebFocusType type, |
2137 int32_t source_routing_id) { | 2140 int32_t source_routing_id) { |
2138 RenderFrameProxy* source_frame = | 2141 RenderFrameProxy* source_frame = |
2139 RenderFrameProxy::FromRoutingID(source_routing_id); | 2142 RenderFrameProxy::FromRoutingID(source_routing_id); |
2140 if (!source_frame) | 2143 if (!source_frame) |
2141 return; | 2144 return; |
2142 | 2145 |
2143 render_view_->webview()->advanceFocusAcrossFrames( | 2146 render_view_->webview()->advanceFocusAcrossFrames( |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2789 // Synchronously notify the browser of a child frame creation to get the | 2792 // Synchronously notify the browser of a child frame creation to get the |
2790 // routing_id for the RenderFrame. | 2793 // routing_id for the RenderFrame. |
2791 int child_routing_id = MSG_ROUTING_NONE; | 2794 int child_routing_id = MSG_ROUTING_NONE; |
2792 FrameHostMsg_CreateChildFrame_Params params; | 2795 FrameHostMsg_CreateChildFrame_Params params; |
2793 params.parent_routing_id = routing_id_; | 2796 params.parent_routing_id = routing_id_; |
2794 params.scope = scope; | 2797 params.scope = scope; |
2795 params.frame_name = base::UTF16ToUTF8(base::StringPiece16(name)); | 2798 params.frame_name = base::UTF16ToUTF8(base::StringPiece16(name)); |
2796 params.frame_unique_name = | 2799 params.frame_unique_name = |
2797 base::UTF16ToUTF8(base::StringPiece16(unique_name)); | 2800 base::UTF16ToUTF8(base::StringPiece16(unique_name)); |
2798 params.sandbox_flags = sandbox_flags; | 2801 params.sandbox_flags = sandbox_flags; |
2799 params.frame_owner_properties = frame_owner_properties; | 2802 params.frame_owner_properties = FrameOwnerProperties(frame_owner_properties); |
2800 Send(new FrameHostMsg_CreateChildFrame(params, &child_routing_id)); | 2803 Send(new FrameHostMsg_CreateChildFrame(params, &child_routing_id)); |
2801 | 2804 |
2802 // Allocation of routing id failed, so we can't create a child frame. This can | 2805 // Allocation of routing id failed, so we can't create a child frame. This can |
2803 // happen if the synchronous IPC message above has failed. | 2806 // happen if the synchronous IPC message above has failed. |
2804 if (child_routing_id == MSG_ROUTING_NONE) { | 2807 if (child_routing_id == MSG_ROUTING_NONE) { |
2805 NOTREACHED() << "Failed to allocate routing id for child frame."; | 2808 NOTREACHED() << "Failed to allocate routing id for child frame."; |
2806 return nullptr; | 2809 return nullptr; |
2807 } | 2810 } |
2808 | 2811 |
2809 // This method is always called by local frames, never remote frames. | 2812 // This method is always called by local frames, never remote frames. |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2948 header.header_value = base::UTF16ToUTF8(base::StringPiece16(header_value)); | 2951 header.header_value = base::UTF16ToUTF8(base::StringPiece16(header_value)); |
2949 header.type = type; | 2952 header.type = type; |
2950 header.source = source; | 2953 header.source = source; |
2951 Send(new FrameHostMsg_DidAddContentSecurityPolicy(routing_id_, header)); | 2954 Send(new FrameHostMsg_DidAddContentSecurityPolicy(routing_id_, header)); |
2952 } | 2955 } |
2953 | 2956 |
2954 void RenderFrameImpl::didChangeFrameOwnerProperties( | 2957 void RenderFrameImpl::didChangeFrameOwnerProperties( |
2955 blink::WebFrame* child_frame, | 2958 blink::WebFrame* child_frame, |
2956 const blink::WebFrameOwnerProperties& frame_owner_properties) { | 2959 const blink::WebFrameOwnerProperties& frame_owner_properties) { |
2957 Send(new FrameHostMsg_DidChangeFrameOwnerProperties( | 2960 Send(new FrameHostMsg_DidChangeFrameOwnerProperties( |
2958 routing_id_, GetRoutingIdForFrameOrProxy(child_frame), | 2961 routing_id_, GetRoutingIdForFrameOrProxy(child_frame), |
2959 frame_owner_properties)); | 2962 FrameOwnerProperties(frame_owner_properties))); |
2960 } | 2963 } |
2961 | 2964 |
2962 void RenderFrameImpl::didMatchCSS( | 2965 void RenderFrameImpl::didMatchCSS( |
2963 blink::WebLocalFrame* frame, | 2966 blink::WebLocalFrame* frame, |
2964 const blink::WebVector<blink::WebString>& newly_matching_selectors, | 2967 const blink::WebVector<blink::WebString>& newly_matching_selectors, |
2965 const blink::WebVector<blink::WebString>& stopped_matching_selectors) { | 2968 const blink::WebVector<blink::WebString>& stopped_matching_selectors) { |
2966 DCHECK_EQ(frame_, frame); | 2969 DCHECK_EQ(frame_, frame); |
2967 | 2970 |
2968 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, | 2971 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, |
2969 DidMatchCSS(newly_matching_selectors, | 2972 DidMatchCSS(newly_matching_selectors, |
(...skipping 3364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6334 // event target. Potentially a Pepper plugin will receive the event. | 6337 // event target. Potentially a Pepper plugin will receive the event. |
6335 // In order to tell whether a plugin gets the last mouse event and which it | 6338 // In order to tell whether a plugin gets the last mouse event and which it |
6336 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6339 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6337 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6340 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6338 // |pepper_last_mouse_event_target_|. | 6341 // |pepper_last_mouse_event_target_|. |
6339 pepper_last_mouse_event_target_ = nullptr; | 6342 pepper_last_mouse_event_target_ = nullptr; |
6340 #endif | 6343 #endif |
6341 } | 6344 } |
6342 | 6345 |
6343 } // namespace content | 6346 } // namespace content |
OLD | NEW |