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