Commit 944479f2 authored by Hans Wennborg's avatar Hans Wennborg Committed by Commit Bot

Reland "[base] Stop including check.h, notreached.h, etc. in logging.h"

This is a reland of f85481f8
Fixes since the previous commit:
https://chrome-internal-review.googlesource.com/c/chrome/deps/amd/+/3133484
https://chrome-internal-review.googlesource.com/c/chrome/assistant/+/3133487
https://chrome-internal-review.googlesource.com/c/chrome/assistant/+/3135083
https://chromium-review.googlesource.com/c/chromium/src/+/2264371

Original change's description:
> [base] Stop including check.h, notreached.h, etc. in logging.h
>
> The CHECK, CHECK_EQ etc., and NOTREACHED macros have moved out
> of logging.h into separate, much cheaper to include, headers.
>
> Now that the code has been updated to use the new headers, and
> to not rergess on that, stop including them in logging.h.
>
> Bug: 1031540
> Change-Id: Idfa891b991cbca1dfef93630c0f37b1b022f99df
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2264413
> Reviewed-by: Nico Weber <thakis@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Auto-Submit: Hans Wennborg <hans@chromium.org>
> Commit-Queue: Daniel Cheng <dcheng@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#781970}

TBR=thakis

Cq-Include-Trybots: luci.chrome.try:linux-chromeos-chrome
Bug: 1031540
Change-Id: Ie889e031d229745f93363c7bb2605c4f65591f60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2264297
Commit-Queue: Hans Wennborg <hans@chromium.org>
Reviewed-by: default avatarHans Wennborg <hans@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782682}
parent d577af5d
...@@ -1620,7 +1620,7 @@ def _CheckNoDISABLETypoInTests(input_api, output_api): ...@@ -1620,7 +1620,7 @@ def _CheckNoDISABLETypoInTests(input_api, output_api):
def _CheckDCHECK_IS_ONHasBraces(input_api, output_api): def _CheckDCHECK_IS_ONHasBraces(input_api, output_api):
"""Checks to make sure DCHECK_IS_ON() does not skip the parentheses.""" """Checks to make sure DCHECK_IS_ON() does not skip the parentheses."""
errors = [] errors = []
pattern = input_api.re.compile(r'DCHECK_IS_ON(?!\(\))', pattern = input_api.re.compile(r'DCHECK_IS_ON\b(?!\(\))',
input_api.re.MULTILINE) input_api.re.MULTILINE)
for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile): for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile):
if (not f.LocalPath().endswith(('.cc', '.mm', '.h'))): if (not f.LocalPath().endswith(('.cc', '.mm', '.h'))):
......
...@@ -232,6 +232,7 @@ jumbo_component("base") { ...@@ -232,6 +232,7 @@ jumbo_component("base") {
"cpu.cc", "cpu.cc",
"cpu.h", "cpu.h",
"critical_closure.h", "critical_closure.h",
"dcheck_is_on.h",
"debug/activity_analyzer.cc", "debug/activity_analyzer.cc",
"debug/activity_analyzer.h", "debug/activity_analyzer.h",
"debug/activity_tracker.cc", "debug/activity_tracker.cc",
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/base_export.h" #include "base/base_export.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/dcheck_is_on.h"
#include "base/immediate_crash.h" #include "base/immediate_crash.h"
// This header defines the CHECK, DCHECK, and DPCHECK macros. // This header defines the CHECK, DCHECK, and DPCHECK macros.
...@@ -126,12 +127,6 @@ class BASE_EXPORT CheckError { ...@@ -126,12 +127,6 @@ class BASE_EXPORT CheckError {
#endif #endif
#if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON)
#define DCHECK_IS_ON() false
#else
#define DCHECK_IS_ON() true
#endif
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
#define DCHECK(condition) \ #define DCHECK(condition) \
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_DCHECK_IS_ON_H_
#define BASE_DCHECK_IS_ON_H_
#if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON)
#define DCHECK_IS_ON() false
#else
#define DCHECK_IS_ON() true
#endif
#endif // BASE_DCHECK_IS_ON_H_
...@@ -8,9 +8,13 @@ ...@@ -8,9 +8,13 @@
// build time. Try not to raise this limit unless absolutely necessary. See // build time. Try not to raise this limit unless absolutely necessary. See
// https://chromium.googlesource.com/chromium/src/+/HEAD/docs/wmax_tokens.md // https://chromium.googlesource.com/chromium/src/+/HEAD/docs/wmax_tokens.md
#ifndef NACL_TC_REV #ifndef NACL_TC_REV
#pragma clang max_tokens_here 370000 #pragma clang max_tokens_here 350000
#endif // NACL_TC_REV #endif // NACL_TC_REV
#ifdef BASE_CHECK_H_
#error "logging.h should not include check.h"
#endif
#include <limits.h> #include <limits.h>
#include <stdint.h> #include <stdint.h>
......
...@@ -14,11 +14,9 @@ ...@@ -14,11 +14,9 @@
#include "base/base_export.h" #include "base/base_export.h"
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/check.h"
#include "base/check_op.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/dcheck_is_on.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/notreached.h"
#include "base/scoped_clear_last_error.h" #include "base/scoped_clear_last_error.h"
#include "base/strings/string_piece_forward.h" #include "base/strings/string_piece_forward.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment