Commit 8bb448c9 authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

Reland "base: Add ENABLE_LOG_ERROR_NOT_REACHED buildflag"

This reverts commit 22829656.

Reason for revert: Reland with fix in blink_x86_avx source_set deps.

Original change's description:
> Revert "base: Add ENABLE_LOG_ERROR_NOT_REACHED buildflag"
>
> This reverts commit 3553b590.
>
> Reason for revert: Causing win-rel compile error.
>
> Original change's description:
> > base: Add ENABLE_LOG_ERROR_NOT_REACHED buildflag
> >
> > Currently NOTREACHED() uses LogErrorNotReached() on ChromeOS for release
> > builds, and DCHECK(false) otherwise. However, there are other projects
> > depending on Chromium that would prefer using DCHECK(false) in all cases,
> > and currently there's no easy way to do so.
> >
> > This CL adds an |enable_log_error_not_reached| gn arg to control whether
> > to use LogErrorNotReached() for NOTREACHED() to solve this problem. It
> > is enabled by default only for ChromeOS release builds to keep the
> > current behavior.
> >
> > Bug: 760393
> > Change-Id: I512227563d8ad4a08a8d7b5d1ec966a8aacbcc08
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1586593
> > Reviewed-by: Nico Weber <thakis@chromium.org>
> > Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#655701}
>
> TBR=thakis@chromium.org,xhwang@chromium.org
>
> Change-Id: Iadcee95984e8783f26aeb687dc1cd31f9186e03d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 760393
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1592478
> Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
> Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#655714}

TBR=thakis@chromium.org,xhwang@chromium.org

Change-Id: Idd16cea9c37cdf5bb5f0b7dbac9d5b974c8c4b63
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 760393
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1592861
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Reviewed-by: default avatarXiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#656476}
parent 4facf1e6
......@@ -25,6 +25,7 @@ import("//build/config/chromecast_build.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/dcheck_always_on.gni")
import("//build/config/jumbo.gni")
import("//build/config/logging.gni")
import("//build/config/nacl/config.gni")
import("//build/config/sysroot.gni")
import("//build/config/ui.gni")
......@@ -1232,6 +1233,7 @@ jumbo_component("base") {
":build_date",
":cfi_buildflags",
":debugging_buildflags",
":logging_buildflags",
":orderfile_buildflags",
":partition_alloc_buildflags",
":protected_memory_buildflags",
......@@ -2005,6 +2007,12 @@ buildflag_header("debugging_buildflags") {
]
}
buildflag_header("logging_buildflags") {
header = "logging_buildflags.h"
flags = [ "ENABLE_LOG_ERROR_NOT_REACHED=$enable_log_error_not_reached" ]
}
buildflag_header("orderfile_buildflags") {
header = "orderfile_buildflags.h"
header_dir = "base/android/orderfile"
......
......@@ -18,6 +18,7 @@
#include "base/callback_forward.h"
#include "base/compiler_specific.h"
#include "base/debug/debugger.h"
#include "base/logging_buildflags.h"
#include "base/macros.h"
#include "base/scoped_clear_last_error.h"
#include "base/strings/string_piece_forward.h"
......@@ -943,7 +944,7 @@ const LogSeverity LOG_DCHECK = LOG_FATAL;
#define DCHECK_GE(val1, val2) DCHECK_OP(GE, >=, val1, val2)
#define DCHECK_GT(val1, val2) DCHECK_OP(GT, > , val1, val2)
#if !DCHECK_IS_ON() && defined(OS_CHROMEOS)
#if BUILDFLAG(ENABLE_LOG_ERROR_NOT_REACHED)
// Implement logging of NOTREACHED() as a dedicated function to get function
// call overhead down to a minimum.
void LogErrorNotReached(const char* file, int line);
......
# Copyright 2019 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.
import("//build/config/dcheck_always_on.gni")
declare_args() {
# Use LogErrorNotReached() for NOTREACHED().
enable_log_error_not_reached = is_chromeos && !(is_debug || dcheck_always_on)
}
......@@ -96,4 +96,8 @@ static_library("char_coding") {
"cpp/char_coding.cc",
"cpp/char_coding.h",
]
deps = [
"//base",
]
}
......@@ -32,6 +32,7 @@ static_library("channel_getter") {
deps = [
":version_constants_bridge_jni",
"..:channel",
"//base", # for jni_generator_helper.h
]
}
......
......@@ -1955,6 +1955,9 @@ if (current_cpu == "x86" || current_cpu == "x64") {
":blink_platform_implementation",
"//third_party/blink/renderer:non_test_config",
]
public_deps = [
":blink_platform_public_deps",
]
if (is_win) {
cflags = [ "/arch:AVX" ]
} else {
......
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