| 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_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // Returns the view into which this view is directly embedded. This can | 173 // Returns the view into which this view is directly embedded. This can |
| 174 // return nullptr when this view's associated child frame is not connected | 174 // return nullptr when this view's associated child frame is not connected |
| 175 // to the frame tree. | 175 // to the frame tree. |
| 176 RenderWidgetHostViewBase* GetParentView(); | 176 RenderWidgetHostViewBase* GetParentView(); |
| 177 | 177 |
| 178 void RegisterFrameSinkId(); | 178 void RegisterFrameSinkId(); |
| 179 void UnregisterFrameSinkId(); | 179 void UnregisterFrameSinkId(); |
| 180 | 180 |
| 181 void UpdateViewportIntersection(const gfx::Rect& viewport_intersection); | 181 void UpdateViewportIntersection(const gfx::Rect& viewport_intersection); |
| 182 | 182 |
| 183 bool has_frame() { return has_frame_; } |
| 184 |
| 183 protected: | 185 protected: |
| 184 friend class RenderWidgetHostView; | 186 friend class RenderWidgetHostView; |
| 185 friend class RenderWidgetHostViewChildFrameTest; | 187 friend class RenderWidgetHostViewChildFrameTest; |
| 186 friend class RenderWidgetHostViewGuestSurfaceTest; | 188 friend class RenderWidgetHostViewGuestSurfaceTest; |
| 187 | 189 |
| 188 explicit RenderWidgetHostViewChildFrame(RenderWidgetHost* widget); | 190 explicit RenderWidgetHostViewChildFrame(RenderWidgetHost* widget); |
| 189 void Init(); | 191 void Init(); |
| 190 | 192 |
| 191 virtual bool ShouldCreateNewSurfaceId(uint32_t compositor_frame_sink_id, | |
| 192 const cc::CompositorFrame& frame); | |
| 193 | |
| 194 void ProcessCompositorFrame(uint32_t compositor_frame_sink_id, | 193 void ProcessCompositorFrame(uint32_t compositor_frame_sink_id, |
| 195 cc::CompositorFrame frame); | 194 cc::CompositorFrame frame); |
| 196 | 195 |
| 197 void SendSurfaceInfoToEmbedder(); | 196 void SendSurfaceInfoToEmbedder(); |
| 198 | 197 |
| 199 // Clears current compositor surface, if one is in use. | 198 // Clears current compositor surface, if one is in use. |
| 200 void ClearCompositorSurfaceIfNecessary(); | 199 void ClearCompositorSurfaceIfNecessary(); |
| 201 | 200 |
| 202 void ProcessFrameSwappedCallbacks(); | 201 void ProcessFrameSwappedCallbacks(); |
| 203 | 202 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 const cc::SurfaceSequence& sequence); | 234 const cc::SurfaceSequence& sequence); |
| 236 | 235 |
| 237 void SubmitSurfaceCopyRequest(const gfx::Rect& src_subrect, | 236 void SubmitSurfaceCopyRequest(const gfx::Rect& src_subrect, |
| 238 const gfx::Size& dst_size, | 237 const gfx::Size& dst_size, |
| 239 const ReadbackRequestCallback& callback, | 238 const ReadbackRequestCallback& callback, |
| 240 const SkColorType preferred_color_type); | 239 const SkColorType preferred_color_type); |
| 241 | 240 |
| 242 void CreateCompositorFrameSinkSupport(); | 241 void CreateCompositorFrameSinkSupport(); |
| 243 void ResetCompositorFrameSinkSupport(); | 242 void ResetCompositorFrameSinkSupport(); |
| 244 | 243 |
| 244 virtual bool HasEmbedderChanged(); |
| 245 |
| 245 using FrameSwappedCallbackList = std::deque<std::unique_ptr<base::Closure>>; | 246 using FrameSwappedCallbackList = std::deque<std::unique_ptr<base::Closure>>; |
| 246 // Since frame-drawn callbacks are "fire once", we use std::deque to make | 247 // Since frame-drawn callbacks are "fire once", we use std::deque to make |
| 247 // it convenient to swap() when processing the list. | 248 // it convenient to swap() when processing the list. |
| 248 FrameSwappedCallbackList frame_swapped_callbacks_; | 249 FrameSwappedCallbackList frame_swapped_callbacks_; |
| 249 | 250 |
| 250 // The surface client ID of the parent RenderWidgetHostView. 0 if none. | 251 // The surface client ID of the parent RenderWidgetHostView. 0 if none. |
| 251 cc::FrameSinkId parent_frame_sink_id_; | 252 cc::FrameSinkId parent_frame_sink_id_; |
| 252 | 253 |
| 254 bool has_frame_ = false; |
| 255 |
| 253 base::WeakPtrFactory<RenderWidgetHostViewChildFrame> weak_factory_; | 256 base::WeakPtrFactory<RenderWidgetHostViewChildFrame> weak_factory_; |
| 254 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrame); | 257 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrame); |
| 255 }; | 258 }; |
| 256 | 259 |
| 257 } // namespace content | 260 } // namespace content |
| 258 | 261 |
| 259 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ | 262 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ |
| OLD | NEW |