Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.h

Issue 2789773003: Send FrameSwapMessageQueue's messages with a separate IPC (Closed)
Patch Set: Fix rebase mistake Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/bad_message.h ('k') | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 const ViewHostMsg_SelectionBounds_Params& params); 660 const ViewHostMsg_SelectionBounds_Params& params);
661 void OnSetNeedsBeginFrames(bool needs_begin_frames); 661 void OnSetNeedsBeginFrames(bool needs_begin_frames);
662 void OnHittestData(const FrameHostMsg_HittestData_Params& params); 662 void OnHittestData(const FrameHostMsg_HittestData_Params& params);
663 void OnFocusedNodeTouched(bool editable); 663 void OnFocusedNodeTouched(bool editable);
664 void OnStartDragging(const DropData& drop_data, 664 void OnStartDragging(const DropData& drop_data,
665 blink::WebDragOperationsMask operations_allowed, 665 blink::WebDragOperationsMask operations_allowed,
666 const SkBitmap& bitmap, 666 const SkBitmap& bitmap,
667 const gfx::Vector2d& bitmap_offset_in_dip, 667 const gfx::Vector2d& bitmap_offset_in_dip,
668 const DragEventSourceInfo& event_info); 668 const DragEventSourceInfo& event_info);
669 void OnUpdateDragCursor(blink::WebDragOperation current_op); 669 void OnUpdateDragCursor(blink::WebDragOperation current_op);
670 void OnFrameSwapMessagesReceived(uint32_t frame_token,
671 std::vector<IPC::Message> messages);
670 672
671 // Called (either immediately or asynchronously) after we're done with our 673 // Called (either immediately or asynchronously) after we're done with our
672 // BackingStore and can send an ACK to the renderer so it can paint onto it 674 // BackingStore and can send an ACK to the renderer so it can paint onto it
673 // again. 675 // again.
674 void DidUpdateBackingStore(const ViewHostMsg_UpdateRect_Params& params, 676 void DidUpdateBackingStore(const ViewHostMsg_UpdateRect_Params& params,
675 const base::TimeTicks& paint_start); 677 const base::TimeTicks& paint_start);
676 678
677 // Give key press listeners a chance to handle this key press. This allow 679 // Give key press listeners a chance to handle this key press. This allow
678 // widgets that don't have focus to still handle key presses. 680 // widgets that don't have focus to still handle key presses.
679 bool KeyPressListenersHandleEvent(const NativeWebKeyboardEvent& event); 681 bool KeyPressListenersHandleEvent(const NativeWebKeyboardEvent& event);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 void StartHangMonitorTimeout(base::TimeDelta delay, 736 void StartHangMonitorTimeout(base::TimeDelta delay,
735 blink::WebInputEvent::Type event_type); 737 blink::WebInputEvent::Type event_type);
736 738
737 // Stops all existing hang monitor timeouts and assumes the renderer is 739 // Stops all existing hang monitor timeouts and assumes the renderer is
738 // responsive. 740 // responsive.
739 void StopHangMonitorTimeout(); 741 void StopHangMonitorTimeout();
740 742
741 // Used for UMA logging how long the renderer was unresponsive. 743 // Used for UMA logging how long the renderer was unresponsive.
742 void LogHangMonitorUnresponsive(); 744 void LogHangMonitorUnresponsive();
743 745
746 // Signals that a frame with token |frame_token| was finished processing. If
747 // there are any queued messages belonging to it, they will be processed.
748 void DidProcessFrame(uint32_t frame_token);
749
750 // Once both the frame and its swap messages arrive, we call this method to
751 // process the messages. Virtual for tests.
752 virtual void ProcessSwapMessages(std::vector<IPC::Message> messages);
753
744 // true if a renderer has once been valid. We use this flag to display a sad 754 // true if a renderer has once been valid. We use this flag to display a sad
745 // tab only when we lose our renderer and not if a paint occurs during 755 // tab only when we lose our renderer and not if a paint occurs during
746 // initialization. 756 // initialization.
747 bool renderer_initialized_; 757 bool renderer_initialized_;
748 758
749 // True if |Destroy()| has been called. 759 // True if |Destroy()| has been called.
750 bool destroyed_; 760 bool destroyed_;
751 761
752 // Our delegate, which wants to know mainly about keyboard events. 762 // Our delegate, which wants to know mainly about keyboard events.
753 // It will remain non-NULL until DetachDelegate() is called. 763 // It will remain non-NULL until DetachDelegate() is called.
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 gfx::Size last_frame_size_; 958 gfx::Size last_frame_size_;
949 float last_device_scale_factor_; 959 float last_device_scale_factor_;
950 960
951 // Each instance of RendererCompositorFrameSink has an ID that we keep track 961 // Each instance of RendererCompositorFrameSink has an ID that we keep track
952 // of so we can tell when a new instance has been created for the purpose of 962 // of so we can tell when a new instance has been created for the purpose of
953 // not returning stale resources. 963 // not returning stale resources.
954 uint32_t last_compositor_frame_sink_id_ = 0; 964 uint32_t last_compositor_frame_sink_id_ = 0;
955 965
956 cc::CompositorFrameMetadata last_frame_metadata_; 966 cc::CompositorFrameMetadata last_frame_metadata_;
957 967
968 // Last non-zero frame token received from the renderer. Any swap messsages
969 // having a token less than or equal to this value will be processed.
970 uint32_t last_received_frame_token_ = 0;
971
972 // List of all swap messages that their corresponding frames have not arrived.
973 // Sorted by frame token.
974 std::queue<std::pair<uint32_t, std::vector<IPC::Message>>> queued_messages_;
975
958 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; 976 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_;
959 977
960 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); 978 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);
961 }; 979 };
962 980
963 } // namespace content 981 } // namespace content
964 982
965 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 983 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/bad_message.h ('k') | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698