• nancylingwang's avatar
    Fix the system crash issue when loading many app icons. · e86a2bd2
    nancylingwang authored
    For the adaptive icon, there are 2 files opened for each icons, so when
    there are many apps installed, many files are opened to load the image,
    which might cause the system crash:
    Too many open files
    
    This CL modifies the code to reduce the unnecessary icon loading, and
    reduce the duplicated open files:
    1. For OnIntentFiltersUpdated, we don't need to update the icon to
    reload the icon.
    2. Modify the background image source in ArcAppIcon to set the null
    host, because ArcAppIcon::Source checks the host and call
    LoadForScaleFactor to read icon files. Since that has been done by the
    foreground image, we don't need to do it for the background image again.
    
    b:166430206
    
    Change-Id: Iecc76ca8e02bc5ef2230f99553abb8fb4a00362c
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2386435
    Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
    Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
    Reviewed-by: default avatarLong Cheng <lgcheng@google.com>
    Cr-Commit-Position: refs/heads/master@{#803350}
    e86a2bd2
arc_apps.cc 54.6 KB