Filter redundant JumpList favicons' fetching and related

In the current JumpList implementation, each time when the TopSites
service or the TabRestore service has updates, the JumpList being an
observer of them will start an update.

This update consists of the following steps:
1) Retrieve updated URLs, create ShellLinkItem and fetch the favicons
   for these URLs;
2) Schedule a RunUpdateJumpList run to update icons in jumplisticon
   folders and notify the shell.

Currently, there's a delay of 3500 ms before each RunUpdateJumpList
call so that other RunUpdateJumpList calls requested in this period
will be collapsed into one which can prevent update storms. This says
that we are coalescing step 2 of jumplist updates which are close to
each other in time.

However, we're not coalescing step 1 of those jumplist updates, which
makes some of them completely wasted. Therefore, we should apply this
"delay and coalesce" strategy to step 1 as well.

Moreover, in JumpList::OnMostVisitedURLsAvailable(), we're processing
more URLs (typically 24) than needed (typically between 5 to 9). The
work of creating ShellLinkItems and fetching favicons for these URLs
is wasted.

Note that all these tasks are running on UI thread. Therefore, it's
very important to optimize them which otherwise can possibly hang
Chrome.

BUG=40407, 179576, 717236

Review-Url: https://codereview.chromium.org/2859693002
Cr-Commit-Position: refs/heads/master@{#470091}
2 files changed