Skip to content

Commit

Permalink
Remove/replace unnecessary logging.h includes in .cc files (base)
Browse files Browse the repository at this point in the history
CHECK, CHECK_EQ etc., and NOTREACHED/NOTIMPLEMENTED have moved
to the much smaller headers check.h, check_op.h, and notreached.h,
respectively.

This CL updates .cc files to use those headers instead when
possible, with the purpose of saving compile time.

(Split out from https://crrev.com/c/2164525 which also has
notes on how the change was generated.)

Bug: 1031540
Change-Id: I39ecaaf0d0770f1048c7f2ce2c43f98ec9212565
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2164633
Commit-Queue: Hans Wennborg <hans@chromium.org>
Auto-Submit: Hans Wennborg <hans@chromium.org>
Reviewed-by: kylechar <kylechar@chromium.org>
Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#762782}
  • Loading branch information
zmodem authored and Commit Bot committed Apr 27, 2020
1 parent ea26a79 commit c3cffa6
Show file tree
Hide file tree
Showing 224 changed files with 253 additions and 224 deletions.
2 changes: 1 addition & 1 deletion base/allocator/allocator_extension.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "base/allocator/allocator_extension.h"
#include "base/allocator/buildflags.h"
#include "base/logging.h"
#include "base/check.h"

#if BUILDFLAG(USE_TCMALLOC)
#include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h"
Expand Down
2 changes: 1 addition & 1 deletion base/allocator/allocator_shim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "base/allocator/buildflags.h"
#include "base/atomicops.h"
#include "base/bits.h"
#include "base/logging.h"
#include "base/check_op.h"
#include "base/macros.h"
#include "base/process/process_metrics.h"
#include "base/threading/platform_thread.h"
Expand Down
4 changes: 3 additions & 1 deletion base/allocator/allocator_shim_default_dispatch_to_winheap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

#include "base/allocator/allocator_shim.h"

#include <ostream>

#include "base/allocator/winheap_stubs_win.h"
#include "base/logging.h"
#include "base/check.h"

namespace {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "base/allocator/partition_allocator/page_allocator.h"
#include "base/allocator/partition_allocator/random.h"
#include "base/allocator/partition_allocator/spin_lock.h"
#include "base/logging.h"
#include "base/check_op.h"
#include "build/build_config.h"

#if defined(OS_WIN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "base/allocator/partition_allocator/page_allocator.h"
#include "base/allocator/partition_allocator/random.h"
#include "base/logging.h"
#include "base/check_op.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"

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

#include "base/allocator/partition_allocator/oom_callback.h"

#include "base/logging.h"
#include "base/check.h"

namespace base {

Expand Down
2 changes: 1 addition & 1 deletion base/allocator/partition_allocator/page_allocator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "base/allocator/partition_allocator/page_allocator_internal.h"
#include "base/allocator/partition_allocator/spin_lock.h"
#include "base/bits.h"
#include "base/logging.h"
#include "base/check_op.h"
#include "base/no_destructor.h"
#include "base/numerics/checked_math.h"
#include "build/build_config.h"
Expand Down
2 changes: 1 addition & 1 deletion base/allocator/partition_allocator/partition_alloc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "base/allocator/partition_allocator/partition_oom.h"
#include "base/allocator/partition_allocator/partition_page.h"
#include "base/allocator/partition_allocator/spin_lock.h"
#include "base/logging.h"
#include "base/check_op.h"
#include "base/no_destructor.h"
#include "base/synchronization/lock.h"

Expand Down
2 changes: 1 addition & 1 deletion base/allocator/partition_allocator/partition_bucket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "base/allocator/partition_allocator/partition_oom.h"
#include "base/allocator/partition_allocator/partition_page.h"
#include "base/allocator/partition_allocator/partition_root_base.h"
#include "base/logging.h"
#include "base/check.h"
#include "build/build_config.h"

namespace base {
Expand Down
2 changes: 1 addition & 1 deletion base/allocator/partition_allocator/partition_page.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "base/allocator/partition_allocator/partition_direct_map_extent.h"
#include "base/allocator/partition_allocator/partition_root_base.h"
#include "base/logging.h"
#include "base/check.h"

namespace base {
namespace internal {
Expand Down
1 change: 0 additions & 1 deletion base/allocator/partition_allocator/random.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "base/allocator/partition_allocator/random.h"

#include "base/allocator/partition_allocator/spin_lock.h"
#include "base/logging.h"
#include "base/no_destructor.h"
#include "base/rand_util.h"
#include "base/synchronization/lock.h"
Expand Down
2 changes: 1 addition & 1 deletion base/allocator/tcmalloc_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <stdio.h>

#include "base/allocator/buildflags.h"
#include "base/check_op.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/process/process_metrics.h"
#include "base/system/sys_info.h"
#include "build/build_config.h"
Expand Down
2 changes: 1 addition & 1 deletion base/allocator/winheap_stubs_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <limits>

#include "base/bits.h"
#include "base/logging.h"
#include "base/check_op.h"

namespace base {
namespace allocator {
Expand Down
2 changes: 1 addition & 1 deletion base/allocator/winheap_stubs_win_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "base/allocator/winheap_stubs_win.h"

#include "base/bits.h"
#include "base/logging.h"
#include "base/check.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace base {
Expand Down
2 changes: 1 addition & 1 deletion base/android/android_hardware_buffer_compat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <dlfcn.h>

#include "base/android/build_info.h"
#include "base/logging.h"
#include "base/check.h"

namespace base {

Expand Down
1 change: 0 additions & 1 deletion base/android/application_status_listener_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "base/bind.h"
#include "base/callback_forward.h"
#include "base/logging.h"
#include "base/run_loop.h"
#include "base/synchronization/waitable_event.h"
#include "base/test/task_environment.h"
Expand Down
3 changes: 2 additions & 1 deletion base/android/build_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
#include "base/android/jni_array.h"
#include "base/android/scoped_java_ref.h"
#include "base/base_jni_headers/BuildInfo_jni.h"
#include "base/logging.h"
#include "base/check_op.h"
#include "base/memory/singleton.h"
#include "base/notreached.h"
#include "base/strings/string_number_conversions.h"

namespace base {
Expand Down
3 changes: 2 additions & 1 deletion base/android/bundle_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "base/base_jni_headers/BundleUtils_jni.h"
#include "base/check.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/notreached.h"

// These symbols are added by the lld linker when creating a partitioned shared
// library. The symbols live in the base library, and are used to properly load
Expand Down
1 change: 0 additions & 1 deletion base/android/command_line_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "base/android/jni_string.h"
#include "base/base_jni_headers/CommandLine_jni.h"
#include "base/command_line.h"
#include "base/logging.h"

using base::android::ConvertUTF8ToJavaString;
using base::android::ConvertJavaStringToUTF8;
Expand Down
2 changes: 1 addition & 1 deletion base/android/jni_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "base/logging.h"
#include "base/check_op.h"

namespace base {
namespace android {
Expand Down
1 change: 0 additions & 1 deletion base/android/jni_weak_ref.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <utility>

#include "base/android/jni_android.h"
#include "base/logging.h"

using base::android::AttachCurrentThread;

Expand Down
1 change: 0 additions & 1 deletion base/android/library_loader/anchor_functions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "base/android/library_loader/anchor_functions.h"

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

#if BUILDFLAG(SUPPORTS_CODE_ORDERING)
Expand Down
2 changes: 1 addition & 1 deletion base/android/reached_addresses_bitset.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "base/android/library_loader/anchor_functions.h"
#include "base/android/library_loader/anchor_functions_buildflags.h"
#include "base/logging.h"
#include "base/check_op.h"
#include "base/no_destructor.h"

namespace base {
Expand Down
2 changes: 1 addition & 1 deletion base/android/scoped_java_ref.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "base/android/scoped_java_ref.h"

#include "base/android/jni_android.h"
#include "base/logging.h"
#include "base/check_op.h"

namespace base {
namespace android {
Expand Down
3 changes: 2 additions & 1 deletion base/at_exit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

#include "base/bind.h"
#include "base/callback.h"
#include "base/logging.h"
#include "base/check_op.h"
#include "base/notreached.h"

namespace base {

Expand Down
2 changes: 1 addition & 1 deletion base/base64_encode_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <string>

#include "base/base64.h"
#include "base/logging.h"
#include "base/check_op.h"
#include "base/strings/string_piece.h"

// Encode some random data, and then decode it.
Expand Down
2 changes: 1 addition & 1 deletion base/base_paths_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "base/base_paths.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/notreached.h"
#include "base/process/process_metrics.h"

namespace base {
Expand Down
2 changes: 1 addition & 1 deletion base/build_time.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Imports the generated build date, i.e. BUILD_DATE.
#include "base/generated_build_date.h"

#include "base/logging.h"
#include "base/check.h"
#include "base/time/time.h"

namespace base {
Expand Down
3 changes: 2 additions & 1 deletion base/callback_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

#include "base/callback_internal.h"

#include "base/logging.h"
#include "base/check.h"
#include "base/notreached.h"

namespace base {
namespace internal {
Expand Down
2 changes: 1 addition & 1 deletion base/callback_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

#include "base/bind.h"
#include "base/callback_internal.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/notreached.h"
#include "base/test/test_timeouts.h"
#include "base/threading/thread.h"
#include "testing/gtest/include/gtest/gtest.h"
Expand Down
4 changes: 3 additions & 1 deletion base/check_example.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
// This file is meant for analyzing the code generated by the CHECK
// macros in a small executable file that's easy to disassemble.

#include <ostream>

#include "base/check_op.h"
#include "base/compiler_specific.h"
#include "base/logging.h"

// An official build shouldn't generate code to print out messages for
// the CHECK* macros, nor should it have the strings in the
Expand Down
2 changes: 1 addition & 1 deletion base/containers/intrusive_heap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "base/containers/intrusive_heap.h"

#include "base/logging.h"
#include "base/check.h"
#include "base/memory/ptr_util.h"

namespace base {
Expand Down
3 changes: 2 additions & 1 deletion base/containers/intrusive_heap_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

#include "base/containers/intrusive_heap.h"

#include "base/logging.h"
#include "base/check_op.h"
#include "base/memory/ptr_util.h"
#include "base/notreached.h"
#include "base/rand_util.h"
#include "base/stl_util.h"
#include "testing/gmock/include/gmock/gmock.h"
Expand Down
2 changes: 1 addition & 1 deletion base/debug/activity_analyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
#include <algorithm>
#include <utility>

#include "base/check_op.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/memory_mapped_file.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h"
Expand Down
2 changes: 1 addition & 1 deletion base/debug/asan_invalid_access.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include <memory>

#include "base/check.h"
#include "base/debug/alias.h"
#include "base/logging.h"
#include "build/build_config.h"

#if defined(OS_WIN)
Expand Down
3 changes: 2 additions & 1 deletion base/debug/debugger_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
#include <memory>
#include <vector>

#include "base/check_op.h"
#include "base/clang_profiling_buildflags.h"
#include "base/logging.h"
#include "base/notreached.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/threading/platform_thread.h"
Expand Down
2 changes: 1 addition & 1 deletion base/debug/dump_without_crashing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "base/debug/dump_without_crashing.h"

#include "base/logging.h"
#include "base/check.h"

namespace {

Expand Down
2 changes: 1 addition & 1 deletion base/debug/invalid_access_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <stdlib.h>
#include <windows.h>

#include "base/logging.h"
#include "base/check.h"
#include "base/win/windows_version.h"

namespace base {
Expand Down
2 changes: 1 addition & 1 deletion base/debug/stack_trace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <algorithm>
#include <sstream>

#include "base/logging.h"
#include "base/check_op.h"
#include "base/stl_util.h"

#if BUILDFLAG(CAN_UNWIND_WITH_FRAME_POINTERS)
Expand Down
2 changes: 1 addition & 1 deletion base/deferred_sequenced_task_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <utility>

#include "base/bind.h"
#include "base/logging.h"
#include "base/check.h"

namespace base {

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

#include <utility>

#include "base/check.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
Expand Down
2 changes: 1 addition & 1 deletion base/files/dir_reader_posix_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <string.h>
#include <unistd.h>

#include "base/check.h"
#include "base/files/scoped_temp_dir.h"
#include "base/logging.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"

Expand Down
Loading

0 comments on commit c3cffa6

Please sign in to comment.