Commit 5e0a3fde authored by ernstm's avatar ernstm Committed by Commit bot

Fix and re-enable v8 idle notification after commit.

For idle times < 1000us, we sent notifications with 0ms. This patch
adds a check for idle_time_in_ms to be non-zero and re-enables the
feature by default.

R=jochen@chromium.org
BUG=414815

Review URL: https://codereview.chromium.org/583833002

Cr-Commit-Position: refs/heads/master@{#295680}
parent 88aa7765
......@@ -423,7 +423,7 @@ RenderWidgetCompositor::RenderWidgetCompositor(RenderWidget* widget,
bool threaded)
: threaded_(threaded),
widget_(widget),
send_v8_idle_notification_after_commit_(false) {
send_v8_idle_notification_after_commit_(true) {
CommandLine* cmd = CommandLine::ForCurrentProcess();
if (cmd->HasSwitch(switches::kEnableV8IdleNotificationAfterCommit))
......@@ -817,7 +817,8 @@ void RenderWidgetCompositor::DidCommit() {
// Convert to 32-bit microseconds first to avoid costly 64-bit division.
int32 idle_time_in_us = idle_time.InMicroseconds();
int32 idle_time_in_ms = idle_time_in_us / 1000;
blink::mainThreadIsolate()->IdleNotification(idle_time_in_ms);
if (idle_time_in_ms)
blink::mainThreadIsolate()->IdleNotification(idle_time_in_ms);
}
}
......
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