Enable -Wexit-time-destructors for chrome/common and chrome/services
Make sure production code in these 2 directories do not contain any exit time destructors. Remove the exit time destructors found in printing code, where saving a TaskRunner for future use is a negligible performance win. Bug: 101600 Change-Id: I5af3d93ce1de8612b98708522bda9d66e329e60b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4889455 Reviewed-by: Alan Screen <awscreen@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org> Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com> Cr-Commit-Position: refs/heads/main@{#1202425}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
a38028c62a
commit
11694fae85
chrome
common
BUILD.gn
apps
platform_apps
chromeos
extensions
controlled_frame
net
notifications
printing
privacy_budget
profiler
safe_browsing
themes
win
services
cups_proxy
file_util
ipp_parser
mac_notifications
media_gallery_util
printing
qrcode_generator
removable_storage_writer
sharing
speech
system_signals
util_win
@ -67,6 +67,7 @@ source_set("channel_info") {
|
||||
"channel_info.cc",
|
||||
"channel_info.h",
|
||||
]
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
deps = [
|
||||
"//build:branding_buildflags",
|
||||
"//build:chromeos_buildflags",
|
||||
@ -104,6 +105,7 @@ source_set("ini_parser") {
|
||||
"ini_parser.cc",
|
||||
"ini_parser.h",
|
||||
]
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
deps = [ "//base" ]
|
||||
}
|
||||
|
||||
@ -522,9 +524,7 @@ static_library("non_code_constants") {
|
||||
"env_vars.cc",
|
||||
"env_vars.h",
|
||||
]
|
||||
if (is_win) {
|
||||
sources += [ "chrome_icon_resources_win.h" ]
|
||||
}
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
":buildflags",
|
||||
@ -539,6 +539,10 @@ static_library("non_code_constants") {
|
||||
"//printing/buildflags",
|
||||
"//ui/base:buildflags",
|
||||
]
|
||||
|
||||
if (is_win) {
|
||||
sources += [ "chrome_icon_resources_win.h" ]
|
||||
}
|
||||
}
|
||||
|
||||
component("chrome_features") {
|
||||
@ -548,6 +552,7 @@ component("chrome_features") {
|
||||
"chrome_features.cc",
|
||||
"chrome_features.h",
|
||||
]
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
":buildflags",
|
||||
@ -575,6 +580,7 @@ static_library("url_constants") {
|
||||
"webui_url_constants.cc",
|
||||
"webui_url_constants.h",
|
||||
]
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
public_deps = [
|
||||
":buildflags",
|
||||
@ -609,6 +615,7 @@ static_library("constants") {
|
||||
"pref_font_webkit_names.h",
|
||||
"pref_names.h",
|
||||
]
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
public_deps = [
|
||||
":buildflags",
|
||||
|
@ -19,6 +19,8 @@ source_set("platform_apps") {
|
||||
"media_galleries_permission_data.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
"//chrome/common:resources_grit",
|
||||
"//chrome/common/apps/platform_apps/api",
|
||||
|
@ -26,6 +26,8 @@ static_library("extensions") {
|
||||
"chromeos_system_extensions_manifest_handler.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
public_deps = [ "//components/web_package" ]
|
||||
|
||||
deps = [
|
||||
|
@ -13,6 +13,8 @@ source_set("controlled_frame") {
|
||||
"controlled_frame_api_provider.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
"//chrome/common:resources_grit",
|
||||
"//chrome/common/controlled_frame/api",
|
||||
|
@ -13,6 +13,8 @@ static_library("net") {
|
||||
"net_resource_provider.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
"//base",
|
||||
"//base:i18n",
|
||||
|
@ -10,6 +10,8 @@ source_set("notifications") {
|
||||
"notification_operation.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
"//base",
|
||||
"//chrome/common:constants",
|
||||
|
@ -38,6 +38,8 @@ source_set("printing") {
|
||||
"printing_init.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
public_deps = [
|
||||
":printing_buildflags",
|
||||
"//printing/backend",
|
||||
|
@ -14,6 +14,8 @@ source_set("privacy_budget") {
|
||||
"types.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
public_deps = [
|
||||
"//base",
|
||||
"//third_party/blink/public/common",
|
||||
|
@ -23,6 +23,8 @@ source_set("profiler") {
|
||||
"unwind_util.cc",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
"//base",
|
||||
"//build:branding_buildflags",
|
||||
|
@ -16,6 +16,7 @@ if (safe_browsing_mode == 1) {
|
||||
"archive_analyzer_results.cc",
|
||||
"archive_analyzer_results.h",
|
||||
]
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
deps = [
|
||||
":binary_feature_extractor",
|
||||
":download_type_util",
|
||||
@ -39,6 +40,7 @@ if (safe_browsing_mode == 1) {
|
||||
"document_analyzer_results.cc",
|
||||
"document_analyzer_results.h",
|
||||
]
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
deps = [
|
||||
":download_type_util",
|
||||
"//base",
|
||||
@ -53,6 +55,7 @@ if (safe_browsing_mode == 1) {
|
||||
"download_type_util.cc",
|
||||
"download_type_util.h",
|
||||
]
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
deps = [
|
||||
"//base",
|
||||
"//components/safe_browsing/content/common:file_type_policies",
|
||||
@ -67,7 +70,7 @@ if (safe_browsing_mode == 1) {
|
||||
"disk_image_type_sniffer_mac.cc",
|
||||
"disk_image_type_sniffer_mac.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
deps = [ "//base" ]
|
||||
}
|
||||
}
|
||||
@ -77,6 +80,7 @@ if (safe_browsing_mode == 1) {
|
||||
"binary_feature_extractor.cc",
|
||||
"binary_feature_extractor.h",
|
||||
]
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
if (is_mac) {
|
||||
sources += [
|
||||
"binary_feature_extractor_mac.cc",
|
||||
@ -128,6 +132,8 @@ source_set("safe_browsing") {
|
||||
"protobuf_message_write_macros.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps += [
|
||||
":archive_analyzer_results",
|
||||
":binary_feature_extractor",
|
||||
|
@ -8,6 +8,8 @@ source_set("autogenerated_theme_util") {
|
||||
"autogenerated_theme_util.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
public_deps = [
|
||||
"//skia",
|
||||
"//ui/gfx:color_utils",
|
||||
|
@ -29,6 +29,8 @@ shared_library("eventlog_provider") {
|
||||
"eventlog_provider.cc",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
if (!is_asan && !use_clang_profiling) {
|
||||
no_default_deps = true
|
||||
ldflags = [ "/NOENTRY" ]
|
||||
@ -45,6 +47,7 @@ shared_library("eventlog_provider") {
|
||||
# link time.
|
||||
source_set("delay_load_failure_hook") {
|
||||
sources = [ "delay_load_failure_hook.cc" ]
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
deps = [
|
||||
":delay_load_failure_support",
|
||||
"//base",
|
||||
@ -56,5 +59,6 @@ source_set("delay_load_failure_support") {
|
||||
"delay_load_failure_support.cc",
|
||||
"delay_load_failure_support.h",
|
||||
]
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
deps = [ "//base" ]
|
||||
}
|
||||
|
@ -27,6 +27,8 @@ source_set("cups_proxy") {
|
||||
"socket_manager.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
"//base",
|
||||
"//chrome/services/cups_proxy/public/cpp",
|
||||
|
@ -18,6 +18,8 @@ source_set("cpp") {
|
||||
"type_conversions.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
"//base",
|
||||
"//chromeos/printing",
|
||||
|
@ -14,6 +14,8 @@ source_set("file_util") {
|
||||
"file_util_service.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
":buildflags",
|
||||
"//base",
|
||||
|
@ -8,6 +8,7 @@ import("//components/safe_browsing/buildflags.gni")
|
||||
import("//printing/buildflags/buildflags.gni")
|
||||
|
||||
source_set("cpp") {
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
deps = [ "//chrome/common/safe_browsing:archive_analyzer_results" ]
|
||||
public_deps = [ "//chrome/services/file_util/public/mojom" ]
|
||||
|
||||
|
@ -11,6 +11,8 @@ enable_service = use_cups && is_chromeos_ash
|
||||
source_set("ipp_parser") {
|
||||
sources = [ "ipp_parser.h" ]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
"//base",
|
||||
"//net",
|
||||
|
@ -13,6 +13,8 @@ if (use_cups) {
|
||||
"ipp_converter.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
public_deps = [ "//chrome/services/ipp_parser/public/mojom" ]
|
||||
|
||||
deps = [
|
||||
|
@ -12,6 +12,8 @@ if (use_cups) {
|
||||
"ipp_parser_launcher.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
"//base",
|
||||
"//chrome:strings",
|
||||
|
@ -19,6 +19,8 @@ source_set("mac_notifications") {
|
||||
"unnotification_metrics.mm",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
"//base",
|
||||
"//chrome/app:generated_resources",
|
||||
|
@ -9,6 +9,7 @@ source_set("cpp") {
|
||||
"notification_style.h",
|
||||
"notification_style.mm",
|
||||
]
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
deps = [ "//base" ]
|
||||
frameworks = [ "Foundation.framework" ]
|
||||
}
|
||||
|
@ -17,6 +17,8 @@ source_set("lib") {
|
||||
"media_parser_factory.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
"//base",
|
||||
"//chrome/common",
|
||||
@ -25,6 +27,8 @@ source_set("lib") {
|
||||
"//third_party/libyuv",
|
||||
]
|
||||
|
||||
public_deps = [ "//chrome/services/media_gallery_util/public/mojom" ]
|
||||
|
||||
if (is_android) {
|
||||
sources += [
|
||||
"media_parser_android.cc",
|
||||
@ -34,8 +38,6 @@ source_set("lib") {
|
||||
]
|
||||
}
|
||||
|
||||
public_deps = [ "//chrome/services/media_gallery_util/public/mojom" ]
|
||||
|
||||
if (media_use_ffmpeg) {
|
||||
deps += [
|
||||
"//third_party/ffmpeg",
|
||||
|
@ -16,6 +16,8 @@ source_set("cpp") {
|
||||
"safe_media_metadata_parser.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
"//base",
|
||||
"//chrome/app:generated_resources",
|
||||
|
@ -9,6 +9,8 @@ import("//testing/test.gni")
|
||||
source_set("lib") {
|
||||
sources = []
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = []
|
||||
|
||||
public_deps = []
|
||||
|
@ -86,8 +86,7 @@ scoped_refptr<base::SequencedTaskRunner> GetPrintingTaskRunner() {
|
||||
// Use task runner associated with equivalent of UI thread. Needed for calls
|
||||
// made through `PrintDialogLinuxInterface` to properly execute.
|
||||
CHECK(base::SequencedTaskRunner::HasCurrentDefault());
|
||||
scoped_refptr<base::SequencedTaskRunner> task_runner =
|
||||
base::SequencedTaskRunner::GetCurrentDefault();
|
||||
return base::SequencedTaskRunner::GetCurrentDefault();
|
||||
#else
|
||||
|
||||
static constexpr base::TaskTraits kTraits = {
|
||||
@ -95,24 +94,19 @@ scoped_refptr<base::SequencedTaskRunner> GetPrintingTaskRunner() {
|
||||
|
||||
#if BUILDFLAG(USE_CUPS)
|
||||
// CUPS is thread safe, so a task runner can be allocated for each job.
|
||||
scoped_refptr<base::SequencedTaskRunner> task_runner =
|
||||
base::ThreadPool::CreateSequencedTaskRunner(kTraits);
|
||||
return base::ThreadPool::CreateSequencedTaskRunner(kTraits);
|
||||
#elif BUILDFLAG(IS_WIN)
|
||||
// For Windows, we want a single threaded task runner shared for all print
|
||||
// jobs in the process because Windows printer drivers are oftentimes not
|
||||
// thread-safe. This protects against multiple print jobs to the same device
|
||||
// from running in the driver at the same time.
|
||||
static scoped_refptr<base::SequencedTaskRunner> task_runner =
|
||||
base::ThreadPool::CreateSingleThreadTaskRunner(kTraits);
|
||||
return base::ThreadPool::CreateSingleThreadTaskRunner(kTraits);
|
||||
#else
|
||||
// Be conservative for unsupported platforms, use a single threaded runner
|
||||
// so that concurrent print jobs are not in driver code at the same time.
|
||||
static scoped_refptr<base::SequencedTaskRunner> task_runner =
|
||||
base::ThreadPool::CreateSingleThreadTaskRunner(kTraits);
|
||||
return base::ThreadPool::CreateSingleThreadTaskRunner(kTraits);
|
||||
#endif
|
||||
#endif // BUILDFLAG(IS_LINUX)
|
||||
|
||||
return task_runner;
|
||||
}
|
||||
|
||||
std::unique_ptr<Metafile> CreateMetafile(mojom::MetafileDataType data_type) {
|
||||
|
@ -10,6 +10,8 @@ source_set("qrcode_generator") {
|
||||
"qrcode_generator_service_impl.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
"//base",
|
||||
"//chrome:strings",
|
||||
|
@ -8,6 +8,8 @@ source_set("cpp") {
|
||||
"qrcode_generator_service.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
"//base",
|
||||
"//chrome:strings",
|
||||
|
@ -8,6 +8,8 @@ source_set("lib") {
|
||||
"removable_storage_writer.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
public_deps = [
|
||||
"//base",
|
||||
"//chrome/services/removable_storage_writer/public/mojom",
|
||||
|
@ -10,6 +10,8 @@ source_set("sharing") {
|
||||
"sharing_impl.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
"nearby",
|
||||
"webrtc",
|
||||
|
@ -21,6 +21,8 @@ source_set("nearby") {
|
||||
"platform.cc",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
public_deps = [
|
||||
"decoder",
|
||||
"platform",
|
||||
|
@ -15,6 +15,8 @@ source_set("decoder") {
|
||||
"nearby_decoder.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
public_deps = [
|
||||
"//base",
|
||||
"//chrome/services/sharing/public/cpp",
|
||||
|
@ -68,6 +68,8 @@ source_set("platform") {
|
||||
"wifi_lan_socket.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
public_deps = [
|
||||
"//third_party/nearby:connections_local_credential_proto",
|
||||
"//third_party/nearby:platform_api_platform",
|
||||
|
@ -14,6 +14,8 @@ source_set("quick_start_decoder") {
|
||||
"quick_start_decoder.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
"//base",
|
||||
"//chromeos/ash/components/quick_start",
|
||||
|
@ -16,6 +16,8 @@ source_set("cpp") {
|
||||
"sharing_webrtc_metrics.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
public_deps = [
|
||||
"//base",
|
||||
"//chrome/services/sharing/public/proto",
|
||||
|
@ -23,6 +23,8 @@ source_set("webrtc") {
|
||||
"p2p_socket_client_delegate.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
"//components/webrtc:net_address_utils",
|
||||
"//components/webrtc:thread_wrapper",
|
||||
|
@ -18,12 +18,7 @@ source_set("lib") {
|
||||
"speech_recognition_service_impl.h",
|
||||
]
|
||||
|
||||
if (is_chromeos_ash) {
|
||||
sources += [
|
||||
"cros_speech_recognition_recognizer_impl.cc",
|
||||
"cros_speech_recognition_recognizer_impl.h",
|
||||
]
|
||||
}
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
public_deps = [
|
||||
"//media/mojo/mojom",
|
||||
@ -45,6 +40,13 @@ source_set("lib") {
|
||||
"//net",
|
||||
"//services/audio/public/cpp",
|
||||
]
|
||||
|
||||
if (is_chromeos_ash) {
|
||||
sources += [
|
||||
"cros_speech_recognition_recognizer_impl.cc",
|
||||
"cros_speech_recognition_recognizer_impl.h",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
if (is_chromeos_ash) {
|
||||
|
@ -19,6 +19,8 @@ source_set("soda") {
|
||||
"soda_test_paths.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
":soda_api_proto",
|
||||
"//base",
|
||||
|
@ -12,6 +12,8 @@ source_set("system_signals") {
|
||||
"base_system_signals_service.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
public_deps = [
|
||||
"//components/device_signals/core/common/mojom",
|
||||
"//mojo/public/mojom/base",
|
||||
|
@ -9,6 +9,8 @@ source_set("browser") {
|
||||
|
||||
sources = [ "system_signals_service_host_impl.cc" ]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
public_deps = [
|
||||
"//components/device_signals/core/browser",
|
||||
"//components/device_signals/core/common/mojom",
|
||||
|
@ -16,6 +16,8 @@ source_set("lib") {
|
||||
"util_win_impl.h",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||
|
||||
deps = [
|
||||
"//base",
|
||||
"//chrome/browser/win/conflicts:module_info",
|
||||
|
Reference in New Issue
Block a user