| 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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 const ViewHostMsg_SelectionBounds_Params& params); | 655 const ViewHostMsg_SelectionBounds_Params& params); |
| 656 void OnSetNeedsBeginFrames(bool needs_begin_frames); | 656 void OnSetNeedsBeginFrames(bool needs_begin_frames); |
| 657 void OnHittestData(const FrameHostMsg_HittestData_Params& params); | 657 void OnHittestData(const FrameHostMsg_HittestData_Params& params); |
| 658 void OnFocusedNodeTouched(bool editable); | 658 void OnFocusedNodeTouched(bool editable); |
| 659 void OnStartDragging(const DropData& drop_data, | 659 void OnStartDragging(const DropData& drop_data, |
| 660 blink::WebDragOperationsMask operations_allowed, | 660 blink::WebDragOperationsMask operations_allowed, |
| 661 const SkBitmap& bitmap, | 661 const SkBitmap& bitmap, |
| 662 const gfx::Vector2d& bitmap_offset_in_dip, | 662 const gfx::Vector2d& bitmap_offset_in_dip, |
| 663 const DragEventSourceInfo& event_info); | 663 const DragEventSourceInfo& event_info); |
| 664 void OnUpdateDragCursor(blink::WebDragOperation current_op); | 664 void OnUpdateDragCursor(blink::WebDragOperation current_op); |
| 665 void OnFrameSwapMessagesReceived(uint32_t frame_token, |
| 666 std::vector<IPC::Message> messages); |
| 665 | 667 |
| 666 // Called (either immediately or asynchronously) after we're done with our | 668 // Called (either immediately or asynchronously) after we're done with our |
| 667 // BackingStore and can send an ACK to the renderer so it can paint onto it | 669 // BackingStore and can send an ACK to the renderer so it can paint onto it |
| 668 // again. | 670 // again. |
| 669 void DidUpdateBackingStore(const ViewHostMsg_UpdateRect_Params& params, | 671 void DidUpdateBackingStore(const ViewHostMsg_UpdateRect_Params& params, |
| 670 const base::TimeTicks& paint_start); | 672 const base::TimeTicks& paint_start); |
| 671 | 673 |
| 672 // Give key press listeners a chance to handle this key press. This allow | 674 // Give key press listeners a chance to handle this key press. This allow |
| 673 // widgets that don't have focus to still handle key presses. | 675 // widgets that don't have focus to still handle key presses. |
| 674 bool KeyPressListenersHandleEvent(const NativeWebKeyboardEvent& event); | 676 bool KeyPressListenersHandleEvent(const NativeWebKeyboardEvent& event); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 void StartHangMonitorTimeout(base::TimeDelta delay, | 731 void StartHangMonitorTimeout(base::TimeDelta delay, |
| 730 blink::WebInputEvent::Type event_type); | 732 blink::WebInputEvent::Type event_type); |
| 731 | 733 |
| 732 // Stops all existing hang monitor timeouts and assumes the renderer is | 734 // Stops all existing hang monitor timeouts and assumes the renderer is |
| 733 // responsive. | 735 // responsive. |
| 734 void StopHangMonitorTimeout(); | 736 void StopHangMonitorTimeout(); |
| 735 | 737 |
| 736 // Used for UMA logging how long the renderer was unresponsive. | 738 // Used for UMA logging how long the renderer was unresponsive. |
| 737 void LogHangMonitorUnresponsive(); | 739 void LogHangMonitorUnresponsive(); |
| 738 | 740 |
| 741 // Signals that a frame with token |frame_token| was finished processing. If |
| 742 // there are any queued messages belonging to it, they will be processed. |
| 743 void DidProcessFrame(uint32_t frame_token); |
| 744 |
| 745 // Once both the frame and its swap messages arrive, we call this method to |
| 746 // process the messages. Virtual for tests. |
| 747 virtual void ProcessSwapMessages(std::vector<IPC::Message> messages); |
| 748 |
| 739 // true if a renderer has once been valid. We use this flag to display a sad | 749 // true if a renderer has once been valid. We use this flag to display a sad |
| 740 // tab only when we lose our renderer and not if a paint occurs during | 750 // tab only when we lose our renderer and not if a paint occurs during |
| 741 // initialization. | 751 // initialization. |
| 742 bool renderer_initialized_; | 752 bool renderer_initialized_; |
| 743 | 753 |
| 744 // True if |Destroy()| has been called. | 754 // True if |Destroy()| has been called. |
| 745 bool destroyed_; | 755 bool destroyed_; |
| 746 | 756 |
| 747 // Our delegate, which wants to know mainly about keyboard events. | 757 // Our delegate, which wants to know mainly about keyboard events. |
| 748 // It will remain non-NULL until DetachDelegate() is called. | 758 // It will remain non-NULL until DetachDelegate() is called. |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 // factor change, a new LocalSurfaceId must be created. | 951 // factor change, a new LocalSurfaceId must be created. |
| 942 cc::LocalSurfaceId last_local_surface_id_; | 952 cc::LocalSurfaceId last_local_surface_id_; |
| 943 gfx::Size last_frame_size_; | 953 gfx::Size last_frame_size_; |
| 944 float last_device_scale_factor_; | 954 float last_device_scale_factor_; |
| 945 | 955 |
| 946 // Each instance of RendererCompositorFrameSink has an ID that we keep track | 956 // Each instance of RendererCompositorFrameSink has an ID that we keep track |
| 947 // of so we can tell when a new instance has been created for the purpose of | 957 // of so we can tell when a new instance has been created for the purpose of |
| 948 // not returning stale resources. | 958 // not returning stale resources. |
| 949 uint32_t last_compositor_frame_sink_id_ = 0; | 959 uint32_t last_compositor_frame_sink_id_ = 0; |
| 950 | 960 |
| 961 // Last non-zero frame token received from the renderer. Any swap messsages |
| 962 // having a token less than or equal to this value will be processed. |
| 963 uint32_t last_received_frame_token_ = 0; |
| 964 |
| 965 // List of all swap messages that their corresponding frames have not arrived. |
| 966 // Sorted by frame token. |
| 967 std::queue<std::pair<uint32_t, std::vector<IPC::Message>>> queued_messages_; |
| 968 |
| 951 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 969 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
| 952 | 970 |
| 953 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 971 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 954 }; | 972 }; |
| 955 | 973 |
| 956 } // namespace content | 974 } // namespace content |
| 957 | 975 |
| 958 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 976 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |