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

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

Issue 1339803002: Clear page display after navigation if no rendered output arrives (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made ClearCompositorFrame pure virtual Created 5 years, 3 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.h
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 56ef44edfc80fe2b97256b5e65869543e0c92356..06d502f31d452a0cc087931c9e632733d1e6a441 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -116,6 +116,11 @@ class CONTENT_EXPORT RenderWidgetHostImpl
hung_renderer_delay_ = delay;
}
+ void set_new_content_rendering_delay_for_testing(
+ const base::TimeDelta& delay) {
+ new_content_rendering_delay_ = delay;
+ }
+
// RenderWidgetHost implementation.
void UpdateTextDirection(blink::WebTextDirection direction) override;
void NotifyTextDirection() override;
@@ -258,6 +263,14 @@ class CONTENT_EXPORT RenderWidgetHostImpl
// responsive.
void StopHangMonitorTimeout();
+ // Starts the rendering timeout, which will clear displayed graphics if
+ // a new compositor frame is not received before it expires.
+ void StartNewContentRenderingTimeout();
+
+ // Stops the rendering timeout and prevents it from clearing any displayed
+ // graphics.
+ void StopNewContentRenderingTimeout();
+
// Forwards the given message to the renderer. These are called by the view
// when it has received a message.
void ForwardGestureEventWithLatencyInfo(
@@ -492,6 +505,10 @@ class CONTENT_EXPORT RenderWidgetHostImpl
virtual void NotifyRendererUnresponsive() {}
virtual void NotifyRendererResponsive() {}
+ // Callback for notification that we failed to receive any rendered graphics
+ // from a newly loaded page. Used for testing.
+ virtual void NotifyNewContentRenderingTimeoutForTesting() {}
+
// Called when auto-resize resulted in the renderer size changing.
virtual void OnRenderAutoResized(const gfx::Size& new_size) {}
@@ -552,6 +569,10 @@ class CONTENT_EXPORT RenderWidgetHostImpl
// This value indicates how long to wait before we consider a renderer hung.
base::TimeDelta hung_renderer_delay_;
+ // This value indicates how long to wait for a new compositor frame from a
+ // renderer process before clearing any previously displayed content.
+ base::TimeDelta new_content_rendering_delay_;
+
private:
friend class MockRenderWidgetHost;
@@ -561,6 +582,10 @@ class CONTENT_EXPORT RenderWidgetHostImpl
// Called by |hang_monitor_timeout_| on delayed response from the renderer.
void RendererIsUnresponsive();
+ // Called by |new_content_rendering_timeout_| if a renderer has loaded new
+ // content but failed to produce a compositor frame in a defined time.
+ void ClearDisplayedGraphics();
+
// Called if we know the renderer is responsive. When we currently think the
// renderer is unresponsive, this will clear that state and call
// NotifyRendererResponsive.
@@ -790,6 +815,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
scoped_ptr<TimeoutMonitor> hang_monitor_timeout_;
+ scoped_ptr<TimeoutMonitor> new_content_rendering_timeout_;
+
#if defined(OS_WIN)
std::list<HWND> dummy_windows_for_activation_;
#endif

Powered by Google App Engine
This is Rietveld 408576698