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_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 void StartHangMonitorTimeout(base::TimeDelta delay); | 256 void StartHangMonitorTimeout(base::TimeDelta delay); |
257 | 257 |
258 // Stops all existing hang monitor timeouts and assumes the renderer is | 258 // Stops all existing hang monitor timeouts and assumes the renderer is |
259 // responsive. | 259 // responsive. |
260 void StopHangMonitorTimeout(); | 260 void StopHangMonitorTimeout(); |
261 | 261 |
262 // Starts the rendering timeout, which will clear displayed graphics if | 262 // Starts the rendering timeout, which will clear displayed graphics if |
263 // a new compositor frame is not received before it expires. | 263 // a new compositor frame is not received before it expires. |
264 void StartNewContentRenderingTimeout(); | 264 void StartNewContentRenderingTimeout(); |
265 | 265 |
266 // Stops the rendering timeout and prevents it from clearing any displayed | 266 // Notification that a new compositor frame has been generated following |
267 // graphics. | 267 // a page load. This stops |new_content_rendering_timeout_|, or prevents |
268 void StopNewContentRenderingTimeout(); | 268 // the timer from running if the load commit message hasn't been received |
| 269 // yet. |
| 270 void OnFirstPaintAfterLoad(); |
269 | 271 |
270 // Forwards the given message to the renderer. These are called by the view | 272 // Forwards the given message to the renderer. These are called by the view |
271 // when it has received a message. | 273 // when it has received a message. |
272 void ForwardGestureEventWithLatencyInfo( | 274 void ForwardGestureEventWithLatencyInfo( |
273 const blink::WebGestureEvent& gesture_event, | 275 const blink::WebGestureEvent& gesture_event, |
274 const ui::LatencyInfo& ui_latency); | 276 const ui::LatencyInfo& ui_latency); |
275 void ForwardTouchEventWithLatencyInfo( | 277 void ForwardTouchEventWithLatencyInfo( |
276 const blink::WebTouchEvent& touch_event, | 278 const blink::WebTouchEvent& touch_event, |
277 const ui::LatencyInfo& ui_latency); | 279 const ui::LatencyInfo& ui_latency); |
278 void ForwardMouseEventWithLatencyInfo( | 280 void ForwardMouseEventWithLatencyInfo( |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 | 806 |
805 scoped_ptr<TouchEmulator> touch_emulator_; | 807 scoped_ptr<TouchEmulator> touch_emulator_; |
806 | 808 |
807 // Receives and handles all input events. | 809 // Receives and handles all input events. |
808 scoped_ptr<InputRouter> input_router_; | 810 scoped_ptr<InputRouter> input_router_; |
809 | 811 |
810 scoped_ptr<TimeoutMonitor> hang_monitor_timeout_; | 812 scoped_ptr<TimeoutMonitor> hang_monitor_timeout_; |
811 | 813 |
812 scoped_ptr<TimeoutMonitor> new_content_rendering_timeout_; | 814 scoped_ptr<TimeoutMonitor> new_content_rendering_timeout_; |
813 | 815 |
| 816 // This boolean is true if RenderWidgetHostImpl receives a compositor frame |
| 817 // from a newly loaded page before StartNewContentRenderingTimeout() is |
| 818 // called. This means that a paint for the new load has completed before |
| 819 // the browser received a DidCommitProvisionalLoad message. In that case |
| 820 // |new_content_rendering_timeout_| is not needed. The renderer will send |
| 821 // both the FirstPaintAfterLoad and DidCommitProvisionalLoad messages after |
| 822 // any new page navigation, it doesn't matter which is received first, and |
| 823 // it should not be possible to interleave other navigations in between |
| 824 // receipt of those messages (unless FirstPaintAfterLoad is prevented from |
| 825 // being sent, in which case the timer should fire). |
| 826 bool received_paint_after_load_; |
| 827 |
814 #if defined(OS_WIN) | 828 #if defined(OS_WIN) |
815 std::list<HWND> dummy_windows_for_activation_; | 829 std::list<HWND> dummy_windows_for_activation_; |
816 #endif | 830 #endif |
817 | 831 |
818 RenderWidgetHostLatencyTracker latency_tracker_; | 832 RenderWidgetHostLatencyTracker latency_tracker_; |
819 | 833 |
820 int next_browser_snapshot_id_; | 834 int next_browser_snapshot_id_; |
821 using PendingSnapshotMap = std::map<int, GetSnapshotFromBrowserCallback>; | 835 using PendingSnapshotMap = std::map<int, GetSnapshotFromBrowserCallback>; |
822 PendingSnapshotMap pending_browser_snapshots_; | 836 PendingSnapshotMap pending_browser_snapshots_; |
823 | 837 |
824 // Indicates whether a RenderFramehost has ownership, in which case this | 838 // Indicates whether a RenderFramehost has ownership, in which case this |
825 // object does not self destroy. | 839 // object does not self destroy. |
826 bool owned_by_render_frame_host_; | 840 bool owned_by_render_frame_host_; |
827 | 841 |
828 // Indicates whether this RenderWidgetHost thinks is focused. This is trying | 842 // Indicates whether this RenderWidgetHost thinks is focused. This is trying |
829 // to match what the renderer process knows. It is different from | 843 // to match what the renderer process knows. It is different from |
830 // RenderWidgetHostView::HasFocus in that in that the focus request may fail, | 844 // RenderWidgetHostView::HasFocus in that in that the focus request may fail, |
831 // causing HasFocus to return false when is_focused_ is true. | 845 // causing HasFocus to return false when is_focused_ is true. |
832 bool is_focused_; | 846 bool is_focused_; |
833 | 847 |
834 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 848 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
835 | 849 |
836 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 850 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
837 }; | 851 }; |
838 | 852 |
839 } // namespace content | 853 } // namespace content |
840 | 854 |
841 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 855 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
OLD | NEW |