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