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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 2770873002: Remove ViewHostMsg_DidFirstPaintAfterLoad (Closed)
Patch Set: Rebased Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index f91d39ed39505d37093b4e5a811edd8e8efa3f53..193399cc6b8012dcfd47f7c3d3dc85730fe6c050 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -283,7 +283,6 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate,
has_touch_handler_(false),
is_in_touchpad_gesture_scroll_(false),
is_in_touchscreen_gesture_scroll_(false),
- received_paint_after_load_(false),
latency_tracker_(),
next_browser_snapshot_id_(1),
owned_by_render_frame_host_(false),
@@ -570,8 +569,6 @@ bool RenderWidgetHostImpl::OnMessageReceived(const IPC::Message &msg) {
OnSelectionBoundsChanged)
IPC_MESSAGE_HANDLER(InputHostMsg_ImeCompositionRangeChanged,
OnImeCompositionRangeChanged)
- IPC_MESSAGE_HANDLER(ViewHostMsg_DidFirstPaintAfterLoad,
- OnFirstPaintAfterLoad)
IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrames, OnSetNeedsBeginFrames)
IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeTouched, OnFocusedNodeTouched)
IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging)
@@ -995,22 +992,12 @@ void RenderWidgetHostImpl::StartNewContentRenderingTimeout(
// It is possible for a compositor frame to arrive before the browser is
// notified about the page being committed, in which case no timer is
// necessary.
- if (received_paint_after_load_) {
- received_paint_after_load_ = false;
+ if (last_received_content_source_id_ >= current_content_source_id_)
return;
- }
new_content_rendering_timeout_->Start(new_content_rendering_delay_);
}
-void RenderWidgetHostImpl::OnFirstPaintAfterLoad() {
- if (new_content_rendering_timeout_->IsRunning()) {
- new_content_rendering_timeout_->Stop();
- } else {
- received_paint_after_load_ = true;
- }
-}
-
void RenderWidgetHostImpl::ForwardMouseEvent(const WebMouseEvent& mouse_event) {
ForwardMouseEventWithLatencyInfo(mouse_event,
ui::LatencyInfo(ui::SourceEventType::OTHER));
@@ -1873,6 +1860,8 @@ bool RenderWidgetHostImpl::OnSwapCompositorFrame(
last_frame_size_ = frame_size;
last_device_scale_factor_ = device_scale_factor;
+ last_received_content_source_id_ = frame.metadata.content_source_id;
+
if (frame.metadata.begin_frame_ack.sequence_number <
cc::BeginFrameArgs::kStartingFrameNumber) {
// Received an invalid ack, renderer misbehaved.
@@ -1915,6 +1904,13 @@ bool RenderWidgetHostImpl::OnSwapCompositorFrame(
resources);
}
+ // After navigation, if a frame belonging to the new page is received, stop
+ // the timer that triggers clearing the graphics of the last page.
+ if (last_received_content_source_id_ >= current_content_source_id_ &&
+ new_content_rendering_timeout_->IsRunning()) {
+ new_content_rendering_timeout_->Stop();
+ }
+
RenderProcessHost* rph = GetProcess();
for (std::vector<IPC::Message>::const_iterator i =
messages_to_deliver_with_frame.begin();
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/browser/renderer_host/render_widget_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698