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/WebFrameClient.h" | |
15 #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" |
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 content { | 20 namespace content { |
21 | 21 |
22 class ChildFrameCompositingHelper; | 22 class ChildFrameCompositingHelper; |
23 class RenderFrameImpl; | 23 class RenderFrameImpl; |
24 class RenderViewImpl; | 24 class RenderViewImpl; |
25 | 25 |
(...skipping 13 matching lines...) Expand all Loading... |
39 // Long term, RenderFrameProxy will be created to replace the RenderFrame in the | 39 // Long term, RenderFrameProxy will be created to replace the RenderFrame in the |
40 // frame tree and the RenderFrame will be deleted after its unload handler has | 40 // frame tree and the RenderFrame will be deleted after its unload handler has |
41 // finished executing. It will still be responsible for routing IPC messages | 41 // finished executing. It will still be responsible for routing IPC messages |
42 // which are valid for cross-site interactions between frames. | 42 // which are valid for cross-site interactions between frames. |
43 // RenderFrameProxy will be deleted when the node in the frame tree is deleted | 43 // RenderFrameProxy will be deleted when the node in the frame tree is deleted |
44 // or when navigating the frame causes it to return to this process and a new | 44 // or when navigating the frame causes it to return to this process and a new |
45 // RenderFrame is created for it. | 45 // RenderFrame is created for it. |
46 class CONTENT_EXPORT RenderFrameProxy | 46 class CONTENT_EXPORT RenderFrameProxy |
47 : public IPC::Listener, | 47 : public IPC::Listener, |
48 public IPC::Sender, | 48 public IPC::Sender, |
49 NON_EXPORTED_BASE(public blink::WebFrameClient) { | 49 NON_EXPORTED_BASE(public blink::WebRemoteFrameClient) { |
50 public: | 50 public: |
51 // This method should be used to create a RenderFrameProxy, which will replace | 51 // This method should be used to create a RenderFrameProxy, which will replace |
52 // an existing RenderFrame during its cross-process navigation from the | 52 // an existing RenderFrame during its cross-process navigation from the |
53 // current process to a different one. |routing_id| will be ID of the newly | 53 // current process to a different one. |routing_id| will be ID of the newly |
54 // created RenderFrameProxy. |frame_to_replace| is the frame that the new | 54 // created RenderFrameProxy. |frame_to_replace| is the frame that the new |
55 // proxy will eventually swap places with. | 55 // proxy will eventually swap places with. |
56 static RenderFrameProxy* CreateProxyToReplaceFrame( | 56 static RenderFrameProxy* CreateProxyToReplaceFrame( |
57 RenderFrameImpl* frame_to_replace, | 57 RenderFrameImpl* frame_to_replace, |
58 int routing_id); | 58 int routing_id); |
59 | 59 |
(...skipping 26 matching lines...) Expand all Loading... |
86 virtual bool Send(IPC::Message* msg) OVERRIDE; | 86 virtual bool Send(IPC::Message* msg) OVERRIDE; |
87 | 87 |
88 // Out-of-process child frames receive a signal from RenderWidgetCompositor | 88 // Out-of-process child frames receive a signal from RenderWidgetCompositor |
89 // when a compositor frame has committed. | 89 // when a compositor frame has committed. |
90 void DidCommitCompositorFrame(); | 90 void DidCommitCompositorFrame(); |
91 | 91 |
92 int routing_id() { return routing_id_; } | 92 int routing_id() { return routing_id_; } |
93 RenderViewImpl* render_view() { return render_view_; } | 93 RenderViewImpl* render_view() { return render_view_; } |
94 blink::WebRemoteFrame* web_frame() { return web_frame_; } | 94 blink::WebRemoteFrame* web_frame() { return web_frame_; } |
95 | 95 |
| 96 // blink::WebRemoteFrameClient implementation: |
| 97 virtual void postMessageEvent( |
| 98 blink::WebLocalFrame* sourceFrame, |
| 99 blink::WebRemoteFrame* targetFrame, |
| 100 blink::WebSecurityOrigin target, |
| 101 blink::WebDOMMessageEvent event); |
| 102 |
96 private: | 103 private: |
97 RenderFrameProxy(int routing_id, int frame_routing_id); | 104 RenderFrameProxy(int routing_id, int frame_routing_id); |
98 | 105 |
99 void Init(blink::WebRemoteFrame* frame, RenderViewImpl* render_view); | 106 void Init(blink::WebRemoteFrame* frame, RenderViewImpl* render_view); |
100 | 107 |
101 // IPC::Listener | 108 // IPC::Listener |
102 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 109 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
103 | 110 |
104 // IPC handlers | 111 // IPC handlers |
105 void OnDeleteProxy(); | 112 void OnDeleteProxy(); |
(...skipping 14 matching lines...) Expand all Loading... |
120 scoped_refptr<ChildFrameCompositingHelper> compositing_helper_; | 127 scoped_refptr<ChildFrameCompositingHelper> compositing_helper_; |
121 | 128 |
122 RenderViewImpl* render_view_; | 129 RenderViewImpl* render_view_; |
123 | 130 |
124 DISALLOW_COPY_AND_ASSIGN(RenderFrameProxy); | 131 DISALLOW_COPY_AND_ASSIGN(RenderFrameProxy); |
125 }; | 132 }; |
126 | 133 |
127 } // namespace | 134 } // namespace |
128 | 135 |
129 #endif // CONTENT_RENDERER_RENDER_FRAME_PROXY_H_ | 136 #endif // CONTENT_RENDERER_RENDER_FRAME_PROXY_H_ |
OLD | NEW |