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 #ifndef CONTENT_RENDERER_RENDER_FRAME_PROXY_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_FRAME_PROXY_H_ |
6 #define CONTENT_RENDERER_RENDER_FRAME_PROXY_H_ | 6 #define CONTENT_RENDERER_RENDER_FRAME_PROXY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 #include "ipc/ipc_listener.h" | 11 #include "ipc/ipc_listener.h" |
12 #include "ipc/ipc_sender.h" | 12 #include "ipc/ipc_sender.h" |
13 | 13 |
14 #include "third_party/WebKit/public/web/WebRemoteFrame.h" | 14 #include "third_party/WebKit/public/web/WebRemoteFrame.h" |
15 #include "third_party/WebKit/public/web/WebRemoteFrameClient.h" | 15 #include "third_party/WebKit/public/web/WebRemoteFrameClient.h" |
16 | 16 |
17 struct FrameMsg_BuffersSwapped_Params; | 17 struct FrameMsg_BuffersSwapped_Params; |
18 struct FrameMsg_CompositorFrameSwapped_Params; | 18 struct FrameMsg_CompositorFrameSwapped_Params; |
19 | 19 |
20 namespace blink { | 20 namespace blink { |
21 class WebInputEvent; | 21 class WebInputEvent; |
22 } | 22 } |
23 | 23 |
24 namespace content { | 24 namespace content { |
25 | 25 |
26 class ChildFrameCompositingHelper; | 26 class ChildFrameCompositingHelper; |
27 class RenderFrameImpl; | 27 class RenderFrameImpl; |
28 class RenderViewImpl; | 28 class RenderViewImpl; |
| 29 struct FrameReplicationState; |
29 | 30 |
30 // When a page's frames are rendered by multiple processes, each renderer has a | 31 // When a page's frames are rendered by multiple processes, each renderer has a |
31 // full copy of the frame tree. It has full RenderFrames for the frames it is | 32 // full copy of the frame tree. It has full RenderFrames for the frames it is |
32 // responsible for rendering and placeholder objects for frames rendered by | 33 // responsible for rendering and placeholder objects for frames rendered by |
33 // other processes. This class is the renderer-side object for the placeholder. | 34 // other processes. This class is the renderer-side object for the placeholder. |
34 // RenderFrameProxy allows us to keep existing window references valid over | 35 // RenderFrameProxy allows us to keep existing window references valid over |
35 // cross-process navigations and route cross-site asynchronous JavaScript calls, | 36 // cross-process navigations and route cross-site asynchronous JavaScript calls, |
36 // such as postMessage. | 37 // such as postMessage. |
37 // | 38 // |
38 // For now, RenderFrameProxy is created when RenderFrame is swapped out. It | 39 // For now, RenderFrameProxy is created when RenderFrame is swapped out. It |
(...skipping 28 matching lines...) Expand all Loading... |
67 // for example, after a cross-process navigation or after the addition of a | 68 // for example, after a cross-process navigation or after the addition of a |
68 // new frame local to some other process. |routing_id| will be the ID of the | 69 // new frame local to some other process. |routing_id| will be the ID of the |
69 // newly created RenderFrameProxy. |parent_routing_id| is the routing ID of | 70 // newly created RenderFrameProxy. |parent_routing_id| is the routing ID of |
70 // the RenderFrameProxy to which the new frame is parented. | 71 // the RenderFrameProxy to which the new frame is parented. |
71 // |render_view_routing_id| identifies the RenderView to be associated with | 72 // |render_view_routing_id| identifies the RenderView to be associated with |
72 // this frame. | 73 // this frame. |
73 // | 74 // |
74 // |parent_routing_id| always identifies a RenderFrameProxy (never a | 75 // |parent_routing_id| always identifies a RenderFrameProxy (never a |
75 // RenderFrame) because a new child of a local frame should always start out | 76 // RenderFrame) because a new child of a local frame should always start out |
76 // as a frame, not a proxy. | 77 // as a frame, not a proxy. |
77 static RenderFrameProxy* CreateFrameProxy(int routing_id, | 78 static RenderFrameProxy* CreateFrameProxy( |
78 int parent_routing_id, | 79 int routing_id, |
79 int render_view_routing_id); | 80 int parent_routing_id, |
| 81 int render_view_routing_id, |
| 82 const FrameReplicationState& replicated_state); |
80 | 83 |
81 // Returns the RenderFrameProxy for the given routing ID. | 84 // Returns the RenderFrameProxy for the given routing ID. |
82 static RenderFrameProxy* FromRoutingID(int routing_id); | 85 static RenderFrameProxy* FromRoutingID(int routing_id); |
83 | 86 |
84 // Returns the RenderFrameProxy given a WebFrame. | 87 // Returns the RenderFrameProxy given a WebFrame. |
85 static RenderFrameProxy* FromWebFrame(blink::WebFrame* web_frame); | 88 static RenderFrameProxy* FromWebFrame(blink::WebFrame* web_frame); |
86 | 89 |
87 ~RenderFrameProxy() override; | 90 ~RenderFrameProxy() override; |
88 | 91 |
89 // IPC::Sender | 92 // IPC::Sender |
90 bool Send(IPC::Message* msg) override; | 93 bool Send(IPC::Message* msg) override; |
91 | 94 |
92 // Out-of-process child frames receive a signal from RenderWidgetCompositor | 95 // Out-of-process child frames receive a signal from RenderWidgetCompositor |
93 // when a compositor frame has committed. | 96 // when a compositor frame has committed. |
94 void DidCommitCompositorFrame(); | 97 void DidCommitCompositorFrame(); |
95 | 98 |
| 99 // Pass replicated information, such as security origin, to this |
| 100 // RenderFrameProxy's WebRemoteFrame. |
| 101 void SetReplicatedState(const FrameReplicationState& state); |
| 102 |
96 int routing_id() { return routing_id_; } | 103 int routing_id() { return routing_id_; } |
97 RenderViewImpl* render_view() { return render_view_; } | 104 RenderViewImpl* render_view() { return render_view_; } |
98 blink::WebRemoteFrame* web_frame() { return web_frame_; } | 105 blink::WebRemoteFrame* web_frame() { return web_frame_; } |
99 | 106 |
100 // blink::WebRemoteFrameClient implementation: | 107 // blink::WebRemoteFrameClient implementation: |
101 virtual void frameDetached(); | 108 virtual void frameDetached(); |
102 virtual void postMessageEvent( | 109 virtual void postMessageEvent( |
103 blink::WebLocalFrame* sourceFrame, | 110 blink::WebLocalFrame* sourceFrame, |
104 blink::WebRemoteFrame* targetFrame, | 111 blink::WebRemoteFrame* targetFrame, |
105 blink::WebSecurityOrigin target, | 112 blink::WebSecurityOrigin target, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 scoped_refptr<ChildFrameCompositingHelper> compositing_helper_; | 144 scoped_refptr<ChildFrameCompositingHelper> compositing_helper_; |
138 | 145 |
139 RenderViewImpl* render_view_; | 146 RenderViewImpl* render_view_; |
140 | 147 |
141 DISALLOW_COPY_AND_ASSIGN(RenderFrameProxy); | 148 DISALLOW_COPY_AND_ASSIGN(RenderFrameProxy); |
142 }; | 149 }; |
143 | 150 |
144 } // namespace | 151 } // namespace |
145 | 152 |
146 #endif // CONTENT_RENDERER_RENDER_FRAME_PROXY_H_ | 153 #endif // CONTENT_RENDERER_RENDER_FRAME_PROXY_H_ |
OLD | NEW |