[CrOS Network] Fix errors with connecting network icons.
Before this CL, there were several related issues related to connecting icons; sometimes, icons would appear smaller than they should, and other times, icons would grow and/or shrink as they animated. The issue was that network_icon.cc kept four caches for connecting icons: light bars, dark bars, light arcs, and dark arcs. Each time an icon was requested, we'd look to see if one existed in the cache and return it if it existed; otherwise, we'd lazily create a new one. The problem here was that different areas of the UI request different icon sizes (e.g., Quick Settings requires a larger icon than the system tray), but the caches described above were agnostic to size. This meant that if a small icon was requested first, it would fill up the cache for that icon type; then, if a larger icon size was requested later, the same small one would be returned. This made the user-visible bug change depending on what UIs were used in what order, making this bug difficult to reproduce consistently. This CL updates this code to include a cache for each icon size as well as light vs. dark and bars vs. arcs. Bug: 961843 Change-Id: I468542f29eec4e694a6bbfaa8623ebfe78700a04 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1836454 Commit-Queue: Kyle Horimoto <khorimoto@chromium.org> Reviewed-by:Evan Stade <estade@chromium.org> Cr-Commit-Position: refs/heads/master@{#702623}
Showing
Please register or sign in to comment