[Suggestions] Use a promise to detect if download thumbnail is in cache

When we fetch a thumbnail for downloaded images, we want to set a
placeholder if there is no thumbnail for that image in the cache and
when the thumbnail is fetched, replace the placeholder with it.
Otherwise, we want to set the thumbnail immediately. This CL introduces a
promise in DownloadThumbnailRequest which is fulfilled when the 
thumbnail is retrieved. This allows the SnippetArticleViewHolder to 
elegantly check whether the image fetch is synchronous or asynchronous 
(respectively whether we need to set a placeholder or not) and queue 
a callback if it is asynchronous.

Bug: 734992
Change-Id: I732b81ff42df12195fb1904bafb51e56d33542d4
Reviewed-on: https://chromium-review.googlesource.com/558989
Commit-Queue: Galia Peycheva <galinap@google.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Reviewed-by: Nicolas Dossou-Gbété <dgn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#484645}

CrOS-Libchrome-Original-Commit: be3dba44cf8df0a7ac387372fad6e135939e5a21
1 file changed
tree: 0af53f9ebc87d370bc9efd7a2b79f6548afd6bbc
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/