• Alex Gough's avatar
    Use default icons for PE files lacking their own. · 676d0cb1
    Alex Gough authored
    PrivateExtractIcon (underlying the icon loading service) may fail to
    supply an icon for PE files that do not have one embedded and would
    display as a blank area when downloaded. This change fetches the
    default for the file extension prior to fetching the file's embedded
    icon. It is difficult to do this only on failure as the ownership of
    IconLoader means it has already been deleted when we learn about the
    failure. It should be relatively cheap to fetch the default icons as
    these will be cached by the OS, and this occurs in the main process.
    
    Tests: Added LoadDefaultIcon in icon_loader_browser_test
    Bug: 1032250
    Change-Id: Ifad1c9f013d0e4fe87aaec5ec0cdeae08d06799e
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2242371
    Commit-Queue: Alex Gough <ajgo@chromium.org>
    Reviewed-by: default avatarFrançois Doray <fdoray@chromium.org>
    Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#779542}
    676d0cb1
icon_loader_win.cc 7.68 KB