| 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 |
| 11 #include <deque> | 11 #include <deque> |
| 12 #include <memory> | 12 #include <memory> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/callback.h" | 15 #include "base/callback.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 18 #include "cc/resources/returned_resource.h" | 18 #include "cc/resources/returned_resource.h" |
| 19 #include "cc/scheduler/begin_frame_source.h" | 19 #include "cc/scheduler/begin_frame_source.h" |
| 20 #include "cc/surfaces/compositor_frame_sink_support_client.h" | 20 #include "cc/surfaces/compositor_frame_sink_support_client.h" |
| 21 #include "cc/surfaces/local_surface_id_allocator.h" | |
| 22 #include "cc/surfaces/surface_info.h" | 21 #include "cc/surfaces/surface_info.h" |
| 23 #include "cc/surfaces/surface_sequence.h" | 22 #include "cc/surfaces/surface_sequence.h" |
| 24 #include "content/browser/compositor/image_transport_factory.h" | 23 #include "content/browser/compositor/image_transport_factory.h" |
| 25 #include "content/browser/renderer_host/event_with_latency_info.h" | 24 #include "content/browser/renderer_host/event_with_latency_info.h" |
| 26 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 25 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 27 #include "content/common/content_export.h" | 26 #include "content/common/content_export.h" |
| 28 #include "content/common/input/input_event_ack_state.h" | 27 #include "content/common/input/input_event_ack_state.h" |
| 29 #include "content/public/browser/readback_types.h" | 28 #include "content/public/browser/readback_types.h" |
| 30 #include "ui/gfx/geometry/rect.h" | 29 #include "ui/gfx/geometry/rect.h" |
| 31 #include "ui/gfx/native_widget_types.h" | 30 #include "ui/gfx/native_widget_types.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 void UpdateCursor(const WebCursor& cursor) override; | 99 void UpdateCursor(const WebCursor& cursor) override; |
| 101 void SetIsLoading(bool is_loading) override; | 100 void SetIsLoading(bool is_loading) override; |
| 102 void RenderProcessGone(base::TerminationStatus status, | 101 void RenderProcessGone(base::TerminationStatus status, |
| 103 int error_code) override; | 102 int error_code) override; |
| 104 void Destroy() override; | 103 void Destroy() override; |
| 105 void SetTooltipText(const base::string16& tooltip_text) override; | 104 void SetTooltipText(const base::string16& tooltip_text) override; |
| 106 bool HasAcceleratedSurface(const gfx::Size& desired_size) override; | 105 bool HasAcceleratedSurface(const gfx::Size& desired_size) override; |
| 107 void GestureEventAck(const blink::WebGestureEvent& event, | 106 void GestureEventAck(const blink::WebGestureEvent& event, |
| 108 InputEventAckState ack_result) override; | 107 InputEventAckState ack_result) override; |
| 109 void OnSwapCompositorFrame(uint32_t compositor_frame_sink_id, | 108 void OnSwapCompositorFrame(uint32_t compositor_frame_sink_id, |
| 109 const cc::LocalSurfaceId& local_surface_id, |
| 110 cc::CompositorFrame frame) override; | 110 cc::CompositorFrame frame) override; |
| 111 // Since the URL of content rendered by this class is not displayed in | 111 // Since the URL of content rendered by this class is not displayed in |
| 112 // the URL bar, this method does not need an implementation. | 112 // the URL bar, this method does not need an implementation. |
| 113 void ClearCompositorFrame() override {} | 113 void ClearCompositorFrame() override {} |
| 114 gfx::Rect GetBoundsInRootWindow() override; | 114 gfx::Rect GetBoundsInRootWindow() override; |
| 115 void ProcessAckedTouchEvent(const TouchEventWithLatencyInfo& touch, | 115 void ProcessAckedTouchEvent(const TouchEventWithLatencyInfo& touch, |
| 116 InputEventAckState ack_result) override; | 116 InputEventAckState ack_result) override; |
| 117 bool LockMouse() override; | 117 bool LockMouse() override; |
| 118 void UnlockMouse() override; | 118 void UnlockMouse() override; |
| 119 cc::FrameSinkId GetFrameSinkId() override; | 119 cc::FrameSinkId GetFrameSinkId() override; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 protected: | 185 protected: |
| 186 friend class RenderWidgetHostView; | 186 friend class RenderWidgetHostView; |
| 187 friend class RenderWidgetHostViewChildFrameTest; | 187 friend class RenderWidgetHostViewChildFrameTest; |
| 188 friend class RenderWidgetHostViewGuestSurfaceTest; | 188 friend class RenderWidgetHostViewGuestSurfaceTest; |
| 189 | 189 |
| 190 explicit RenderWidgetHostViewChildFrame(RenderWidgetHost* widget); | 190 explicit RenderWidgetHostViewChildFrame(RenderWidgetHost* widget); |
| 191 void Init(); | 191 void Init(); |
| 192 | 192 |
| 193 void ProcessCompositorFrame(uint32_t compositor_frame_sink_id, | 193 void ProcessCompositorFrame(uint32_t compositor_frame_sink_id, |
| 194 const cc::LocalSurfaceId& local_surface_id, |
| 194 cc::CompositorFrame frame); | 195 cc::CompositorFrame frame); |
| 195 | 196 |
| 196 void SendSurfaceInfoToEmbedder(); | 197 void SendSurfaceInfoToEmbedder(); |
| 197 | 198 |
| 198 // Clears current compositor surface, if one is in use. | 199 // Clears current compositor surface, if one is in use. |
| 199 void ClearCompositorSurfaceIfNecessary(); | 200 void ClearCompositorSurfaceIfNecessary(); |
| 200 | 201 |
| 201 void ProcessFrameSwappedCallbacks(); | 202 void ProcessFrameSwappedCallbacks(); |
| 202 | 203 |
| 203 // The last scroll offset of the view. | 204 // The last scroll offset of the view. |
| 204 gfx::Vector2dF last_scroll_offset_; | 205 gfx::Vector2dF last_scroll_offset_; |
| 205 | 206 |
| 206 // Members will become private when RenderWidgetHostViewGuest is removed. | 207 // Members will become private when RenderWidgetHostViewGuest is removed. |
| 207 // The model object. | 208 // The model object. |
| 208 RenderWidgetHostImpl* host_; | 209 RenderWidgetHostImpl* host_; |
| 209 | 210 |
| 210 // The ID for FrameSink associated with this view. | 211 // The ID for FrameSink associated with this view. |
| 211 cc::FrameSinkId frame_sink_id_; | 212 cc::FrameSinkId frame_sink_id_; |
| 212 | 213 |
| 213 // Surface-related state. | 214 // Surface-related state. |
| 214 std::unique_ptr<cc::LocalSurfaceIdAllocator> id_allocator_; | |
| 215 std::unique_ptr<cc::CompositorFrameSinkSupport> support_; | 215 std::unique_ptr<cc::CompositorFrameSinkSupport> support_; |
| 216 cc::LocalSurfaceId local_surface_id_; | 216 cc::LocalSurfaceId local_surface_id_; |
| 217 uint32_t next_surface_sequence_; | 217 uint32_t next_surface_sequence_; |
| 218 uint32_t last_compositor_frame_sink_id_; | 218 uint32_t last_compositor_frame_sink_id_; |
| 219 gfx::Size current_surface_size_; | 219 gfx::Size current_surface_size_; |
| 220 float current_surface_scale_factor_; | 220 float current_surface_scale_factor_; |
| 221 gfx::Rect last_screen_rect_; | 221 gfx::Rect last_screen_rect_; |
| 222 | 222 |
| 223 // frame_connector_ provides a platform abstraction. Messages | 223 // frame_connector_ provides a platform abstraction. Messages |
| 224 // sent through it are routed to the embedding renderer process. | 224 // sent through it are routed to the embedding renderer process. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 253 | 253 |
| 254 bool has_frame_ = false; | 254 bool has_frame_ = false; |
| 255 | 255 |
| 256 base::WeakPtrFactory<RenderWidgetHostViewChildFrame> weak_factory_; | 256 base::WeakPtrFactory<RenderWidgetHostViewChildFrame> weak_factory_; |
| 257 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrame); | 257 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrame); |
| 258 }; | 258 }; |
| 259 | 259 |
| 260 } // namespace content | 260 } // namespace content |
| 261 | 261 |
| 262 #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 |