commit | d3502f01e5b163cc2a424aba5b44113ed573b53f | [log] [tgz] |
---|---|---|
author | Devlin Cronin <rdevlin.cronin@chromium.org> | Fri May 25 19:41:42 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Fri May 25 19:41:42 2018 |
tree | 70cf4179240255a6c196a703f371db503383a5b3 | |
parent | 7421e23ba6ac4300889d60942719de07771adc5b [diff] |
[Extensions + Metrics] Make it harder to mess up histogram enum values Take steps to make it harder to mess up extension_function_histogram_value (which can happen if the enum is ever reordered). Do this in two ways: * Add explicit values to the enum values. This makes it much more difficult to accidentally insert an enum in the middle, because it is clear that they are all increasing. What's more, adding one with a duplicate value will cause ExtensionFunctionRegistrationTest.CheckForDuplicateEntries to fail. * Add a unittest that compares the values in the C++ enum to the values specified in the enums.xml file. To do this, hijack the code to read and parse the enums.xml file from about_flags_unittest.cc and put it in a common place in base/test/enum_test_util. Between the two of these, it should hopefully be very difficult to accidentally reorder the histogram. Bug: None Change-Id: I8932c7da32af8121ec94ef89bf591365e93ce575 Reviewed-on: https://chromium-review.googlesource.com/1062201 Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Dirk Pranke <dpranke@chromium.org> Reviewed-by: Alexei Svitkine <asvitkine@chromium.org> Reviewed-by: Ilya Sherman <isherman@chromium.org> Commit-Queue: Devlin <rdevlin.cronin@chromium.org> Cr-Commit-Position: refs/heads/master@{#561975}
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.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .