commit | 3524668a4788319577c7111850ae20ba5a1b1a67 | [log] [tgz] |
---|---|---|
author | mlcui <mlcui@google.com> | Wed Oct 30 06:02:50 2024 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Oct 30 06:02:50 2024 |
tree | 4c7b9dbfb9acf7020c05efa3617a4e54d5a183c8 | |
parent | f9f50a1a7b83e4c4eb75c60c79c49aa061dd7886 [diff] |
scanner: Use `as_string_view` to convert `RefCountedMemory` to string From the `base::RefCountedMemory` documentation: > The data/size members (or begin/end) give conversion to span already, > but we provide [the `base::span`] operator as an optimization to > combine two virtual method calls into one. This uses the `base::span` operator to pass it into `base::as_string_view` to convert it into a string. Unfortunately, the current version of Protobuf that is in Chromium does not support `std::string_view` setters for strings, so we still need to explicitly construct a temporary `std::string` which is moved into the Protobuf message. Bug: b:363101024 Change-Id: I6a6a21008ed2d7932d3ed3e957e64818e8de47d1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5974778 Reviewed-by: Curtis McMullan <curtismcmullan@chromium.org> Commit-Queue: Michael Cui <mlcui@google.com> Cr-Commit-Position: refs/heads/main@{#1375689}
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.