| commit | 4f3dd4303c8fd5417b1b10955051520a52787b76 | [log] [tgz] |
|---|---|---|
| author | Alex Attar <aattar@google.com> | Tue Oct 28 15:13:48 2025 |
| committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Oct 28 15:13:48 2025 |
| tree | 59d846a251efad179f673c43f6d59dba64b771c8 | |
| parent | 6129b429d24a09cd08d5e3f7b24c2c0944f730fa [diff] |
Return std::string_view from resource fetcher helpers The ResourceTypeName() and LinkPreloadStrForHistogram() functions previously returned `const std::string`. Both functions return static string literals. Returning `std::string` results in an unnecessary heap allocation and copy for each call. This patch changes the return type to `std::string_view` to avoid this allocation and improve performance. Change-Id: Idd9fd4e099c471d675a4c4121c364a3318cd6b42 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7080242 Commit-Queue: Alex Attar <aattar@google.com> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/main@{#1536677}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.