[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CONTENT_RENDERER_RENDER_FRAME_PROXY_H_ |
| 6 | #define CONTENT_RENDERER_RENDER_FRAME_PROXY_H_ |
| 7 | |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 8 | #include "base/macros.h" |
[email protected] | e3244ed | 2014-06-20 20:04:27 | [diff] [blame] | 9 | #include "base/memory/ref_counted.h" |
Chris Blume | efd8f24 | 2017-12-08 00:24:27 | [diff] [blame] | 10 | #include "components/viz/common/surfaces/parent_local_surface_id_allocator.h" |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 11 | #include "content/common/content_export.h" |
Scott Violet | 0f6bb090 | 2018-01-27 19:43:17 | [diff] [blame] | 12 | #include "content/common/frame_messages.h" |
Fady Samuel | d4e14c8 | 2018-04-04 00:56:29 | [diff] [blame] | 13 | #include "content/common/frame_resize_params.h" |
Fady Samuel | 85a1bf7 | 2017-10-27 14:30:20 | [diff] [blame] | 14 | #include "content/public/common/screen_info.h" |
Fady Samuel | 4e717f5 | 2018-02-07 05:51:50 | [diff] [blame] | 15 | #include "content/renderer/child_frame_compositor.h" |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 16 | #include "ipc/ipc_listener.h" |
| 17 | #include "ipc/ipc_sender.h" |
Blink Reformat | a30d423 | 2018-04-07 15:31:06 | [diff] [blame] | 18 | #include "third_party/blink/public/common/feature_policy/feature_policy.h" |
| 19 | #include "third_party/blink/public/platform/web_canvas.h" |
| 20 | #include "third_party/blink/public/platform/web_focus_type.h" |
| 21 | #include "third_party/blink/public/platform/web_insecure_request_policy.h" |
| 22 | #include "third_party/blink/public/web/web_remote_frame.h" |
| 23 | #include "third_party/blink/public/web/web_remote_frame_client.h" |
mkwst | 13213f3 | 2015-07-27 07:06:27 | [diff] [blame] | 24 | #include "url/origin.h" |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 25 | |
Scott Violet | f129194 | 2017-10-20 22:38:27 | [diff] [blame] | 26 | #if defined(USE_AURA) |
| 27 | #include "content/renderer/mus/mus_embedded_frame_delegate.h" |
| 28 | #endif |
| 29 | |
creis | 5834fe5e | 2014-10-10 21:50:49 | [diff] [blame] | 30 | namespace blink { |
Luna Lu | c3fdacdf | 2017-11-08 04:48:53 | [diff] [blame] | 31 | struct FramePolicy; |
lazyboy | 0882dfce | 2015-08-16 05:47:38 | [diff] [blame] | 32 | struct WebRect; |
Ehsan Karamad | 0e5d469 | 2018-01-16 21:32:48 | [diff] [blame] | 33 | struct WebScrollIntoViewParams; |
creis | 5834fe5e | 2014-10-10 21:50:49 | [diff] [blame] | 34 | } |
| 35 | |
Fady Samuel | 1a21156e | 2017-07-13 04:57:29 | [diff] [blame] | 36 | namespace viz { |
| 37 | class SurfaceInfo; |
| 38 | } |
| 39 | |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 40 | namespace content { |
| 41 | |
[email protected] | e3244ed | 2014-06-20 20:04:27 | [diff] [blame] | 42 | class ChildFrameCompositingHelper; |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 43 | class RenderFrameImpl; |
| 44 | class RenderViewImpl; |
lfg | d64bb29 | 2016-01-18 23:57:31 | [diff] [blame] | 45 | class RenderWidget; |
lukasza | 8e1c02e4 | 2016-05-17 20:05:10 | [diff] [blame] | 46 | struct ContentSecurityPolicyHeader; |
raymes | bba82b3 | 2016-07-19 00:41:38 | [diff] [blame] | 47 | struct FrameOwnerProperties; |
alexmos | bc7eafa | 2014-12-06 01:38:09 | [diff] [blame] | 48 | struct FrameReplicationState; |
Daniel Cheng | e0555e19 | 2018-01-18 20:00:05 | [diff] [blame] | 49 | struct ResourceTimingInfo; |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 50 | |
Scott Violet | 1098538e | 2017-10-05 19:23:33 | [diff] [blame] | 51 | #if defined(USE_AURA) |
| 52 | class MusEmbeddedFrame; |
| 53 | #endif |
| 54 | |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 55 | // When a page's frames are rendered by multiple processes, each renderer has a |
| 56 | // full copy of the frame tree. It has full RenderFrames for the frames it is |
| 57 | // responsible for rendering and placeholder objects for frames rendered by |
| 58 | // other processes. This class is the renderer-side object for the placeholder. |
| 59 | // RenderFrameProxy allows us to keep existing window references valid over |
| 60 | // cross-process navigations and route cross-site asynchronous JavaScript calls, |
| 61 | // such as postMessage. |
| 62 | // |
| 63 | // For now, RenderFrameProxy is created when RenderFrame is swapped out. It |
| 64 | // acts as a wrapper and is used for sending and receiving IPC messages. It is |
| 65 | // deleted when the RenderFrame is swapped back in or the node of the frame |
| 66 | // tree is deleted. |
| 67 | // |
| 68 | // Long term, RenderFrameProxy will be created to replace the RenderFrame in the |
| 69 | // frame tree and the RenderFrame will be deleted after its unload handler has |
| 70 | // finished executing. It will still be responsible for routing IPC messages |
| 71 | // which are valid for cross-site interactions between frames. |
| 72 | // RenderFrameProxy will be deleted when the node in the frame tree is deleted |
| 73 | // or when navigating the frame causes it to return to this process and a new |
| 74 | // RenderFrame is created for it. |
Nico Weber | 43ddd7a3 | 2017-08-15 19:19:27 | [diff] [blame] | 75 | class CONTENT_EXPORT RenderFrameProxy : public IPC::Listener, |
| 76 | public IPC::Sender, |
Scott Violet | f129194 | 2017-10-20 22:38:27 | [diff] [blame] | 77 | #if defined(USE_AURA) |
| 78 | public MusEmbeddedFrameDelegate, |
| 79 | #endif |
Fady Samuel | 4e717f5 | 2018-02-07 05:51:50 | [diff] [blame] | 80 | public ChildFrameCompositor, |
Nico Weber | 43ddd7a3 | 2017-08-15 19:19:27 | [diff] [blame] | 81 | public blink::WebRemoteFrameClient { |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 82 | public: |
[email protected] | c092f5c | 2014-07-18 01:34:33 | [diff] [blame] | 83 | // This method should be used to create a RenderFrameProxy, which will replace |
| 84 | // an existing RenderFrame during its cross-process navigation from the |
| 85 | // current process to a different one. |routing_id| will be ID of the newly |
| 86 | // created RenderFrameProxy. |frame_to_replace| is the frame that the new |
| 87 | // proxy will eventually swap places with. |
| 88 | static RenderFrameProxy* CreateProxyToReplaceFrame( |
| 89 | RenderFrameImpl* frame_to_replace, |
dcheng | 860817a | 2015-05-22 03:16:56 | [diff] [blame] | 90 | int routing_id, |
| 91 | blink::WebTreeScopeType scope); |
[email protected] | c092f5c | 2014-07-18 01:34:33 | [diff] [blame] | 92 | |
| 93 | // This method should be used to create a RenderFrameProxy, when there isn't |
| 94 | // an existing RenderFrame. It should be called to construct a local |
| 95 | // representation of a RenderFrame that has been created in another process -- |
| 96 | // for example, after a cross-process navigation or after the addition of a |
| 97 | // new frame local to some other process. |routing_id| will be the ID of the |
alexmos | a181efc | 2015-09-03 00:39:04 | [diff] [blame] | 98 | // newly created RenderFrameProxy. |render_view_routing_id| identifies the |
nick | 3b5a21f | 2016-11-22 23:07:11 | [diff] [blame] | 99 | // RenderView to be associated with this frame. |opener|, if supplied, is the |
| 100 | // new frame's opener. |parent_routing_id| is the routing ID of the |
| 101 | // RenderFrameProxy to which the new frame is parented. |
[email protected] | c092f5c | 2014-07-18 01:34:33 | [diff] [blame] | 102 | // |
| 103 | // |parent_routing_id| always identifies a RenderFrameProxy (never a |
| 104 | // RenderFrame) because a new child of a local frame should always start out |
| 105 | // as a frame, not a proxy. |
alexmos | bc7eafa | 2014-12-06 01:38:09 | [diff] [blame] | 106 | static RenderFrameProxy* CreateFrameProxy( |
| 107 | int routing_id, |
alexmos | bc7eafa | 2014-12-06 01:38:09 | [diff] [blame] | 108 | int render_view_routing_id, |
nick | 3b5a21f | 2016-11-22 23:07:11 | [diff] [blame] | 109 | blink::WebFrame* opener, |
alexmos | a181efc | 2015-09-03 00:39:04 | [diff] [blame] | 110 | int parent_routing_id, |
Dmitry Gozman | 8936121 | 2018-02-13 16:10:44 | [diff] [blame] | 111 | const FrameReplicationState& replicated_state, |
| 112 | const base::UnguessableToken& devtools_frame_token); |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 113 | |
| 114 | // Returns the RenderFrameProxy for the given routing ID. |
| 115 | static RenderFrameProxy* FromRoutingID(int routing_id); |
| 116 | |
Daniel Cheng | 0edfa56 | 2017-06-05 19:13:18 | [diff] [blame] | 117 | // Returns the RenderFrameProxy given a WebRemoteFrame. |web_frame| must not |
| 118 | // be null, nor will this method return null. |
| 119 | static RenderFrameProxy* FromWebFrame(blink::WebRemoteFrame* web_frame); |
[email protected] | c092f5c | 2014-07-18 01:34:33 | [diff] [blame] | 120 | |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 121 | ~RenderFrameProxy() override; |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 122 | |
| 123 | // IPC::Sender |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 124 | bool Send(IPC::Message* msg) override; |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 125 | |
Eric Karl | f18f8124 | 2018-04-16 21:13:31 | [diff] [blame] | 126 | // IPC::Listener |
| 127 | bool OnMessageReceived(const IPC::Message& msg) override; |
| 128 | |
[email protected] | e3244ed | 2014-06-20 20:04:27 | [diff] [blame] | 129 | // Out-of-process child frames receive a signal from RenderWidgetCompositor |
lfg | e6119aac | 2016-01-27 02:14:31 | [diff] [blame] | 130 | // when a compositor frame will begin. |
| 131 | void WillBeginCompositorFrame(); |
| 132 | |
Fady Samuel | 85a1bf7 | 2017-10-27 14:30:20 | [diff] [blame] | 133 | // Out-of-process child frames receive a signal from RenderWidget when the |
| 134 | // ScreenInfo has changed. |
| 135 | void OnScreenInfoChanged(const ScreenInfo& screen_info); |
| 136 | |
Vladimir Levin | 98d76dad | 2018-04-21 00:21:29 | [diff] [blame] | 137 | // Invoked by RenderWidget when a new capture sequence number was set, |
| 138 | // indicating that surfaces should be synchronized. |
| 139 | void UpdateCaptureSequenceNumber(uint32_t capture_sequence_number); |
| 140 | |
alexmos | bc7eafa | 2014-12-06 01:38:09 | [diff] [blame] | 141 | // Pass replicated information, such as security origin, to this |
| 142 | // RenderFrameProxy's WebRemoteFrame. |
| 143 | void SetReplicatedState(const FrameReplicationState& state); |
| 144 | |
[email protected] | 82307f6b | 2014-08-07 03:30:12 | [diff] [blame] | 145 | int routing_id() { return routing_id_; } |
| 146 | RenderViewImpl* render_view() { return render_view_; } |
| 147 | blink::WebRemoteFrame* web_frame() { return web_frame_; } |
Daniel Cheng | 999698bd | 2017-03-22 04:56:37 | [diff] [blame] | 148 | const std::string& unique_name() const { return unique_name_; } |
[email protected] | c092f5c | 2014-07-18 01:34:33 | [diff] [blame] | 149 | |
alexmos | f076d91 | 2017-01-23 22:27:57 | [diff] [blame] | 150 | void set_provisional_frame_routing_id(int routing_id) { |
| 151 | provisional_frame_routing_id_ = routing_id; |
| 152 | } |
| 153 | |
| 154 | int provisional_frame_routing_id() { return provisional_frame_routing_id_; } |
| 155 | |
lfg | d64bb29 | 2016-01-18 23:57:31 | [diff] [blame] | 156 | // Returns the widget used for the local frame root. |
| 157 | RenderWidget* render_widget() { return render_widget_; } |
| 158 | |
Scott Violet | 1098538e | 2017-10-05 19:23:33 | [diff] [blame] | 159 | #if defined(USE_AURA) |
Scott Violet | 1098538e | 2017-10-05 19:23:33 | [diff] [blame] | 160 | void SetMusEmbeddedFrame( |
| 161 | std::unique_ptr<MusEmbeddedFrame> mus_embedded_frame); |
| 162 | #endif |
| 163 | |
Fady Samuel | 0b91182 | 2018-04-25 13:22:16 | [diff] [blame^] | 164 | void SynchronizeVisualProperties(); |
Fady Samuel | 85a1bf7 | 2017-10-27 14:30:20 | [diff] [blame] | 165 | |
Fady Samuel | 82fd52a | 2018-01-31 21:00:06 | [diff] [blame] | 166 | const gfx::Rect& screen_space_rect() const { |
Fady Samuel | 0b91182 | 2018-04-25 13:22:16 | [diff] [blame^] | 167 | return pending_visual_properties_.screen_space_rect; |
Fady Samuel | 82fd52a | 2018-01-31 21:00:06 | [diff] [blame] | 168 | } |
| 169 | |
| 170 | const gfx::Size& local_frame_size() const { |
Fady Samuel | 0b91182 | 2018-04-25 13:22:16 | [diff] [blame^] | 171 | return pending_visual_properties_.local_frame_size; |
Fady Samuel | 85a1bf7 | 2017-10-27 14:30:20 | [diff] [blame] | 172 | } |
| 173 | |
| 174 | const ScreenInfo& screen_info() const { |
Fady Samuel | 0b91182 | 2018-04-25 13:22:16 | [diff] [blame^] | 175 | return pending_visual_properties_.screen_info; |
Fady Samuel | 85a1bf7 | 2017-10-27 14:30:20 | [diff] [blame] | 176 | } |
| 177 | |
Sadrul Habib Chowdhury | 6539b73 | 2018-01-05 21:53:27 | [diff] [blame] | 178 | const viz::FrameSinkId& frame_sink_id() const { return frame_sink_id_; } |
| 179 | |
japhet | 4dad341e | 2014-09-09 21:11:11 | [diff] [blame] | 180 | // blink::WebRemoteFrameClient implementation: |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 181 | void FrameDetached(DetachType type) override; |
Charlie Reis | 10bc915a | 2018-03-30 16:36:19 | [diff] [blame] | 182 | void CheckCompleted() override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 183 | void ForwardPostMessage(blink::WebLocalFrame* sourceFrame, |
dcheng | b4a1a32e | 2016-05-17 01:57:00 | [diff] [blame] | 184 | blink::WebRemoteFrame* targetFrame, |
| 185 | blink::WebSecurityOrigin target, |
Alex Moshchuk | 99a441e7 | 2018-03-01 19:06:37 | [diff] [blame] | 186 | blink::WebDOMMessageEvent event, |
| 187 | bool has_user_gesture) override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 188 | void Navigate(const blink::WebURLRequest& request, |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 189 | bool should_replace_current_entry) override; |
Fady Samuel | 82fd52a | 2018-01-31 21:00:06 | [diff] [blame] | 190 | void FrameRectsChanged(const blink::WebRect& local_frame_rect, |
| 191 | const blink::WebRect& screen_space_rect) override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 192 | void UpdateRemoteViewportIntersection( |
kenrb | ea73179 | 2017-01-13 15:10:48 | [diff] [blame] | 193 | const blink::WebRect& viewportIntersection) override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 194 | void VisibilityChanged(bool visible) override; |
kenrb | 0432378 | 2017-06-23 01:23:32 | [diff] [blame] | 195 | void SetIsInert(bool) override; |
Ken Buchanan | 8a319fb | 2017-11-15 18:37:12 | [diff] [blame] | 196 | void UpdateRenderThrottlingStatus(bool is_throttled, |
| 197 | bool subtree_throttled) override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 198 | void DidChangeOpener(blink::WebFrame* opener) override; |
| 199 | void AdvanceFocus(blink::WebFocusType type, |
alexmos | 401f0aba | 2015-12-06 10:07:39 | [diff] [blame] | 200 | blink::WebLocalFrame* source) override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 201 | void FrameFocused() override; |
Dmitry Gozman | f12caab | 2018-02-07 03:45:58 | [diff] [blame] | 202 | base::UnguessableToken GetDevToolsFrameToken() override; |
Wei Li | e13ea64 | 2018-02-17 07:55:19 | [diff] [blame] | 203 | uint32_t Print(const blink::WebRect& rect, blink::WebCanvas* canvas) override; |
japhet | 4dad341e | 2014-09-09 21:11:11 | [diff] [blame] | 204 | |
nasko | 3e8c20e | 2014-12-18 06:54:56 | [diff] [blame] | 205 | // IPC handlers |
| 206 | void OnDidStartLoading(); |
| 207 | |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 208 | private: |
alexmos | f076d91 | 2017-01-23 22:27:57 | [diff] [blame] | 209 | RenderFrameProxy(int routing_id); |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 210 | |
lfg | d64bb29 | 2016-01-18 23:57:31 | [diff] [blame] | 211 | void Init(blink::WebRemoteFrame* frame, |
| 212 | RenderViewImpl* render_view, |
| 213 | RenderWidget* render_widget); |
[email protected] | c092f5c | 2014-07-18 01:34:33 | [diff] [blame] | 214 | |
Fady Samuel | 85a1bf7 | 2017-10-27 14:30:20 | [diff] [blame] | 215 | void ResendResizeParams(); |
Scott Violet | 1098538e | 2017-10-05 19:23:33 | [diff] [blame] | 216 | |
kylechar | ee539faa0 | 2018-01-22 17:00:55 | [diff] [blame] | 217 | void SetChildFrameSurface(const viz::SurfaceInfo& surface_info); |
Scott Violet | f129194 | 2017-10-20 22:38:27 | [diff] [blame] | 218 | |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 219 | // IPC handlers |
| 220 | void OnDeleteProxy(); |
[email protected] | e3244ed | 2014-06-20 20:04:27 | [diff] [blame] | 221 | void OnChildFrameProcessGone(); |
[email protected] | e3244ed | 2014-06-20 20:04:27 | [diff] [blame] | 222 | void OnCompositorFrameSwapped(const IPC::Message& message); |
kylechar | ee539faa0 | 2018-01-22 17:00:55 | [diff] [blame] | 223 | // TODO(fsamuel): Rename OnFirstSurfaceActivation(). |
| 224 | void OnSetChildFrameSurface(const viz::SurfaceInfo& surface_info); |
Chris Harrelson | d7ab99b | 2018-01-24 17:51:36 | [diff] [blame] | 225 | void OnIntrinsicSizingInfoOfChildChanged( |
| 226 | blink::WebIntrinsicSizingInfo sizing_info); |
alexmos | 9573300 | 2015-08-24 16:38:09 | [diff] [blame] | 227 | void OnUpdateOpener(int opener_routing_id); |
Scott Violet | 0f6bb090 | 2018-01-27 19:43:17 | [diff] [blame] | 228 | void OnViewChanged(const FrameMsg_ViewChanged_Params& params); |
nasko | 3e8c20e | 2014-12-18 06:54:56 | [diff] [blame] | 229 | void OnDidStopLoading(); |
Luna Lu | c3fdacdf | 2017-11-08 04:48:53 | [diff] [blame] | 230 | void OnDidUpdateFramePolicy(const blink::FramePolicy& frame_policy); |
Ian Clelland | edb8c5dd | 2018-03-01 17:01:37 | [diff] [blame] | 231 | void OnDidSetFramePolicyHeaders( |
| 232 | blink::WebSandboxFlags active_sandbox_flags, |
| 233 | blink::ParsedFeaturePolicy parsed_feature_policy); |
Daniel Cheng | e0555e19 | 2018-01-18 20:00:05 | [diff] [blame] | 234 | void OnForwardResourceTimingToParent( |
| 235 | const ResourceTimingInfo& resource_timing); |
alexmos | f40ce5b0 | 2015-02-25 20:19:56 | [diff] [blame] | 236 | void OnDispatchLoad(); |
engedy | 6e2e099 | 2017-05-25 18:58:42 | [diff] [blame] | 237 | void OnCollapse(bool collapsed); |
lukasza | 464d869 | 2016-02-22 19:26:32 | [diff] [blame] | 238 | void OnDidUpdateName(const std::string& name, const std::string& unique_name); |
arthursonzogni | 662aa65 | 2017-03-28 11:09:50 | [diff] [blame] | 239 | void OnAddContentSecurityPolicies( |
| 240 | const std::vector<ContentSecurityPolicyHeader>& header); |
lukasza | 8e1c02e4 | 2016-05-17 20:05:10 | [diff] [blame] | 241 | void OnResetContentSecurityPolicy(); |
mkwst | f672e7ef | 2016-06-09 20:51:07 | [diff] [blame] | 242 | void OnEnforceInsecureRequestPolicy(blink::WebInsecureRequestPolicy policy); |
arthursonzogni | 4b62a5cb | 2018-01-17 14:14:26 | [diff] [blame] | 243 | void OnEnforceInsecureNavigationsSet(const std::vector<uint32_t>& set); |
raymes | bba82b3 | 2016-07-19 00:41:38 | [diff] [blame] | 244 | void OnSetFrameOwnerProperties(const FrameOwnerProperties& properties); |
estark | bd8e26f | 2016-03-16 23:30:37 | [diff] [blame] | 245 | void OnDidUpdateOrigin(const url::Origin& origin, |
| 246 | bool is_potentially_trustworthy_unique_origin); |
alexmos | 3fcd0ca | 2015-10-23 18:18:33 | [diff] [blame] | 247 | void OnSetPageFocus(bool is_focused); |
alexmos | b1dc216 | 2015-11-05 00:59:20 | [diff] [blame] | 248 | void OnSetFocusedFrame(); |
alexmos | 1f7eac4a | 2016-05-25 23:04:55 | [diff] [blame] | 249 | void OnWillEnterFullscreen(); |
japhet | 61835ae1 | 2017-01-20 01:25:39 | [diff] [blame] | 250 | void OnSetHasReceivedUserGesture(); |
Ehsan Karamad | 0e5d469 | 2018-01-16 21:32:48 | [diff] [blame] | 251 | void OnScrollRectToVisible(const gfx::Rect& rect_to_scroll, |
| 252 | const blink::WebScrollIntoViewParams& params); |
Eric Karl | 7fdf2af | 2018-04-24 21:21:30 | [diff] [blame] | 253 | void OnResizeDueToAutoResize( |
| 254 | const viz::LocalSurfaceId& child_allocated_surface_id); |
Fady Samuel | d4e14c8 | 2018-04-04 00:56:29 | [diff] [blame] | 255 | void OnEnableAutoResize(const gfx::Size& min_size, const gfx::Size& max_size); |
| 256 | void OnDisableAutoResize(); |
Becca Hughes | 60af7d4 | 2017-12-12 10:53:15 | [diff] [blame] | 257 | void OnSetHasReceivedUserGestureBeforeNavigation(bool value); |
[email protected] | e3244ed | 2014-06-20 20:04:27 | [diff] [blame] | 258 | |
Scott Violet | f129194 | 2017-10-20 22:38:27 | [diff] [blame] | 259 | #if defined(USE_AURA) |
| 260 | // MusEmbeddedFrameDelegate |
| 261 | void OnMusEmbeddedFrameSurfaceChanged( |
| 262 | const viz::SurfaceInfo& surface_info) override; |
| 263 | void OnMusEmbeddedFrameSinkIdAllocated( |
| 264 | const viz::FrameSinkId& frame_sink_id) override; |
| 265 | #endif |
| 266 | |
Fady Samuel | 4e717f5 | 2018-02-07 05:51:50 | [diff] [blame] | 267 | // ChildFrameCompositor: |
| 268 | blink::WebLayer* GetLayer() override; |
| 269 | void SetLayer(std::unique_ptr<blink::WebLayer> web_layer) override; |
| 270 | SkBitmap* GetSadPageBitmap() override; |
| 271 | |
Ken Buchanan | b2c9e26 | 2018-03-10 16:53:31 | [diff] [blame] | 272 | gfx::Rect ComputeCompositingRect(const gfx::Rect& intersection_rect); |
| 273 | |
[email protected] | c092f5c | 2014-07-18 01:34:33 | [diff] [blame] | 274 | // The routing ID by which this RenderFrameProxy is known. |
| 275 | const int routing_id_; |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 276 | |
alexmos | f076d91 | 2017-01-23 22:27:57 | [diff] [blame] | 277 | // The routing ID of the provisional RenderFrame (if any) that is meant to |
| 278 | // replace this RenderFrameProxy in the frame tree. |
| 279 | int provisional_frame_routing_id_; |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 280 | |
[email protected] | 82307f6b | 2014-08-07 03:30:12 | [diff] [blame] | 281 | // Stores the WebRemoteFrame we are associated with. |
| 282 | blink::WebRemoteFrame* web_frame_; |
Daniel Cheng | 999698bd | 2017-03-22 04:56:37 | [diff] [blame] | 283 | std::string unique_name_; |
Ken Buchanan | e0b3819e | 2017-09-01 21:32:29 | [diff] [blame] | 284 | std::unique_ptr<ChildFrameCompositingHelper> compositing_helper_; |
[email protected] | e3244ed | 2014-06-20 20:04:27 | [diff] [blame] | 285 | |
[email protected] | c092f5c | 2014-07-18 01:34:33 | [diff] [blame] | 286 | RenderViewImpl* render_view_; |
lfg | d64bb29 | 2016-01-18 23:57:31 | [diff] [blame] | 287 | RenderWidget* render_widget_; |
[email protected] | c092f5c | 2014-07-18 01:34:33 | [diff] [blame] | 288 | |
Dmitry Gozman | f12caab | 2018-02-07 03:45:58 | [diff] [blame] | 289 | // Contains token to be used as a frame id in the devtools protocol. |
Pavel Feldman | 5f4f48a | 2018-01-17 05:15:34 | [diff] [blame] | 290 | // It is derived from the content's devtools_frame_token, is |
| 291 | // defined by the browser and passed into Blink upon frame creation. |
Dmitry Gozman | f12caab | 2018-02-07 03:45:58 | [diff] [blame] | 292 | base::UnguessableToken devtools_frame_token_; |
Pavel Feldman | 5f4f48a | 2018-01-17 05:15:34 | [diff] [blame] | 293 | |
Fady Samuel | d10aadd8 | 2017-11-03 18:23:57 | [diff] [blame] | 294 | // TODO(fsamuel): Most RenderFrameProxys don't host viz::Surfaces and |
| 295 | // therefore don't care to synchronize ResizeParams with viz::LocalSurfaceIds. |
| 296 | // Perhaps this can be moved to ChildFrameCompositingHelper? |
Fady Samuel | 85a1bf7 | 2017-10-27 14:30:20 | [diff] [blame] | 297 | // The last ResizeParams sent to the browser process, if any. |
Fady Samuel | 0b91182 | 2018-04-25 13:22:16 | [diff] [blame^] | 298 | base::Optional<FrameResizeParams> sent_visual_properties_; |
Fady Samuel | 85a1bf7 | 2017-10-27 14:30:20 | [diff] [blame] | 299 | |
| 300 | // The current set of ResizeParams. This may or may not match |
Fady Samuel | 0b91182 | 2018-04-25 13:22:16 | [diff] [blame^] | 301 | // |sent_visual_properties_|. |
| 302 | FrameResizeParams pending_visual_properties_; |
Fady Samuel | 85a1bf7 | 2017-10-27 14:30:20 | [diff] [blame] | 303 | |
Fady Samuel | 4e717f5 | 2018-02-07 05:51:50 | [diff] [blame] | 304 | bool crashed_ = false; |
| 305 | |
Fady Samuel | 3ff277d | 2017-08-29 17:55:52 | [diff] [blame] | 306 | viz::FrameSinkId frame_sink_id_; |
Fady Samuel | 0c7ffb1 | 2017-08-28 19:08:39 | [diff] [blame] | 307 | viz::LocalSurfaceId local_surface_id_; |
Chris Blume | efd8f24 | 2017-12-08 00:24:27 | [diff] [blame] | 308 | viz::ParentLocalSurfaceIdAllocator parent_local_surface_id_allocator_; |
Fady Samuel | 0c7ffb1 | 2017-08-28 19:08:39 | [diff] [blame] | 309 | |
Fady Samuel | 3ff277d | 2017-08-29 17:55:52 | [diff] [blame] | 310 | bool enable_surface_synchronization_ = false; |
| 311 | |
Ken Buchanan | b2c9e26 | 2018-03-10 16:53:31 | [diff] [blame] | 312 | gfx::Rect last_intersection_rect_; |
| 313 | gfx::Rect last_compositor_visible_rect_; |
| 314 | |
Scott Violet | 1098538e | 2017-10-05 19:23:33 | [diff] [blame] | 315 | #if defined(USE_AURA) |
| 316 | std::unique_ptr<MusEmbeddedFrame> mus_embedded_frame_; |
| 317 | #endif |
| 318 | |
Fady Samuel | 4e717f5 | 2018-02-07 05:51:50 | [diff] [blame] | 319 | // The layer used to embed the out-of-process content. |
| 320 | std::unique_ptr<blink::WebLayer> web_layer_; |
| 321 | |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 322 | DISALLOW_COPY_AND_ASSIGN(RenderFrameProxy); |
| 323 | }; |
| 324 | |
kylechar | ee539faa0 | 2018-01-22 17:00:55 | [diff] [blame] | 325 | } // namespace content |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 326 | |
| 327 | #endif // CONTENT_RENDERER_RENDER_FRAME_PROXY_H_ |