Skip to content

Commit

Permalink
Reland "Miscellaneous IWYU fixes"
Browse files Browse the repository at this point in the history
This is a reland of commit 66822aa

This commit was speculatively reverted for what turned out to be
unrelated https://crbug.com/1317522.

Original change's description:
> Miscellaneous IWYU fixes
>
> Add explicit includes to files that depend on their inclusion of
> time.h, string_piece.h, and related files for <cmath>, check.h,
> check_op.h, checked_math.h, clamped_math.h and template_util.h.
>
> Change-Id: I6b13232401ac6b930f439f5d79e27816b6b4ed0b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3561575
> Auto-Submit: David Dorwin <ddorwin@chromium.org>
> Reviewed-by: Doug Steedman <dougsteed@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Commit-Queue: Scott Violet <sky@chromium.org>
> Owners-Override: Scott Violet <sky@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#993472}

Change-Id: I2add2f9daf1c07e5632f441ccee33198454411a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3595266
Auto-Submit: David Dorwin <ddorwin@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Owners-Override: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/main@{#994037}
  • Loading branch information
ddorwin authored and Chromium LUCI CQ committed Apr 20, 2022
1 parent 98265f2 commit 3f503b8
Show file tree
Hide file tree
Showing 125 changed files with 155 additions and 5 deletions.
1 change: 1 addition & 0 deletions base/command_line.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <ostream>

#include "base/check_op.h"
#include "base/containers/contains.h"
#include "base/containers/span.h"
#include "base/files/file_path.h"
Expand Down
1 change: 1 addition & 0 deletions base/fuchsia/startup_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <lib/sys/cpp/outgoing_directory.h>
#include <lib/sys/cpp/service_directory.h>

#include "base/check_op.h"
#include "base/fuchsia/file_utils.h"
#include "base/fuchsia/fuchsia_logging.h"
#include "base/logging.h"
Expand Down
1 change: 1 addition & 0 deletions base/i18n/message_formatter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "base/i18n/message_formatter.h"

#include "base/check.h"
#include "base/i18n/unicodestring.h"
#include "base/logging.h"
#include "base/numerics/safe_conversions.h"
Expand Down
1 change: 1 addition & 0 deletions base/i18n/rtl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <algorithm>

#include "base/check_op.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/i18n/base_i18n_switches.h"
Expand Down
1 change: 1 addition & 0 deletions base/json/string_escape.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <limits>
#include <string>

#include "base/check_op.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversion_utils.h"
Expand Down
1 change: 1 addition & 0 deletions base/memory/platform_shared_memory_region_fuchsia.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <zircon/rights.h>

#include "base/bits.h"
#include "base/check_op.h"
#include "base/fuchsia/fuchsia_logging.h"
#include "base/memory/page_size.h"

Expand Down
2 changes: 2 additions & 0 deletions base/memory/unsafe_shared_memory_region.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include <utility>

#include "base/check_op.h"

namespace base {

UnsafeSharedMemoryRegion::CreateFunction*
Expand Down
1 change: 1 addition & 0 deletions base/profiler/arm_cfi_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "base/profiler/arm_cfi_table.h"

#include "base/check_op.h"
#include "base/ranges/algorithm.h"
#include "third_party/abseil-cpp/absl/types/optional.h"

Expand Down
1 change: 1 addition & 0 deletions base/profiler/module_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <iterator>
#include <utility>

#include "base/check_op.h"
#include "base/ranges/algorithm.h"

namespace base {
Expand Down
1 change: 1 addition & 0 deletions base/strings/escape.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "base/strings/escape.h"

#include "base/check_op.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversion_utils.h"
Expand Down
1 change: 1 addition & 0 deletions base/task/sequence_manager/lazy_now.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "base/task/sequence_manager/lazy_now.h"

#include "base/check.h"
#include "base/time/tick_clock.h"
#include "third_party/abseil-cpp/absl/types/optional.h"

Expand Down
1 change: 1 addition & 0 deletions base/task/thread_pool/initialization_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "base/task/thread_pool/initialization_util.h"

#include <algorithm>
#include <cmath>

#include "base/cxx17_backports.h"
#include "base/system/sys_info.h"
Expand Down
2 changes: 2 additions & 0 deletions base/test/scoped_mock_clock_override.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include <ostream>

#include "base/check_op.h"

namespace base {

ScopedMockClockOverride* ScopedMockClockOverride::scoped_mock_clock_ = nullptr;
Expand Down
1 change: 1 addition & 0 deletions base/test/test_timeouts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <algorithm>
#include <string>

#include "base/check_op.h"
#include "base/clang_profiling_buildflags.h"
#include "base/command_line.h"
#include "base/debug/debugger.h"
Expand Down
1 change: 1 addition & 0 deletions base/time/time.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <tuple>
#include <utility>

#include "base/check.h"
#include "base/strings/stringprintf.h"
#include "base/third_party/nspr/prtime.h"
#include "base/time/time_override.h"
Expand Down
2 changes: 2 additions & 0 deletions base/time/time_exploded_icu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#include <memory>

#include "base/check.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/numerics/clamped_math.h"
#include "build/build_config.h"
#include "third_party/icu/source/common/unicode/locid.h"
#include "third_party/icu/source/i18n/unicode/calendar.h"
Expand Down
1 change: 1 addition & 0 deletions base/time/time_fuchsia.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <zircon/syscalls.h>
#include <zircon/threads.h>

#include "base/check_op.h"
#include "base/fuchsia/fuchsia_logging.h"
#include "base/time/time_override.h"

Expand Down
2 changes: 2 additions & 0 deletions base/time/time_override.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "base/time/time_override.h"

#include "base/check.h"

namespace base {
namespace subtle {

Expand Down
1 change: 1 addition & 0 deletions base/time/time_to_iso8601.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "base/time/time_to_iso8601.h"

#include "base/check.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"

Expand Down
2 changes: 2 additions & 0 deletions base/timer/elapsed_timer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "base/timer/elapsed_timer.h"

#include "base/check.h"

namespace base {

namespace {
Expand Down
1 change: 1 addition & 0 deletions base/trace_event/thread_instruction_count.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "base/trace_event/thread_instruction_count.h"

#include "base/base_switches.h"
#include "base/check_op.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/no_destructor.h"
Expand Down
2 changes: 2 additions & 0 deletions base/trace_event/trace_category.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include <stdint.h>

#include "base/check.h"

namespace base {
namespace trace_event {

Expand Down
1 change: 1 addition & 0 deletions base/vlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <ostream>
#include <utility>

#include "base/check_op.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
Expand Down
1 change: 1 addition & 0 deletions cc/metrics/frame_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <algorithm>

#include "base/check.h"
#include "build/build_config.h"

namespace cc {
Expand Down
2 changes: 2 additions & 0 deletions cc/metrics/frame_sequence_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
#define CC_METRICS_FRAME_SEQUENCE_METRICS_H_

#include <bitset>
#include <cmath>
#include <memory>

#include "base/callback.h"
#include "base/check.h"
#include "base/memory/raw_ptr.h"
#include "base/trace_event/traced_value.h"
#include "cc/cc_export.h"
Expand Down
2 changes: 2 additions & 0 deletions cc/metrics/total_frame_counter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "cc/metrics/total_frame_counter.h"

#include <cmath>

#include "base/logging.h"
#include "components/viz/common/frame_sinks/begin_frame_args.h"

Expand Down
2 changes: 2 additions & 0 deletions cc/paint/raw_memory_transfer_cache_entry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <string.h>
#include <utility>

#include "base/check_op.h"

namespace cc {

ClientRawMemoryTransferCacheEntry::ClientRawMemoryTransferCacheEntry(
Expand Down
11 changes: 6 additions & 5 deletions cc/trees/layer_tree_mutator.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
#ifndef CC_TREES_LAYER_TREE_MUTATOR_H_
#define CC_TREES_LAYER_TREE_MUTATOR_H_

#include <memory>
#include <string>
#include <unordered_map>
#include <vector>

#include "base/callback_forward.h"
#include "base/check.h"
#include "base/time/time.h"
#include "cc/cc_export.h"
#include "cc/trees/animation_effect_timings.h"
#include "cc/trees/animation_options.h"
#include "third_party/abseil-cpp/absl/types/optional.h"

#include <memory>
#include <string>
#include <unordered_map>
#include <vector>

namespace cc {

// TOOD(kevers): Remove kDrop once confirmed that it is no longer needed under
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <memory>

#include "base/check.h"
#include "base/check_op.h"
#include "crypto/ec_signature_creator.h"

namespace enterprise_connectors {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <string>

#include "base/metrics/field_trial_params.h"
#include "base/numerics/clamped_math.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/notifications/scheduler/public/features.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "chrome/browser/notifications/scheduler/public/schedule_service_utils.h"

#include "base/check_op.h"

namespace notifications {
namespace {

Expand Down
1 change: 1 addition & 0 deletions chrome/common/safe_browsing/rar_analyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "base/files/file_path.h"
#include "base/i18n/streaming_utf8_validator.h"
#include "base/metrics/histogram_macros.h"
#include "base/numerics/checked_math.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/common/safe_browsing/archive_analyzer_results.h"
Expand Down
1 change: 1 addition & 0 deletions chrome/renderer/v8_unwinder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <memory>
#include <utility>

#include "base/check_op.h"
#include "build/build_config.h"
#include "v8/include/v8-isolate.h"

Expand Down
2 changes: 2 additions & 0 deletions components/apdu/apdu_command.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "components/apdu/apdu_command.h"

#include "base/check_op.h"

namespace apdu {

namespace {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <string>
#include <vector>

#include "base/check.h"
#include "base/gtest_prod_util.h"
#include "base/time/time.h"
#include "components/autofill/core/browser/strike_database_base.h"
Expand Down
1 change: 1 addition & 0 deletions components/autofill/core/common/autofill_clock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "components/autofill/core/common/autofill_clock.h"

#include "base/check.h"
#include "base/time/clock.h"
#include "base/time/default_clock.h"

Expand Down
1 change: 1 addition & 0 deletions components/autofill/core/common/autofill_tick_clock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "components/autofill/core/common/autofill_tick_clock.h"

#include "base/check.h"
#include "base/time/default_tick_clock.h"
#include "base/time/tick_clock.h"

Expand Down
1 change: 1 addition & 0 deletions components/bookmarks/browser/model_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "base/json/json_file_value_serializer.h"
#include "base/json/json_reader.h"
#include "base/metrics/histogram_functions.h"
#include "base/numerics/clamped_math.h"
#include "base/synchronization/waitable_event.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
Expand Down
1 change: 1 addition & 0 deletions components/browsing_topics/epoch_topics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "base/hash/legacy_hash.h"
#include "base/json/values_util.h"
#include "base/logging.h"
#include "base/numerics/checked_math.h"
#include "components/browsing_topics/util.h"
#include "third_party/blink/public/common/features.h"
#include "url/gurl.h"
Expand Down
1 change: 1 addition & 0 deletions components/cast_certificate/cast_crl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "base/base64.h"
#include "base/logging.h"
#include "base/memory/singleton.h"
#include "base/numerics/clamped_math.h"
#include "crypto/sha2.h"
#include "net/cert/internal/cert_errors.h"
#include "net/cert/internal/parse_certificate.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "components/cast_streaming/public/rpc_call_message_handler.h"

#include "base/check.h"
#include "base/logging.h"
#include "components/cast_streaming/public/remoting_proto_enum_utils.h"
#include "components/cast_streaming/public/remoting_proto_utils.h"
Expand Down
1 change: 1 addition & 0 deletions components/crash/core/common/crash_key_base_support.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <memory>
#include <ostream>

#include "base/check_op.h"
#include "base/debug/crash_logging.h"
#include "components/crash/core/common/crash_key.h"

Expand Down
1 change: 1 addition & 0 deletions components/download/internal/background_service/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <string>

#include "base/metrics/field_trial_params.h"
#include "base/numerics/clamped_math.h"
#include "base/strings/string_number_conversions.h"
#include "build/build_config.h"
#include "components/download/public/background_service/features.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "components/feature_engagement/internal/system_time_provider.h"

#include "base/numerics/clamped_math.h"
#include "base/time/time.h"

namespace feature_engagement {
Expand Down
2 changes: 2 additions & 0 deletions components/history/core/browser/keyword_search_term.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "components/history/core/browser/keyword_search_term.h"

#include <cmath>

namespace history {

NormalizedKeywordSearchTermVisit::~NormalizedKeywordSearchTermVisit() = default;
Expand Down
Loading

0 comments on commit 3f503b8

Please sign in to comment.