commit | e63cbaf6fdcfdac0f04883d956b00e83330bd0a2 | [log] [tgz] |
---|---|---|
author | Ali Hijazi <[email protected]> | Wed Dec 20 19:29:35 2023 |
committer | Chromium LUCI CQ <[email protected]> | Wed Dec 20 19:29:35 2023 |
tree | e5e09d2cc3faaa42bebaa41c6c8c94fe456ac638 | |
parent | 2d3d322cbd148ac017e08f39f5e7025ad60b4152 [diff] [blame] |
Rewrite vector<T*> into vector<raw_ptr<T, VectorExperimental>> See chromium-dev announcement: https://groups.google.com/a/chromium.org/g/chromium-dev/c/sKckMpzHQgY/m/M3SWxEg3AQAJ?utm_medium=email&utm_source=footer Code review: - First patch: Automatic rewrite - Later patches: Manual fixes The automatic rewrite used the script: ./tools/clang/rewrite_templated_container_fields/rewrite-multiple-platforms.sh Binary size increase: The increase is only 33% (+5kB) above the per-patch limit (+16kB). This is not a lot given the size of the rewrite. Increase of around 500kb was approved for MiraclePtr. AX-Relnotes: n/a. Binary-Size: See commit description. Bug: 1432993 Change-Id: I8dfc4c2b274b724b99cf408f010da5c821edae9c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5140028 Commit-Queue: Arthur Sonzogni <[email protected]> Owners-Override: Arthur Sonzogni <[email protected]> Reviewed-by: Arthur Sonzogni <[email protected]> Cr-Commit-Position: refs/heads/main@{#1239777}
diff --git a/base/scoped_observation_unittest.cc b/base/scoped_observation_unittest.cc index ef90b69c..7420418 100644 --- a/base/scoped_observation_unittest.cc +++ b/base/scoped_observation_unittest.cc
@@ -5,6 +5,7 @@ #include "base/scoped_observation.h" #include "base/containers/contains.h" +#include "base/memory/raw_ptr.h" #include "base/ranges/algorithm.h" #include "base/scoped_observation_traits.h" #include "testing/gtest/include/gtest/gtest.h" @@ -26,7 +27,7 @@ size_t num_observers() const { return observers_.size(); } private: - std::vector<TestSourceObserver*> observers_; + std::vector<raw_ptr<TestSourceObserver, VectorExperimental>> observers_; }; void TestSource::AddObserver(TestSourceObserver* observer) {