OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_RENDERER_RENDER_WIDGET_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_ |
6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ | 6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/debug/trace_event_synthetic_delay.h" |
13 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
15 #include "base/time/time.h" | 16 #include "base/time/time.h" |
16 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
17 #include "cc/debug/rendering_stats_instrumentation.h" | 18 #include "cc/debug/rendering_stats_instrumentation.h" |
18 #include "content/common/browser_rendering_stats.h" | 19 #include "content/common/browser_rendering_stats.h" |
19 #include "content/common/content_export.h" | 20 #include "content/common/content_export.h" |
20 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 21 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
21 #include "content/common/input/synthetic_gesture_params.h" | 22 #include "content/common/input/synthetic_gesture_params.h" |
22 #include "content/renderer/paint_aggregator.h" | 23 #include "content/renderer/paint_aggregator.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 } | 65 } |
65 | 66 |
66 namespace content { | 67 namespace content { |
67 class ExternalPopupMenu; | 68 class ExternalPopupMenu; |
68 class PepperPluginInstanceImpl; | 69 class PepperPluginInstanceImpl; |
69 class RenderWidgetCompositor; | 70 class RenderWidgetCompositor; |
70 class RenderWidgetTest; | 71 class RenderWidgetTest; |
71 class ResizingModeSelector; | 72 class ResizingModeSelector; |
72 struct ContextMenuParams; | 73 struct ContextMenuParams; |
73 struct GpuRenderingStats; | 74 struct GpuRenderingStats; |
| 75 struct SyntheticDelayConfiguration; |
74 struct WebPluginGeometry; | 76 struct WebPluginGeometry; |
75 | 77 |
76 // RenderWidget provides a communication bridge between a WebWidget and | 78 // RenderWidget provides a communication bridge between a WebWidget and |
77 // a RenderWidgetHost, the latter of which lives in a different process. | 79 // a RenderWidgetHost, the latter of which lives in a different process. |
78 class CONTENT_EXPORT RenderWidget | 80 class CONTENT_EXPORT RenderWidget |
79 : public IPC::Listener, | 81 : public IPC::Listener, |
80 public IPC::Sender, | 82 public IPC::Sender, |
81 NON_EXPORTED_BASE(virtual public blink::WebWidgetClient), | 83 NON_EXPORTED_BASE(virtual public blink::WebWidgetClient), |
82 public base::RefCounted<RenderWidget> { | 84 public base::RefCounted<RenderWidget> { |
83 public: | 85 public: |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 180 |
179 // Callback for use with synthetic gestures (e.g. BeginSmoothScroll). | 181 // Callback for use with synthetic gestures (e.g. BeginSmoothScroll). |
180 typedef base::Callback<void()> SyntheticGestureCompletionCallback; | 182 typedef base::Callback<void()> SyntheticGestureCompletionCallback; |
181 | 183 |
182 // Send a synthetic gesture to the browser to be queued to the synthetic | 184 // Send a synthetic gesture to the browser to be queued to the synthetic |
183 // gesture controller. | 185 // gesture controller. |
184 void QueueSyntheticGesture( | 186 void QueueSyntheticGesture( |
185 scoped_ptr<SyntheticGestureParams> gesture_params, | 187 scoped_ptr<SyntheticGestureParams> gesture_params, |
186 const SyntheticGestureCompletionCallback& callback); | 188 const SyntheticGestureCompletionCallback& callback); |
187 | 189 |
| 190 // Configure synthetic delays across all processes. Once all processes have |
| 191 // acknowledged the new delay configuration, |callback| will be called back. |
| 192 typedef base::Callback<void()> SyntheticDelayConfigurationCallback; |
| 193 void ConfigureSyntheticDelays( |
| 194 const std::vector<content::SyntheticDelayConfiguration>& delays, |
| 195 const SyntheticDelayConfigurationCallback& callback); |
| 196 |
188 // Close the underlying WebWidget. | 197 // Close the underlying WebWidget. |
189 virtual void Close(); | 198 virtual void Close(); |
190 | 199 |
191 // Notifies about a compositor frame commit operation having finished. | 200 // Notifies about a compositor frame commit operation having finished. |
192 virtual void DidCommitCompositorFrame(); | 201 virtual void DidCommitCompositorFrame(); |
193 | 202 |
194 float filtered_time_per_frame() const { | 203 float filtered_time_per_frame() const { |
195 return filtered_time_per_frame_; | 204 return filtered_time_per_frame_; |
196 } | 205 } |
197 | 206 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 int selection_end); | 347 int selection_end); |
339 virtual void OnImeConfirmComposition(const string16& text, | 348 virtual void OnImeConfirmComposition(const string16& text, |
340 const gfx::Range& replacement_range, | 349 const gfx::Range& replacement_range, |
341 bool keep_selection); | 350 bool keep_selection); |
342 void OnPaintAtSize(const TransportDIB::Handle& dib_id, | 351 void OnPaintAtSize(const TransportDIB::Handle& dib_id, |
343 int tag, | 352 int tag, |
344 const gfx::Size& page_size, | 353 const gfx::Size& page_size, |
345 const gfx::Size& desired_size); | 354 const gfx::Size& desired_size); |
346 void OnRepaint(gfx::Size size_to_paint); | 355 void OnRepaint(gfx::Size size_to_paint); |
347 void OnSyntheticGestureCompleted(); | 356 void OnSyntheticGestureCompleted(); |
| 357 void OnConfigureSyntheticDelaysAck(); |
348 void OnSetTextDirection(blink::WebTextDirection direction); | 358 void OnSetTextDirection(blink::WebTextDirection direction); |
349 void OnGetFPS(); | 359 void OnGetFPS(); |
350 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect, | 360 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect, |
351 const gfx::Rect& window_screen_rect); | 361 const gfx::Rect& window_screen_rect); |
352 #if defined(OS_ANDROID) | 362 #if defined(OS_ANDROID) |
353 void OnShowImeIfNeeded(); | 363 void OnShowImeIfNeeded(); |
354 | 364 |
355 // Whenever an IME event that needs an acknowledgement is sent to the browser, | 365 // Whenever an IME event that needs an acknowledgement is sent to the browser, |
356 // the number of outstanding IME events that needs acknowledgement should be | 366 // the number of outstanding IME events that needs acknowledgement should be |
357 // incremented. All IME events will be dropped until we receive an ack from | 367 // incremented. All IME events will be dropped until we receive an ack from |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 // The device scale factor. This value is computed from the DPI entries in | 750 // The device scale factor. This value is computed from the DPI entries in |
741 // |screen_info_| on some platforms, and defaults to 1 on other platforms. | 751 // |screen_info_| on some platforms, and defaults to 1 on other platforms. |
742 float device_scale_factor_; | 752 float device_scale_factor_; |
743 | 753 |
744 // State associated with synthetic gestures. Synthetic gestures are processed | 754 // State associated with synthetic gestures. Synthetic gestures are processed |
745 // in-order, so a queue is sufficient to identify the correct state for a | 755 // in-order, so a queue is sufficient to identify the correct state for a |
746 // completed gesture. | 756 // completed gesture. |
747 std::queue<SyntheticGestureCompletionCallback> | 757 std::queue<SyntheticGestureCompletionCallback> |
748 pending_synthetic_gesture_callbacks_; | 758 pending_synthetic_gesture_callbacks_; |
749 | 759 |
| 760 SyntheticDelayConfigurationCallback pending_delay_configuration_; |
| 761 |
750 // Specified whether the compositor will run in its own thread. | 762 // Specified whether the compositor will run in its own thread. |
751 bool is_threaded_compositing_enabled_; | 763 bool is_threaded_compositing_enabled_; |
752 | 764 |
753 // The last set of rendering stats received from the browser. This is only | 765 // The last set of rendering stats received from the browser. This is only |
754 // received when using the --enable-gpu-benchmarking flag. | 766 // received when using the --enable-gpu-benchmarking flag. |
755 BrowserRenderingStats browser_rendering_stats_; | 767 BrowserRenderingStats browser_rendering_stats_; |
756 | 768 |
757 // The latency information for any current non-accelerated-compositing | 769 // The latency information for any current non-accelerated-compositing |
758 // frame. | 770 // frame. |
759 ui::LatencyInfo latency_info_; | 771 ui::LatencyInfo latency_info_; |
(...skipping 16 matching lines...) Expand all Loading... |
776 float popup_origin_scale_for_emulation_; | 788 float popup_origin_scale_for_emulation_; |
777 | 789 |
778 scoped_ptr<ResizingModeSelector> resizing_mode_selector_; | 790 scoped_ptr<ResizingModeSelector> resizing_mode_selector_; |
779 | 791 |
780 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 792 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
781 }; | 793 }; |
782 | 794 |
783 } // namespace content | 795 } // namespace content |
784 | 796 |
785 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 797 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
OLD | NEW |