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" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 bool Send(IPC::Message* msg) override; | 93 bool Send(IPC::Message* msg) override; |
94 | 94 |
95 // Out-of-process child frames receive a signal from RenderWidgetCompositor | 95 // Out-of-process child frames receive a signal from RenderWidgetCompositor |
96 // when a compositor frame has committed. | 96 // when a compositor frame has committed. |
97 void DidCommitCompositorFrame(); | 97 void DidCommitCompositorFrame(); |
98 | 98 |
99 // Pass replicated information, such as security origin, to this | 99 // Pass replicated information, such as security origin, to this |
100 // RenderFrameProxy's WebRemoteFrame. | 100 // RenderFrameProxy's WebRemoteFrame. |
101 void SetReplicatedState(const FrameReplicationState& state); | 101 void SetReplicatedState(const FrameReplicationState& state); |
102 | 102 |
| 103 // Navigating a top-level frame cross-process does not swap the WebLocalFrame |
| 104 // for a WebRemoteFrame in the frame tree. In this case, this WebRemoteFrame |
| 105 // is not attached to the frame tree and there is no blink::Frame associated |
| 106 // with it, so it is not in state where most operations on it will succeed. |
| 107 bool IsMainFrameDetachedFromTree() const; |
| 108 |
103 int routing_id() { return routing_id_; } | 109 int routing_id() { return routing_id_; } |
104 RenderViewImpl* render_view() { return render_view_; } | 110 RenderViewImpl* render_view() { return render_view_; } |
105 blink::WebRemoteFrame* web_frame() { return web_frame_; } | 111 blink::WebRemoteFrame* web_frame() { return web_frame_; } |
106 | 112 |
107 // blink::WebRemoteFrameClient implementation: | 113 // blink::WebRemoteFrameClient implementation: |
108 virtual void frameDetached(); | 114 virtual void frameDetached(); |
109 virtual void postMessageEvent( | 115 virtual void postMessageEvent( |
110 blink::WebLocalFrame* sourceFrame, | 116 blink::WebLocalFrame* sourceFrame, |
111 blink::WebRemoteFrame* targetFrame, | 117 blink::WebRemoteFrame* targetFrame, |
112 blink::WebSecurityOrigin target, | 118 blink::WebSecurityOrigin target, |
113 blink::WebDOMMessageEvent event); | 119 blink::WebDOMMessageEvent event); |
114 virtual void initializeChildFrame( | 120 virtual void initializeChildFrame( |
115 const blink::WebRect& frame_rect, | 121 const blink::WebRect& frame_rect, |
116 float scale_factor); | 122 float scale_factor); |
117 virtual void navigate(const blink::WebURLRequest& request, | 123 virtual void navigate(const blink::WebURLRequest& request, |
118 bool should_replace_current_entry); | 124 bool should_replace_current_entry); |
119 virtual void forwardInputEvent(const blink::WebInputEvent* event); | 125 virtual void forwardInputEvent(const blink::WebInputEvent* event); |
120 | 126 |
121 // IPC handlers | 127 // IPC handlers |
122 void OnDidStartLoading(); | 128 void OnDidStartLoading(); |
123 | 129 |
124 private: | 130 private: |
125 RenderFrameProxy(int routing_id, int frame_routing_id); | 131 RenderFrameProxy(int routing_id, int frame_routing_id); |
126 | 132 |
127 void Init(blink::WebRemoteFrame* frame, RenderViewImpl* render_view); | 133 void Init(blink::WebRemoteFrame* frame, RenderViewImpl* render_view); |
128 | 134 |
129 // Navigating a top-level frame cross-process does not swap the WebLocalFrame | |
130 // for a WebRemoteFrame in the frame tree. In this case, this WebRemoteFrame | |
131 // is not attached to the frame tree and there is no blink::Frame associated | |
132 // with it, so it is not in state where most operations on it will succeed. | |
133 bool IsMainFrameDetachedFromTree() const; | |
134 | |
135 // IPC::Listener | 135 // IPC::Listener |
136 bool OnMessageReceived(const IPC::Message& msg) override; | 136 bool OnMessageReceived(const IPC::Message& msg) override; |
137 | 137 |
138 // IPC handlers | 138 // IPC handlers |
139 void OnDeleteProxy(); | 139 void OnDeleteProxy(); |
140 void OnChildFrameProcessGone(); | 140 void OnChildFrameProcessGone(); |
141 void OnCompositorFrameSwapped(const IPC::Message& message); | 141 void OnCompositorFrameSwapped(const IPC::Message& message); |
142 void OnDisownOpener(); | 142 void OnDisownOpener(); |
143 void OnDidStopLoading(); | 143 void OnDidStopLoading(); |
144 void OnDidUpdateSandboxFlags(SandboxFlags flags); | 144 void OnDidUpdateSandboxFlags(SandboxFlags flags); |
(...skipping 12 matching lines...) Expand all Loading... |
157 scoped_refptr<ChildFrameCompositingHelper> compositing_helper_; | 157 scoped_refptr<ChildFrameCompositingHelper> compositing_helper_; |
158 | 158 |
159 RenderViewImpl* render_view_; | 159 RenderViewImpl* render_view_; |
160 | 160 |
161 DISALLOW_COPY_AND_ASSIGN(RenderFrameProxy); | 161 DISALLOW_COPY_AND_ASSIGN(RenderFrameProxy); |
162 }; | 162 }; |
163 | 163 |
164 } // namespace | 164 } // namespace |
165 | 165 |
166 #endif // CONTENT_RENDERER_RENDER_FRAME_PROXY_H_ | 166 #endif // CONTENT_RENDERER_RENDER_FRAME_PROXY_H_ |
OLD | NEW |