Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[blink scheduler] Refactor tracing helper categories to work with c++17
Previously, the category names for TracingHelper had to meet 2 criteria: 1. Be constexpr 2. Have a single unique address per category This was implemented using struct-level static constexpr const char*s, but in in c++17 these are implicitly inline and have different addresses in different shared libraries. (2) was only required to eliminate multiple template instantiations for the same category (due to the same string having different addresses). We get around this by making an enum class of permitted trace categories and using that as the template parameter instead of the char*. We use an inline constexpr function to convert the enum value to the trace category string at compile time, which is required by the tracing macros. Bug: 1275221, 752720 Change-Id: Idf82752a4bb389ce9e04d859eec93e022255992f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3313482 Commit-Queue: Scott Haseley <shaseley@chromium.org> Reviewed-by: Alexander Timin <altimin@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Cr-Commit-Position: refs/heads/main@{#948132}
- Loading branch information
Showing
7 changed files
with
113 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.