0
Go to file
Roger McFarlane 8952859c39 Use bounded ranges (string_view) for histogram names.
This CL changes the histogram creation APIs to take a durable
string view (i.e., a pointer+size pair referring to memory that
the programmer has annotated that it will not be freed) instead
of just an implicit pointer. The HistogramBase class internally
represents the name's length and the histogram's flags using
16 bits in order to not grow the in-memory size of Histogram
objects. The name of the histogram is subsequently exposed by
HistogramBase as a string_view.

This CL updates consumers of the histogram name's to use a
string_view of the name. This removes many string length
calculations and string copy operations. For histograms
allocated in shared memory, it also avoids potential out-of-
bounds reads if the underlying string data is modified or
corrupted such that it no longer has a trailing NUL char
at the end of the string.

Lastly, this CL updates a number of call-sites where the
histogram names were being copied into short-lived string
objects for use as search keys into various containers to
perform the functionality without making any unnecessary
copies.

Low-Coverage-Reason: TRIVIAL_CHANGE Use of string_view instead of string/char* in some error/logging paths have low coverage.
AX-Relnotes: n/a
Bug: 393394360, 40818143
Change-Id: Iee9ee5ae62335b9e7815f4ae11bde4ff80cfd4a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6231451
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Antonio Rivera <antoniori@google.com>
Commit-Queue: Roger McFarlane <rogerm@chromium.org>
Reviewed-by: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1422750}
2025-02-20 12:50:27 -08:00
2025-02-20 11:52:59 -08:00
2025-02-20 11:52:30 -08:00
2025-02-19 18:45:19 -08:00
2025-02-20 11:52:30 -08:00
2025-02-19 12:02:22 -08:00
2025-02-20 10:48:31 -08:00
2025-01-29 15:00:06 -08:00

Logo Chromium

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.

Description
Chromium是一个开源浏览器项目,提供了一种安全、快速、稳定的方法来体验Web。该浏览器可以在多个平台上下载,包括Mac、Windows、Linux和ChromiumOS。项目原始地址: https://chromium.googlesource.com/chromium/src.git
https://www.mobibrw.com/gitea-mirrors/chromium/src.git
Readme BSD-3-Clause 89 GiB
Languages
C++ 74.4%
Java 8.2%
Objective-C++ 4.6%
TypeScript 4%
Python 2.5%
Other 6.1%