Skip to content

Commit 4d14c1b

Browse files
GeorgNeisCrashpad LUCI CQ
authored andcommitted
Simplify ChromeOS build configuration
Lacros is no longer supported. - Remove any IS_CHROMEOS_LACROS uses. - Replace any IS_CHROMEOS_ASH uses with IS_CHROMEOS. - Remove dependencies on build/chromeos_buildflags.h. Change-Id: Ia8b522a14370f2309f2e66eee505cabbf2c95542 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/6275984 Commit-Queue: Georg Neis <[email protected]> Reviewed-by: Joshua Peraza <[email protected]>
1 parent 0945d59 commit 4d14c1b

File tree

9 files changed

+23
-54
lines changed

9 files changed

+23
-54
lines changed

client/BUILD.gn

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,7 @@ crashpad_static_library("client") {
7979
"../util",
8080
]
8181

82-
deps = [
83-
":common",
84-
"$mini_chromium_source_parent:chromeos_buildflags",
85-
]
82+
deps = [ ":common" ]
8683

8784
if (crashpad_is_win) {
8885
libs = [ "rpcrt4.lib" ]

client/crashpad_client.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
#include "base/files/file_path.h"
2727
#include "build/build_config.h"
28-
#include "build/chromeos_buildflags.h"
2928
#include "util/file/file_io.h"
3029

3130
#if !BUILDFLAG(IS_FUCHSIA)
@@ -799,7 +798,7 @@ class CrashpadClient {
799798
static void UseSystemDefaultHandler();
800799
#endif
801800

802-
#if BUILDFLAG(IS_CHROMEOS_ASH)
801+
#if BUILDFLAG(IS_CHROMEOS)
803802
//! \brief Sets a timestamp on the signal handler to be passed on to
804803
//! crashpad_handler and then eventually Chrome OS's crash_reporter.
805804
//!

client/crashpad_client_linux.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include "base/logging.h"
3535
#include "base/strings/stringprintf.h"
3636
#include "build/build_config.h"
37-
#include "build/chromeos_buildflags.h"
3837
#include "client/client_argv_handling.h"
3938
#include "third_party/lss/lss.h"
4039
#include "util/file/file_io.h"
@@ -406,15 +405,15 @@ class RequestCrashDumpHandler : public SignalHandler {
406405
ExceptionHandlerProtocol::ClientInformation info = {};
407406
info.exception_information_address =
408407
FromPointerCast<VMAddress>(&GetExceptionInfo());
409-
#if BUILDFLAG(IS_CHROMEOS_ASH)
408+
#if BUILDFLAG(IS_CHROMEOS)
410409
info.crash_loop_before_time = crash_loop_before_time_;
411410
#endif
412411

413412
ExceptionHandlerClient client(sock_to_handler_.get(), true);
414413
client.RequestCrashDump(info);
415414
}
416415

417-
#if BUILDFLAG(IS_CHROMEOS_ASH)
416+
#if BUILDFLAG(IS_CHROMEOS)
418417
void SetCrashLoopBefore(uint64_t crash_loop_before_time) {
419418
crash_loop_before_time_ = crash_loop_before_time;
420419
}
@@ -436,7 +435,7 @@ class RequestCrashDumpHandler : public SignalHandler {
436435
ScopedFileHandle sock_to_handler_;
437436
pid_t handler_pid_ = -1;
438437

439-
#if BUILDFLAG(IS_CHROMEOS_ASH)
438+
#if BUILDFLAG(IS_CHROMEOS)
440439
// An optional UNIX timestamp passed to us from Chrome.
441440
// This will pass to crashpad_handler and then to Chrome OS crash_reporter.
442441
// This should really be a time_t, but it's basically an opaque value (we
@@ -763,7 +762,7 @@ void CrashpadClient::SetUnhandledSignals(const std::set<int>& signals) {
763762
unhandled_signals_ = signals;
764763
}
765764

766-
#if BUILDFLAG(IS_CHROMEOS_ASH)
765+
#if BUILDFLAG(IS_CHROMEOS)
767766
// static
768767
void CrashpadClient::SetCrashLoopBefore(uint64_t crash_loop_before_time) {
769768
auto request_crash_dump_handler = RequestCrashDumpHandler::Get();

handler/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ static_library("handler") {
7474
":common",
7575
"../minidump",
7676
"../snapshot",
77-
"../third_party/mini_chromium:chromeos_buildflags",
7877
"../tools:tool_support",
7978
]
8079

handler/handler_main.cc

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
#include "base/strings/stringprintf.h"
3939
#include "base/strings/utf_string_conversions.h"
4040
#include "build/build_config.h"
41-
#include "build/chromeos_buildflags.h"
4241
#include "client/crash_report_database.h"
4342
#include "client/crashpad_client.h"
4443
#include "client/crashpad_info.h"
@@ -57,7 +56,7 @@
5756
#include "util/string/split_string.h"
5857
#include "util/synchronization/semaphore.h"
5958

60-
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
59+
#if BUILDFLAG(IS_CHROMEOS)
6160
#include "handler/linux/cros_crash_report_exception_handler.h"
6261
#endif
6362

@@ -192,7 +191,7 @@ void Usage(const base::FilePath& me) {
192191
" --url=URL send crash reports to this Breakpad server URL,\n"
193192
" only if uploads are enabled for the database\n"
194193
// clang-format on
195-
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
194+
#if BUILDFLAG(IS_CHROMEOS)
196195
// clang-format off
197196
" --use-cros-crash-reporter\n"
198197
" pass crash reports to /sbin/crash_reporter\n"
@@ -205,7 +204,7 @@ void Usage(const base::FilePath& me) {
205204
" crash_reporter, thus skipping metrics consent\n"
206205
" checks\n"
207206
// clang-format on
208-
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
207+
#endif // BUILDFLAG(IS_CHROMEOS)
209208
#if BUILDFLAG(IS_ANDROID)
210209
// clang-format off
211210
" --write-minidump-to-log write minidump to log\n"
@@ -248,11 +247,11 @@ struct Options {
248247
bool periodic_tasks;
249248
bool rate_limit;
250249
bool upload_gzip;
251-
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
250+
#if BUILDFLAG(IS_CHROMEOS)
252251
bool use_cros_crash_reporter = false;
253252
base::FilePath minidump_dir_for_tests;
254253
bool always_allow_feedback = false;
255-
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
254+
#endif // BUILDFLAG(IS_CHROMEOS)
256255
#if defined(ATTACHMENTS_SUPPORTED)
257256
std::vector<base::FilePath> attachments;
258257
#endif // ATTACHMENTS_SUPPORTED
@@ -551,7 +550,7 @@ class ScopedStoppable {
551550

552551
void InitCrashpadLogging() {
553552
logging::LoggingSettings settings;
554-
#if BUILDFLAG(IS_CHROMEOS_ASH)
553+
#if BUILDFLAG(IS_CHROMEOS)
555554
settings.logging_dest = logging::LOG_TO_FILE;
556555
settings.log_file_path = "/var/log/chrome/chrome";
557556
#elif BUILDFLAG(IS_WIN)
@@ -622,11 +621,11 @@ int HandlerMain(int argc,
622621
kOptionTraceParentWithException,
623622
#endif
624623
kOptionURL,
625-
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
624+
#if BUILDFLAG(IS_CHROMEOS)
626625
kOptionUseCrosCrashReporter,
627626
kOptionMinidumpDirForTests,
628627
kOptionAlwaysAllowFeedback,
629-
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
628+
#endif // BUILDFLAG(IS_CHROMEOS)
630629
#if BUILDFLAG(IS_ANDROID)
631630
kOptionWriteMinidumpToLog,
632631
#endif // BUILDFLAG(IS_ANDROID)
@@ -706,7 +705,7 @@ int HandlerMain(int argc,
706705
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
707706
// BUILDFLAG(IS_ANDROID)
708707
{"url", required_argument, nullptr, kOptionURL},
709-
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
708+
#if BUILDFLAG(IS_CHROMEOS)
710709
{"use-cros-crash-reporter",
711710
no_argument,
712711
nullptr,
@@ -716,7 +715,7 @@ int HandlerMain(int argc,
716715
nullptr,
717716
kOptionMinidumpDirForTests},
718717
{"always-allow-feedback", no_argument, nullptr, kOptionAlwaysAllowFeedback},
719-
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
718+
#endif // BUILDFLAG(IS_CHROMEOS)
720719
#if BUILDFLAG(IS_ANDROID)
721720
{"write-minidump-to-log", no_argument, nullptr, kOptionWriteMinidumpToLog},
722721
#endif // BUILDFLAG(IS_ANDROID)
@@ -879,7 +878,7 @@ int HandlerMain(int argc,
879878
options.url = optarg;
880879
break;
881880
}
882-
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
881+
#if BUILDFLAG(IS_CHROMEOS)
883882
case kOptionUseCrosCrashReporter: {
884883
options.use_cros_crash_reporter = true;
885884
break;
@@ -893,7 +892,7 @@ int HandlerMain(int argc,
893892
options.always_allow_feedback = true;
894893
break;
895894
}
896-
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
895+
#endif // BUILDFLAG(IS_CHROMEOS)
897896
#if BUILDFLAG(IS_ANDROID)
898897
case kOptionWriteMinidumpToLog: {
899898
options.write_minidump_to_log = true;
@@ -1042,7 +1041,7 @@ int HandlerMain(int argc,
10421041
std::unique_ptr<CrashReportExceptionHandler> exception_handler;
10431042
#endif
10441043

1045-
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
1044+
#if BUILDFLAG(IS_CHROMEOS)
10461045
if (options.use_cros_crash_reporter) {
10471046
auto cros_handler = std::make_unique<CrosCrashReportExceptionHandler>(
10481047
database.get(),
@@ -1085,7 +1084,7 @@ int HandlerMain(int argc,
10851084
false,
10861085
#endif // BUILDFLAG(IS_LINUX)
10871086
user_stream_sources);
1088-
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
1087+
#endif // BUILDFLAG(IS_CHROMEOS)
10891088

10901089
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
10911090
if (options.exception_information_address) {

handler/linux/cros_crash_report_exception_handler.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,6 @@ bool CrosCrashReportExceptionHandler::HandleExceptionWithConnection(
257257
constexpr int32_t kFixedVersion = 15363;
258258
// TODO(https://crbug.com/1420445): Remove this check (and the
259259
// CRASHPAD_IS_IN_CHROMIUM defines) when M115 branches.
260-
// (Lacros is guaranteed not to be more than 2 milestones ahead of ash, and
261-
// M113 on ash has the relevant crash_reporter change.)
262260
if (major_version >= kFixedVersion) {
263261
// Used to distinguish between non-fatal and fatal crashes.
264262
const ExceptionSnapshot* const exception_snapshot = snapshot->Exception();

third_party/mini_chromium/BUILD.gn

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,3 @@ group("build") {
4949
public_deps = [ "//third_party/mini_chromium/mini_chromium/build" ]
5050
}
5151
}
52-
53-
group("chromeos_buildflags") {
54-
if (crashpad_is_in_chromium) {
55-
public_deps = [ "//build:chromeos_buildflags" ]
56-
} else if (crashpad_is_standalone) {
57-
public_deps = [ "mini_chromium/build:chromeos_buildflags" ]
58-
} else if (crashpad_is_in_fuchsia) {
59-
public_deps = [ mini_chromium_import_root + "/build:chromeos_buildflags" ]
60-
} else if (crashpad_is_external) {
61-
public_deps = [ "../../../../mini_chromium/mini_chromium/build:chromeos_buildflags" ]
62-
} else if (crashpad_is_in_dart) {
63-
public_deps = [ "//third_party/mini_chromium/mini_chromium/build:chromeos_buildflags" ]
64-
}
65-
}

util/BUILD.gn

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -573,10 +573,7 @@ crashpad_static_library("util") {
573573
"../third_party/zlib",
574574
]
575575

576-
deps += [
577-
"$mini_chromium_source_parent:base",
578-
"$mini_chromium_source_parent:chromeos_buildflags",
579-
]
576+
deps = [ "$mini_chromium_source_parent:base" ]
580577

581578
configs = [ "../build:flock_always_supported_defines" ]
582579

util/posix/scoped_mmap.cc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,14 @@
2424
#include "base/numerics/safe_conversions.h"
2525
#include "base/numerics/safe_math.h"
2626
#include "build/build_config.h"
27-
#include "build/chromeos_buildflags.h"
2827

29-
// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
30-
// complete.
31-
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
28+
#if BUILDFLAG(IS_LINUX)
3229
#include "third_party/lss/lss.h"
3330
#endif
3431

3532
namespace {
3633

37-
// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
38-
// complete.
39-
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
34+
#if BUILDFLAG(IS_LINUX)
4035
void* CallMmap(void* addr,
4136
size_t len,
4237
int prot,

0 commit comments

Comments
 (0)