Commit b2158cec authored by Eric Seckler's avatar Eric Seckler Committed by Commit Bot

content: Add switch to disable new content rendering timeout.

In e.g. some headless environments, we care about deterministic
rendering results. As the new content rendering timeout can affect page
rendering, we'd like a way to disable it.

This patch adds a command line switch to that effect.

Change-Id: Ib0c09aa57df82665ffb4f1290c8ad5d2761aa7bf
Bug: 776292
Reviewed-on: https://chromium-review.googlesource.com/725324
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510030}
parent 71c0f5b5
...@@ -390,9 +390,12 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate, ...@@ -390,9 +390,12 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate,
weak_factory_.GetWeakPtr()))); weak_factory_.GetWeakPtr())));
} }
new_content_rendering_timeout_.reset(new TimeoutMonitor( if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
base::Bind(&RenderWidgetHostImpl::ClearDisplayedGraphics, switches::kDisableNewContentRenderingTimeout)) {
weak_factory_.GetWeakPtr()))); new_content_rendering_timeout_.reset(new TimeoutMonitor(
base::Bind(&RenderWidgetHostImpl::ClearDisplayedGraphics,
weak_factory_.GetWeakPtr())));
}
const base::CommandLine& command_line = const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess(); *base::CommandLine::ForCurrentProcess();
...@@ -1080,6 +1083,10 @@ void RenderWidgetHostImpl::LogHangMonitorUnresponsive() { ...@@ -1080,6 +1083,10 @@ void RenderWidgetHostImpl::LogHangMonitorUnresponsive() {
void RenderWidgetHostImpl::StartNewContentRenderingTimeout( void RenderWidgetHostImpl::StartNewContentRenderingTimeout(
uint32_t next_source_id) { uint32_t next_source_id) {
current_content_source_id_ = next_source_id; current_content_source_id_ = next_source_id;
if (!new_content_rendering_timeout_)
return;
// It is possible for a compositor frame to arrive before the browser is // 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 // notified about the page being committed, in which case no timer is
// necessary. // necessary.
...@@ -2704,7 +2711,8 @@ void RenderWidgetHostImpl::SubmitCompositorFrame( ...@@ -2704,7 +2711,8 @@ void RenderWidgetHostImpl::SubmitCompositorFrame(
// After navigation, if a frame belonging to the new page is received, stop // After navigation, if a frame belonging to the new page is received, stop
// the timer that triggers clearing the graphics of the last page. // the timer that triggers clearing the graphics of the last page.
if (last_received_content_source_id_ >= current_content_source_id_ && if (new_content_rendering_timeout_ &&
last_received_content_source_id_ >= current_content_source_id_ &&
new_content_rendering_timeout_->IsRunning()) { new_content_rendering_timeout_->IsRunning()) {
new_content_rendering_timeout_->Stop(); new_content_rendering_timeout_->Stop();
} }
......
...@@ -208,6 +208,11 @@ const char kDisableMojoLocalStorage[] = "disable-mojo-local-storage"; ...@@ -208,6 +208,11 @@ const char kDisableMojoLocalStorage[] = "disable-mojo-local-storage";
// Disables usage of the namespace sandbox. // Disables usage of the namespace sandbox.
const char kDisableNamespaceSandbox[] = "disable-namespace-sandbox"; const char kDisableNamespaceSandbox[] = "disable-namespace-sandbox";
// Disables clearing the rendering output of a renderer when it didn't commit
// new output for a while after a top-frame navigation.
const char kDisableNewContentRenderingTimeout[] =
"disable-new-content-rendering-timeout";
// Disables the Web Notification and the Push APIs. // Disables the Web Notification and the Push APIs.
const char kDisableNotifications[] = "disable-notifications"; const char kDisableNotifications[] = "disable-notifications";
......
...@@ -74,6 +74,7 @@ CONTENT_EXPORT extern const char kDisableLocalStorage[]; ...@@ -74,6 +74,7 @@ CONTENT_EXPORT extern const char kDisableLocalStorage[];
CONTENT_EXPORT extern const char kDisableLogging[]; CONTENT_EXPORT extern const char kDisableLogging[];
CONTENT_EXPORT extern const char kDisableMojoLocalStorage[]; CONTENT_EXPORT extern const char kDisableMojoLocalStorage[];
CONTENT_EXPORT extern const char kDisableNamespaceSandbox[]; CONTENT_EXPORT extern const char kDisableNamespaceSandbox[];
CONTENT_EXPORT extern const char kDisableNewContentRenderingTimeout[];
CONTENT_EXPORT extern const char kDisableNotifications[]; CONTENT_EXPORT extern const char kDisableNotifications[];
CONTENT_EXPORT extern const char kDisableOriginTrialControlledBlinkFeatures[]; CONTENT_EXPORT extern const char kDisableOriginTrialControlledBlinkFeatures[];
CONTENT_EXPORT extern const char kDisablePartialRaster[]; CONTENT_EXPORT extern const char kDisablePartialRaster[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment