Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: content/browser/frame_host/render_widget_host_view_guest.h

Issue 2750623002: Avoid unnecessary LocalSurfaceId allocation in RenderWidgetHostViewChildFrame/Guest (Closed)
Patch Set: Added test Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 void WheelEventAck(const blink::WebMouseWheelEvent& event, 119 void WheelEventAck(const blink::WebMouseWheelEvent& event,
120 InputEventAckState ack_result) override; 120 InputEventAckState ack_result) override;
121 121
122 void GestureEventAck(const blink::WebGestureEvent& event, 122 void GestureEventAck(const blink::WebGestureEvent& event,
123 InputEventAckState ack_result) override; 123 InputEventAckState ack_result) override;
124 124
125 bool IsRenderWidgetHostViewGuest() override; 125 bool IsRenderWidgetHostViewGuest() override;
126 RenderWidgetHostViewBase* GetOwnerRenderWidgetHostView() const; 126 RenderWidgetHostViewBase* GetOwnerRenderWidgetHostView() const;
127 127
128 protected: 128 private:
129 friend class RenderWidgetHostView; 129 friend class RenderWidgetHostView;
130 bool ShouldCreateNewSurfaceId(uint32_t compositor_frame_sink_id,
131 const cc::CompositorFrame& frame) override;
132 130
133 private:
134 void SendSurfaceInfoToEmbedderImpl( 131 void SendSurfaceInfoToEmbedderImpl(
135 const cc::SurfaceInfo& surface_info, 132 const cc::SurfaceInfo& surface_info,
136 const cc::SurfaceSequence& sequence) override; 133 const cc::SurfaceSequence& sequence) override;
137 134
138 RenderWidgetHostViewGuest( 135 RenderWidgetHostViewGuest(
139 RenderWidgetHost* widget, 136 RenderWidgetHost* widget,
140 BrowserPluginGuest* guest, 137 BrowserPluginGuest* guest,
141 base::WeakPtr<RenderWidgetHostViewBase> platform_view); 138 base::WeakPtr<RenderWidgetHostViewBase> platform_view);
142 139
143 // Since we now route GestureEvents directly to the guest renderer, we need 140 // Since we now route GestureEvents directly to the guest renderer, we need
144 // a way to make sure that the BrowserPlugin in the embedder gets focused so 141 // a way to make sure that the BrowserPlugin in the embedder gets focused so
145 // that keyboard input (which still travels via BrowserPlugin) is routed to 142 // that keyboard input (which still travels via BrowserPlugin) is routed to
146 // the plugin and thus onwards to the guest. 143 // the plugin and thus onwards to the guest.
147 // TODO(wjmaclean): When we remove BrowserPlugin, delete this code. 144 // TODO(wjmaclean): When we remove BrowserPlugin, delete this code.
148 // http://crbug.com/533069 145 // http://crbug.com/533069
149 void MaybeSendSyntheticTapGesture( 146 void MaybeSendSyntheticTapGesture(
150 const blink::WebFloatPoint& position, 147 const blink::WebFloatPoint& position,
151 const blink::WebFloatPoint& screenPosition) const; 148 const blink::WebFloatPoint& screenPosition) const;
152 149
153 void OnHandleInputEvent(RenderWidgetHostImpl* embedder, 150 void OnHandleInputEvent(RenderWidgetHostImpl* embedder,
154 int browser_plugin_instance_id, 151 int browser_plugin_instance_id,
155 const blink::WebInputEvent* event); 152 const blink::WebInputEvent* event);
156 153
154 bool HasEmbedderChanged() override;
155
157 // BrowserPluginGuest and RenderWidgetHostViewGuest's lifetimes are not tied 156 // BrowserPluginGuest and RenderWidgetHostViewGuest's lifetimes are not tied
158 // to one another, therefore we access |guest_| through WeakPtr. 157 // to one another, therefore we access |guest_| through WeakPtr.
159 base::WeakPtr<BrowserPluginGuest> guest_; 158 base::WeakPtr<BrowserPluginGuest> guest_;
160 gfx::Size size_; 159 gfx::Size size_;
161 // The platform view for this RenderWidgetHostView. 160 // The platform view for this RenderWidgetHostView.
162 // RenderWidgetHostViewGuest mostly only cares about stuff related to 161 // RenderWidgetHostViewGuest mostly only cares about stuff related to
163 // compositing, the rest are directly forwarded to this |platform_view_|. 162 // compositing, the rest are directly forwarded to this |platform_view_|.
164 base::WeakPtr<RenderWidgetHostViewBase> platform_view_; 163 base::WeakPtr<RenderWidgetHostViewBase> platform_view_;
165 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewGuest); 164 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewGuest);
166 }; 165 };
167 166
168 } // namespace content 167 } // namespace content
169 168
170 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ 169 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698