| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 // Stops all existing hang monitor timeouts and assumes the renderer is | 332 // Stops all existing hang monitor timeouts and assumes the renderer is |
| 333 // responsive. | 333 // responsive. |
| 334 void StopHangMonitorTimeout(); | 334 void StopHangMonitorTimeout(); |
| 335 | 335 |
| 336 // Starts the rendering timeout, which will clear displayed graphics if | 336 // Starts the rendering timeout, which will clear displayed graphics if |
| 337 // a new compositor frame is not received before it expires. This also causes | 337 // a new compositor frame is not received before it expires. This also causes |
| 338 // any new compositor frames received with content_source_id less than | 338 // any new compositor frames received with content_source_id less than |
| 339 // |next_source_id| to be discarded. | 339 // |next_source_id| to be discarded. |
| 340 void StartNewContentRenderingTimeout(uint32_t next_source_id); | 340 void StartNewContentRenderingTimeout(uint32_t next_source_id); |
| 341 | 341 |
| 342 // Notification that a new compositor frame has been generated following | |
| 343 // a page load. This stops |new_content_rendering_timeout_|, or prevents | |
| 344 // the timer from running if the load commit message hasn't been received | |
| 345 // yet. | |
| 346 void OnFirstPaintAfterLoad(); | |
| 347 | |
| 348 // Forwards the keyboard event with optional commands to the renderer. If | 342 // Forwards the keyboard event with optional commands to the renderer. If |
| 349 // |key_event| is not forwarded for any reason, then |commands| are ignored. | 343 // |key_event| is not forwarded for any reason, then |commands| are ignored. |
| 350 // |update_event| (if non-null) is set to indicate whether the underlying | 344 // |update_event| (if non-null) is set to indicate whether the underlying |
| 351 // event in |key_event| should be updated. |update_event| is only used on | 345 // event in |key_event| should be updated. |update_event| is only used on |
| 352 // aura. | 346 // aura. |
| 353 void ForwardKeyboardEventWithCommands( | 347 void ForwardKeyboardEventWithCommands( |
| 354 const NativeWebKeyboardEvent& key_event, | 348 const NativeWebKeyboardEvent& key_event, |
| 355 const std::vector<EditCommand>* commands, | 349 const std::vector<EditCommand>* commands, |
| 356 bool* update_event = nullptr); | 350 bool* update_event = nullptr); |
| 357 | 351 |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 | 850 |
| 857 std::unique_ptr<TouchEmulator> touch_emulator_; | 851 std::unique_ptr<TouchEmulator> touch_emulator_; |
| 858 | 852 |
| 859 // Receives and handles all input events. | 853 // Receives and handles all input events. |
| 860 std::unique_ptr<InputRouter> input_router_; | 854 std::unique_ptr<InputRouter> input_router_; |
| 861 | 855 |
| 862 std::unique_ptr<TimeoutMonitor> hang_monitor_timeout_; | 856 std::unique_ptr<TimeoutMonitor> hang_monitor_timeout_; |
| 863 | 857 |
| 864 std::unique_ptr<TimeoutMonitor> new_content_rendering_timeout_; | 858 std::unique_ptr<TimeoutMonitor> new_content_rendering_timeout_; |
| 865 | 859 |
| 866 // This boolean is true if RenderWidgetHostImpl receives a compositor frame | |
| 867 // from a newly loaded page before StartNewContentRenderingTimeout() is | |
| 868 // called. This means that a paint for the new load has completed before | |
| 869 // the browser received a DidCommitProvisionalLoad message. In that case | |
| 870 // |new_content_rendering_timeout_| is not needed. The renderer will send | |
| 871 // both the FirstPaintAfterLoad and DidCommitProvisionalLoad messages after | |
| 872 // any new page navigation, it doesn't matter which is received first, and | |
| 873 // it should not be possible to interleave other navigations in between | |
| 874 // receipt of those messages (unless FirstPaintAfterLoad is prevented from | |
| 875 // being sent, in which case the timer should fire). | |
| 876 bool received_paint_after_load_; | |
| 877 | |
| 878 RenderWidgetHostLatencyTracker latency_tracker_; | 860 RenderWidgetHostLatencyTracker latency_tracker_; |
| 879 | 861 |
| 880 int next_browser_snapshot_id_; | 862 int next_browser_snapshot_id_; |
| 881 using PendingSnapshotMap = std::map<int, GetSnapshotFromBrowserCallback>; | 863 using PendingSnapshotMap = std::map<int, GetSnapshotFromBrowserCallback>; |
| 882 PendingSnapshotMap pending_browser_snapshots_; | 864 PendingSnapshotMap pending_browser_snapshots_; |
| 883 PendingSnapshotMap pending_surface_browser_snapshots_; | 865 PendingSnapshotMap pending_surface_browser_snapshots_; |
| 884 | 866 |
| 885 // Indicates whether a RenderFramehost has ownership, in which case this | 867 // Indicates whether a RenderFramehost has ownership, in which case this |
| 886 // object does not self destroy. | 868 // object does not self destroy. |
| 887 bool owned_by_render_frame_host_; | 869 bool owned_by_render_frame_host_; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 916 // a no-op for non-top-level RenderWidgets, as that should always be zero. | 898 // a no-op for non-top-level RenderWidgets, as that should always be zero. |
| 917 // TODO(kenrb, fsamuel): We should use SurfaceIDs for this purpose when they | 899 // TODO(kenrb, fsamuel): We should use SurfaceIDs for this purpose when they |
| 918 // are available in the renderer process. See https://crbug.com/695579. | 900 // are available in the renderer process. See https://crbug.com/695579. |
| 919 uint32_t current_content_source_id_; | 901 uint32_t current_content_source_id_; |
| 920 | 902 |
| 921 // When true, the RenderWidget is regularly sending updates regarding | 903 // When true, the RenderWidget is regularly sending updates regarding |
| 922 // composition info. It should only be true when there is a focused editable | 904 // composition info. It should only be true when there is a focused editable |
| 923 // node. | 905 // node. |
| 924 bool monitoring_composition_info_; | 906 bool monitoring_composition_info_; |
| 925 | 907 |
| 908 // This is the content_source_id of the latest frame received. This value is |
| 909 // compared against current_content_source_id_ to determine whether the |
| 910 // received frame belongs to the current page. If a frame for the current page |
| 911 // does not arrive in time after nagivation, we clear the graphics of the old |
| 912 // page. See RenderWidget::current_content_source_id_ for more information. |
| 913 uint32_t last_received_content_source_id_ = 0; |
| 914 |
| 926 #if defined(OS_MACOSX) | 915 #if defined(OS_MACOSX) |
| 927 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_; | 916 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_; |
| 928 #endif | 917 #endif |
| 929 | 918 |
| 930 cc::LocalSurfaceId last_local_surface_id_; | 919 cc::LocalSurfaceId last_local_surface_id_; |
| 931 gfx::Size last_frame_size_; | 920 gfx::Size last_frame_size_; |
| 932 float last_device_scale_factor_; | 921 float last_device_scale_factor_; |
| 933 | 922 |
| 934 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 923 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
| 935 | 924 |
| 936 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 925 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 937 }; | 926 }; |
| 938 | 927 |
| 939 } // namespace content | 928 } // namespace content |
| 940 | 929 |
| 941 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 930 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |