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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 // SecurityContext. This is needed to ensure that sandbox flags are inherited | 235 // SecurityContext. This is needed to ensure that sandbox flags are inherited |
234 // properly if this proxy ever parents a local frame. The proxy's FrameOwner | 236 // properly if this proxy ever parents a local frame. The proxy's FrameOwner |
235 // flags are also updated here with the caveat that the FrameOwner won't learn | 237 // flags are also updated here with the caveat that the FrameOwner won't learn |
236 // about updates to its flags until they take effect. | 238 // about updates to its flags until they take effect. |
237 void RenderFrameProxy::OnDidUpdateSandboxFlags(blink::WebSandboxFlags flags) { | 239 void RenderFrameProxy::OnDidUpdateSandboxFlags(blink::WebSandboxFlags flags) { |
238 web_frame_->setReplicatedSandboxFlags(flags); | 240 web_frame_->setReplicatedSandboxFlags(flags); |
239 web_frame_->setFrameOwnerSandboxFlags(flags); | 241 web_frame_->setFrameOwnerSandboxFlags(flags); |
240 } | 242 } |
241 | 243 |
242 bool RenderFrameProxy::OnMessageReceived(const IPC::Message& msg) { | 244 bool RenderFrameProxy::OnMessageReceived(const IPC::Message& msg) { |
| 245 // Forward Page IPCs to the RenderView. |
| 246 if ((IPC_MESSAGE_CLASS(msg) == PageMsgStart) && render_view()) |
| 247 return render_view()->OnMessageReceived(msg); |
| 248 |
243 bool handled = true; | 249 bool handled = true; |
244 IPC_BEGIN_MESSAGE_MAP(RenderFrameProxy, msg) | 250 IPC_BEGIN_MESSAGE_MAP(RenderFrameProxy, msg) |
245 IPC_MESSAGE_HANDLER(FrameMsg_DeleteProxy, OnDeleteProxy) | 251 IPC_MESSAGE_HANDLER(FrameMsg_DeleteProxy, OnDeleteProxy) |
246 IPC_MESSAGE_HANDLER(FrameMsg_ChildFrameProcessGone, OnChildFrameProcessGone) | 252 IPC_MESSAGE_HANDLER(FrameMsg_ChildFrameProcessGone, OnChildFrameProcessGone) |
247 IPC_MESSAGE_HANDLER(FrameMsg_SetChildFrameSurface, OnSetChildFrameSurface) | 253 IPC_MESSAGE_HANDLER(FrameMsg_SetChildFrameSurface, OnSetChildFrameSurface) |
248 IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener) | 254 IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener) |
249 IPC_MESSAGE_HANDLER(FrameMsg_DidStartLoading, OnDidStartLoading) | 255 IPC_MESSAGE_HANDLER(FrameMsg_DidStartLoading, OnDidStartLoading) |
250 IPC_MESSAGE_HANDLER(FrameMsg_DidStopLoading, OnDidStopLoading) | 256 IPC_MESSAGE_HANDLER(FrameMsg_DidStopLoading, OnDidStopLoading) |
251 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) | 257 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) |
252 IPC_MESSAGE_HANDLER(FrameMsg_DispatchLoad, OnDispatchLoad) | 258 IPC_MESSAGE_HANDLER(FrameMsg_DispatchLoad, OnDispatchLoad) |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 blink::WebLocalFrame* source) { | 472 blink::WebLocalFrame* source) { |
467 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); | 473 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); |
468 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); | 474 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); |
469 } | 475 } |
470 | 476 |
471 void RenderFrameProxy::frameFocused() { | 477 void RenderFrameProxy::frameFocused() { |
472 Send(new FrameHostMsg_FrameFocused(routing_id_)); | 478 Send(new FrameHostMsg_FrameFocused(routing_id_)); |
473 } | 479 } |
474 | 480 |
475 } // namespace | 481 } // namespace |
OLD | NEW |