Commit eaca580a authored by xlai's avatar xlai Committed by Commit Bot

Correct complete threshold for CanvasAsyncBlobCreator

We were too conservative in setting a larger-than-enough threshold for complete
idle task detection in canvas_async_blob_creator. Based on latest user
statistics, 5 seconds delay for desktop and 9 seconds delay for mobile are good
for 99% users. This long threshold might be contributing to the flakiness on
leak bot of the convertToBlob tests--the delayed task for current thread takes
too long to finish, even longer than the timeout limit of the test, causing a
JS object leak.

Bug: 836278, 787972
Change-Id: I01ced35c4f910b4193adec6f8b26d9a02885a279
Reviewed-on: https://chromium-review.googlesource.com/1042534Reviewed-by: default avatarJustin Novosad <junov@chromium.org>
Commit-Queue: Olivia Lai <xlai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556160}
parent 096f65d3
......@@ -37,14 +37,17 @@ const double kIdleTaskStartTimeoutDelayMs = 1000.0;
const double kIdleTaskStartTimeoutDelayMs = 4000.0; // For ChromeOS, Mobile
#endif
/* The value is based on user statistics on May 2018. */
// We should be more lenient on completion timeout delay to ensure that the
// switch from idle to main thread only happens to a minority of toBlob calls
#if !defined(OS_ANDROID)
// Png image encoding on 4k by 4k canvas on Mac HDD takes 5.7+ seconds
const double kIdleTaskCompleteTimeoutDelayMs = 10000.0;
// We see that 99% users require less than 5 seconds.
const double kIdleTaskCompleteTimeoutDelayMs = 5700.0;
#else
// Png image encoding on 4k by 4k canvas on Android One takes 9.0+ seconds
const double kIdleTaskCompleteTimeoutDelayMs = 20000.0;
// We see that 99% users require less than 9 seconds.
const double kIdleTaskCompleteTimeoutDelayMs = 9000.0;
#endif
bool IsDeadlineNearOrPassed(double deadline_seconds) {
......
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