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 0f488d8d88c866c07413ade08acdc0fc1ff70551..45c15bf44d4435df01ee2b7ecc3736526097850a 100644 |
--- a/content/browser/renderer_host/render_widget_host_impl.cc |
+++ b/content/browser/renderer_host/render_widget_host_impl.cc |
@@ -294,6 +294,7 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate, |
last_event_type_(blink::WebInputEvent::Undefined), |
new_content_rendering_delay_( |
base::TimeDelta::FromMilliseconds(kNewContentRenderingDelayMs)), |
+ current_content_source_id_(0), |
weak_factory_(this) { |
CHECK(delegate_); |
CHECK_NE(MSG_ROUTING_NONE, routing_id_); |
@@ -1010,7 +1011,9 @@ void RenderWidgetHostImpl::StopHangMonitorTimeout() { |
RendererIsResponsive(); |
} |
-void RenderWidgetHostImpl::StartNewContentRenderingTimeout() { |
+void RenderWidgetHostImpl::StartNewContentRenderingTimeout( |
+ uint32_t next_source_id) { |
+ current_content_source_id_ = next_source_id; |
// 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. |
@@ -1849,6 +1852,10 @@ bool RenderWidgetHostImpl::OnSwapCompositorFrame( |
latency_tracker_.OnSwapCompositorFrame(&frame.metadata.latency_info); |
+ // Ignore this frame if its content has already been unloaded. |
enne (OOO)
2017/02/28 22:23:21
I agree that maybe the mobile optimized and double
kenrb
2017/03/01 15:32:47
Done.
|
+ if (frame.metadata.content_source_id < current_content_source_id_) |
+ return false; |
+ |
bool is_mobile_optimized = IsMobileOptimizedFrame(frame.metadata); |
input_router_->NotifySiteIsMobileOptimized(is_mobile_optimized); |
if (touch_emulator_) |