Skip to content

Commit

Permalink
Remove base/containers/cxx20_erase* includes from base/stl_util.h.
Browse files Browse the repository at this point in the history
- Include base/containers/cxx20_erase.h in .cc files that need it for
  simplicity. Swapping out base/stl_util.h along the way.
- Include base/containers/cxx20_erase_$container.h in .h files that need
  it to avoid bloating the headers.

Then these includes can be deleted from base/stl_util.h because the
users for base::Erase/EraseIf all have the proper includes.

Bug: 1211125
Change-Id: I4baa2fcc2c2968be5af04107267813c47cd8813a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2974069
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#898468}
  • Loading branch information
leizleiz authored and Chromium LUCI CQ committed Jul 4, 2021
1 parent c13020c commit 0da5478
Show file tree
Hide file tree
Showing 54 changed files with 56 additions and 63 deletions.
2 changes: 1 addition & 1 deletion base/callback_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
#include "base/callback_helpers.h"
#include "base/check.h"
#include "base/compiler_specific.h"
#include "base/containers/cxx20_erase_list.h"
#include "base/memory/weak_ptr.h"
#include "base/ranges/algorithm.h"
#include "base/stl_util.h"

// OVERVIEW:
//
Expand Down
10 changes: 0 additions & 10 deletions base/stl_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,11 @@
#include <utility>

#include "base/check.h"
#include "base/containers/cxx20_erase_deque.h"
#include "base/containers/cxx20_erase_forward_list.h"
#include "base/containers/cxx20_erase_list.h"
#include "base/containers/cxx20_erase_map.h"
#include "base/containers/cxx20_erase_set.h"
#include "base/containers/cxx20_erase_string.h"
#include "base/containers/cxx20_erase_unordered_map.h"
#include "base/containers/cxx20_erase_unordered_set.h"
#include "base/containers/cxx20_erase_vector.h"
#include "base/cxx17_backports.h"
#include "base/ranges/algorithm.h"
#include "third_party/abseil-cpp/absl/types/optional.h"

// TODO(crbug.com/1210983): Remove base/cxx17_backports.h above.
// TODO(crbug.com/1211125): Remove various cxx20 includes above.

namespace base {

Expand Down
2 changes: 1 addition & 1 deletion base/threading/thread_id_name_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

#include "base/check.h"
#include "base/containers/contains.h"
#include "base/containers/cxx20_erase.h"
#include "base/memory/singleton.h"
#include "base/no_destructor.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/threading/thread_local.h"
#include "base/trace_event/heap_profiler_allocation_context_tracker.h" // no-presubmit-check
Expand Down
2 changes: 1 addition & 1 deletion cc/animation/keyframe_effect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <string>
#include <utility>

#include "base/stl_util.h"
#include "base/containers/cxx20_erase.h"
#include "base/time/time.h"
#include "cc/animation/animation.h"
#include "cc/animation/animation_host.h"
Expand Down
2 changes: 1 addition & 1 deletion cc/benchmarks/micro_benchmark_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <string>

#include "base/callback.h"
#include "base/stl_util.h"
#include "base/containers/cxx20_erase.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/values.h"
#include "cc/benchmarks/invalidation_benchmark.h"
Expand Down
2 changes: 1 addition & 1 deletion cc/benchmarks/micro_benchmark_controller_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <string>

#include "base/callback.h"
#include "base/stl_util.h"
#include "base/containers/cxx20_erase.h"
#include "base/values.h"
#include "cc/trees/layer_tree_host_impl.h"

Expand Down
2 changes: 1 addition & 1 deletion cc/input/main_thread_scrolling_reason.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "cc/input/main_thread_scrolling_reason.h"

#include "base/stl_util.h"
#include "base/containers/cxx20_erase.h"
#include "base/strings/string_util.h"
#include "base/trace_event/traced_value.h"

Expand Down
2 changes: 1 addition & 1 deletion cc/test/fake_layer_tree_frame_sink.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "base/bind.h"
#include "base/containers/contains.h"
#include "base/stl_util.h"
#include "base/containers/cxx20_erase.h"
#include "base/threading/thread_task_runner_handle.h"
#include "cc/trees/layer_tree_frame_sink_client.h"
#include "components/viz/common/frame_sinks/begin_frame_source.h"
Expand Down
2 changes: 1 addition & 1 deletion cc/tiles/picture_layer_tiling_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#include <vector>

#include "base/containers/contains.h"
#include "base/containers/cxx20_erase.h"
#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "base/trace_event/trace_event.h"
#include "cc/raster/raster_source.h"
#include "ui/gfx/geometry/rect_conversions.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/public/cpp/window_properties.h"
#include "base/bind.h"
#include "base/containers/cxx20_erase.h"
#include "base/metrics/histogram_functions.h"
#include "base/scoped_observation.h"
#include "chrome/browser/ash/accessibility/accessibility_manager.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "base/check_op.h"
#include "base/compiler_specific.h"
#include "base/containers/contains.h"
#include "base/containers/cxx20_erase.h"
#include "base/feature_list.h"
#include "base/logging.h"
#include "base/metrics/crc32.h"
Expand Down
2 changes: 1 addition & 1 deletion chromecast/browser/cast_web_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#include <utility>

#include "base/bind.h"
#include "base/containers/cxx20_erase.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/sequenced_task_runner.h"
#include "base/stl_util.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "base/time/time.h"
#include "chromecast/browser/cast_web_view_default.h"
Expand Down
2 changes: 1 addition & 1 deletion chromecast/device/bluetooth/le/gatt_client_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
#include <string>

#include "base/bind.h"
#include "base/containers/cxx20_erase.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/stl_util.h"
#include "chromecast/base/bind_to_task_runner.h"
#include "chromecast/device/bluetooth/bluetooth_util.h"
#include "chromecast/device/bluetooth/le/remote_characteristic_impl.h"
Expand Down
2 changes: 1 addition & 1 deletion chromecast/device/bluetooth/le/le_scan_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <utility>

#include "base/bind.h"
#include "base/containers/cxx20_erase.h"
#include "base/logging.h"
#include "base/stl_util.h"
#include "chromecast/base/bind_to_task_runner.h"
#include "chromecast/device/bluetooth/bluetooth_util.h"
#include "chromecast/public/cast_media_shlib.h"
Expand Down
2 changes: 1 addition & 1 deletion chromeos/components/drivefs/fake_drivefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

#include "base/bind.h"
#include "base/containers/contains.h"
#include "base/containers/cxx20_erase.h"
#include "base/files/file.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
#include "base/no_destructor.h"
#include "base/numerics/safe_conversions.h"
#include "base/stl_util.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/task/post_task.h"
Expand Down
2 changes: 1 addition & 1 deletion chromeos/printing/ppd_line_reader_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <string>
#include <vector>

#include "base/stl_util.h"
#include "base/containers/cxx20_erase.h"
#include "base/strings/string_split.h"
#include "testing/gtest/include/gtest/gtest.h"

Expand Down
2 changes: 1 addition & 1 deletion chromeos/services/libassistant/audio/audio_input_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

#include "base/bind.h"
#include "base/command_line.h"
#include "base/containers/cxx20_erase.h"
#include "base/logging.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/timer/timer.h"
#include "chromeos/services/assistant/public/cpp/assistant_browser_delegate.h"
Expand Down
2 changes: 1 addition & 1 deletion chromeos/services/secure_channel/fake_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <utility>

#include "base/callback.h"
#include "base/stl_util.h"
#include "base/containers/cxx20_erase.h"
#include "chromeos/services/secure_channel/wire_message.h"

namespace chromeos {
Expand Down
2 changes: 1 addition & 1 deletion device/bluetooth/bluetooth_adapter_winrt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
#include "base/callback.h"
#include "base/callback_helpers.h"
#include "base/containers/contains.h"
#include "base/containers/cxx20_erase.h"
#include "base/containers/span.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/memory/scoped_refptr.h"
#include "base/scoped_native_library.h"
#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
#include "base/strings/stringprintf.h"
Expand Down
2 changes: 1 addition & 1 deletion device/fido/fido_request_handler_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

#include "base/bind.h"
#include "base/containers/contains.h"
#include "base/containers/cxx20_erase.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/stl_util.h"
#include "base/strings/string_piece.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "base/time/time.h"
Expand Down
2 changes: 1 addition & 1 deletion device/fido/mac/credential_store.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
#import <Security/Security.h>

#include "base/containers/contains.h"
#include "base/containers/cxx20_erase.h"
#include "base/feature_list.h"
#include "base/logging.h"
#include "base/mac/foundation_util.h"
#include "base/mac/mac_logging.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/stl_util.h"
#include "base/strings/sys_string_conversions.h"
#include "components/device_event_log/device_event_log.h"
#include "device/fido/mac/credential_metadata.h"
Expand Down
2 changes: 1 addition & 1 deletion device/fido/virtual_fido_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#include <utility>

#include "base/bind.h"
#include "base/containers/cxx20_erase.h"
#include "base/logging.h"
#include "base/rand_util.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "components/cbor/values.h"
#include "components/cbor/writer.h"
Expand Down
7 changes: 4 additions & 3 deletions device/vr/android/arcore/address_to_id_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
#ifndef DEVICE_VR_ANDROID_ARCORE_ADDRESS_TO_ID_MAP_H_
#define DEVICE_VR_ANDROID_ARCORE_ADDRESS_TO_ID_MAP_H_

#include <limits>
#include <unordered_map>

#include "base/check.h"
#include "base/stl_util.h"
#include "base/containers/cxx20_erase_unordered_map.h"
#include "third_party/abseil-cpp/absl/types/optional.h"

#include <unordered_map>

namespace device {

// Wrapper class used to generate an Id for a given address. Allows looking up
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <string>
#include <utility>

#include "base/stl_util.h"
#include "base/containers/cxx20_erase.h"
#include "base/values.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <tuple>
#include <utility>

#include "base/stl_util.h"
#include "base/containers/cxx20_erase.h"
#include "base/time/clock.h"
#include "base/timer/timer.h"
#include "base/values.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <utility>

#include "base/containers/contains.h"
#include "base/containers/cxx20_erase.h"
#include "base/metrics/histogram_macros.h"
#include "base/stl_util.h"
#include "base/time/time.h"
#include "base/timer/elapsed_timer.h"
#include "extensions/browser/api/declarative_net_request/flat/extension_ruleset_generated.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "base/bind.h"
#include "base/containers/contains.h"
#include "base/stl_util.h"
#include "base/containers/cxx20_erase.h"
#include "base/task/post_task.h"
#include "base/task_runner_util.h"
#include "base/time/time.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
#include "base/bind.h"
#include "base/check_op.h"
#include "base/containers/contains.h"
#include "base/containers/cxx20_erase.h"
#include "base/files/file_util.h"
#include "base/memory/ref_counted.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
#include "base/callback.h"
#include "base/check_op.h"
#include "base/containers/contains.h"
#include "base/containers/cxx20_erase.h"
#include "base/containers/queue.h"
#include "base/files/file_util.h"
#include "base/lazy_instance.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h"
#include "base/stl_util.h"
#include "base/task/post_task.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "base/threading/thread_restrictions.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

#include "base/bind.h"
#include "base/check_op.h"
#include "base/containers/cxx20_erase.h"
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/stl_util.h"
#include "base/time/time.h"
#include "base/timer/elapsed_timer.h"
#include "components/web_cache/browser/web_cache_manager.h"
Expand Down
2 changes: 1 addition & 1 deletion extensions/browser/extension_prefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include <utility>

#include "base/containers/contains.h"
#include "base/containers/cxx20_erase.h"
#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
Expand Down
2 changes: 1 addition & 1 deletion gpu/ipc/service/gpu_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// found in the LICENSE file.

#include "gpu/ipc/service/gpu_channel.h"
#include "base/containers/cxx20_erase.h"
#include "base/memory/ptr_util.h"

#include <utility>
Expand All @@ -25,7 +26,6 @@
#include "base/numerics/safe_conversions.h"
#include "base/process/process.h"
#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread_checker.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#import "ios/chrome/browser/autofill/manual_fill/passwords_fetcher.h"

#include "base/stl_util.h"
#include "base/containers/cxx20_erase.h"
#include "components/password_manager/core/browser/android_affiliation/affiliation_utils.h"
#include "components/password_manager/core/browser/password_form.h"
#include "components/password_manager/core/browser/password_list_sorter.h"
Expand Down
2 changes: 1 addition & 1 deletion media/filters/frame_buffer_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/check_op.h"
#include "base/containers/cxx20_erase.h"
#include "base/location.h"
#include "base/macros.h"
#include "base/memory/free_deleter.h"
#include "base/process/memory.h"
#include "base/sequenced_task_runner.h"
#include "base/stl_util.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "base/trace_event/memory_allocator_dump.h"
#include "base/trace_event/memory_dump_manager.h"
Expand Down
2 changes: 1 addition & 1 deletion media/gpu/test/video_encoder/decoder_buffer_validator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include "media/gpu/test/video_encoder/decoder_buffer_validator.h"

#include "base/containers/cxx20_erase.h"
#include "base/logging.h"
#include "base/stl_util.h"
#include "media/base/decoder_buffer.h"
#include "media/gpu/h264_decoder.h"
#include "testing/gtest/include/gtest/gtest.h"
Expand Down
Loading

0 comments on commit 0da5478

Please sign in to comment.