OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_proxy.h" | 5 #include "content/renderer/render_frame_proxy.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <map> | 8 #include <map> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
13 #include "content/child/webmessageportchannel_impl.h" | 13 #include "content/child/webmessageportchannel_impl.h" |
14 #include "content/common/frame_messages.h" | 14 #include "content/common/frame_messages.h" |
15 #include "content/common/frame_replication_state.h" | 15 #include "content/common/frame_replication_state.h" |
16 #include "content/common/input_messages.h" | 16 #include "content/common/input_messages.h" |
| 17 #include "content/common/page_messages.h" |
17 #include "content/common/site_isolation_policy.h" | 18 #include "content/common/site_isolation_policy.h" |
18 #include "content/common/swapped_out_messages.h" | 19 #include "content/common/swapped_out_messages.h" |
19 #include "content/common/view_messages.h" | 20 #include "content/common/view_messages.h" |
20 #include "content/renderer/child_frame_compositing_helper.h" | 21 #include "content/renderer/child_frame_compositing_helper.h" |
21 #include "content/renderer/render_frame_impl.h" | 22 #include "content/renderer/render_frame_impl.h" |
22 #include "content/renderer/render_thread_impl.h" | 23 #include "content/renderer/render_thread_impl.h" |
23 #include "content/renderer/render_view_impl.h" | 24 #include "content/renderer/render_view_impl.h" |
24 #include "content/renderer/render_widget.h" | 25 #include "content/renderer/render_widget.h" |
| 26 #include "ipc/ipc_message_macros.h" |
25 #include "third_party/WebKit/public/platform/URLConversion.h" | 27 #include "third_party/WebKit/public/platform/URLConversion.h" |
26 #include "third_party/WebKit/public/platform/WebString.h" | 28 #include "third_party/WebKit/public/platform/WebString.h" |
27 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 29 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
28 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 30 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
29 #include "third_party/WebKit/public/web/WebView.h" | 31 #include "third_party/WebKit/public/web/WebView.h" |
30 | 32 |
31 namespace content { | 33 namespace content { |
32 | 34 |
33 namespace { | 35 namespace { |
34 | 36 |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 // SecurityContext. This is needed to ensure that sandbox flags are inherited | 246 // SecurityContext. This is needed to ensure that sandbox flags are inherited |
245 // properly if this proxy ever parents a local frame. The proxy's FrameOwner | 247 // properly if this proxy ever parents a local frame. The proxy's FrameOwner |
246 // flags are also updated here with the caveat that the FrameOwner won't learn | 248 // flags are also updated here with the caveat that the FrameOwner won't learn |
247 // about updates to its flags until they take effect. | 249 // about updates to its flags until they take effect. |
248 void RenderFrameProxy::OnDidUpdateSandboxFlags(blink::WebSandboxFlags flags) { | 250 void RenderFrameProxy::OnDidUpdateSandboxFlags(blink::WebSandboxFlags flags) { |
249 web_frame_->setReplicatedSandboxFlags(flags); | 251 web_frame_->setReplicatedSandboxFlags(flags); |
250 web_frame_->setFrameOwnerSandboxFlags(flags); | 252 web_frame_->setFrameOwnerSandboxFlags(flags); |
251 } | 253 } |
252 | 254 |
253 bool RenderFrameProxy::OnMessageReceived(const IPC::Message& msg) { | 255 bool RenderFrameProxy::OnMessageReceived(const IPC::Message& msg) { |
| 256 // Forward Page IPCs to the RenderView. |
| 257 if ((IPC_MESSAGE_CLASS(msg) == PageMsgStart)) { |
| 258 if (render_view()) |
| 259 return render_view()->OnMessageReceived(msg); |
| 260 |
| 261 return false; |
| 262 } |
| 263 |
254 bool handled = true; | 264 bool handled = true; |
255 IPC_BEGIN_MESSAGE_MAP(RenderFrameProxy, msg) | 265 IPC_BEGIN_MESSAGE_MAP(RenderFrameProxy, msg) |
256 IPC_MESSAGE_HANDLER(FrameMsg_DeleteProxy, OnDeleteProxy) | 266 IPC_MESSAGE_HANDLER(FrameMsg_DeleteProxy, OnDeleteProxy) |
257 IPC_MESSAGE_HANDLER(FrameMsg_ChildFrameProcessGone, OnChildFrameProcessGone) | 267 IPC_MESSAGE_HANDLER(FrameMsg_ChildFrameProcessGone, OnChildFrameProcessGone) |
258 IPC_MESSAGE_HANDLER(FrameMsg_SetChildFrameSurface, OnSetChildFrameSurface) | 268 IPC_MESSAGE_HANDLER(FrameMsg_SetChildFrameSurface, OnSetChildFrameSurface) |
259 IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener) | 269 IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener) |
260 IPC_MESSAGE_HANDLER(FrameMsg_DidStartLoading, OnDidStartLoading) | 270 IPC_MESSAGE_HANDLER(FrameMsg_DidStartLoading, OnDidStartLoading) |
261 IPC_MESSAGE_HANDLER(FrameMsg_DidStopLoading, OnDidStopLoading) | 271 IPC_MESSAGE_HANDLER(FrameMsg_DidStopLoading, OnDidStopLoading) |
262 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) | 272 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) |
263 IPC_MESSAGE_HANDLER(FrameMsg_DispatchLoad, OnDispatchLoad) | 273 IPC_MESSAGE_HANDLER(FrameMsg_DispatchLoad, OnDispatchLoad) |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 blink::WebLocalFrame* source) { | 489 blink::WebLocalFrame* source) { |
480 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); | 490 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); |
481 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); | 491 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); |
482 } | 492 } |
483 | 493 |
484 void RenderFrameProxy::frameFocused() { | 494 void RenderFrameProxy::frameFocused() { |
485 Send(new FrameHostMsg_FrameFocused(routing_id_)); | 495 Send(new FrameHostMsg_FrameFocused(routing_id_)); |
486 } | 496 } |
487 | 497 |
488 } // namespace | 498 } // namespace |
OLD | NEW |