electron/shell/browser/plugins
trop[bot] d0658ccc98
perf: avoid unnecessary vector copy in GetMimeTypeToExtensionIdMap() (#46395)
* perf: avoid making an unnecessary copy of the vector

MimeTypesHandler::GetMIMETypeAllowlist() returns a const&, so we can
iterate that directly instead of making a temporary copy of it.

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: move the call to ExtensionRegistry::Get() outside of the loop

Also, keep the previous behavior of not calling it at all if there
aren't any whitelisted extensions.

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: avoid redundant map lookup

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: const correctness

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: cleanup

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-01 09:07:45 -05:00
..
plugin_utils.cc perf: avoid unnecessary vector copy in GetMimeTypeToExtensionIdMap() (#46395) 2025-04-01 09:07:45 -05:00
plugin_utils.h chore: bump chromium to 98.0.4706.0 (main) (#31555) 2021-11-24 09:45:59 +01:00