Skip to content

Commit

Permalink
Enable size_t truncation warnings in most directories.
Browse files Browse the repository at this point in the history
Bug: 167187
Change-Id: I757b2469336069ff637de60fde4abeb29bf4d041
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3057921
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#907277}
  • Loading branch information
pkasting authored and Chromium LUCI CQ committed Jul 30, 2021
1 parent 31b7c72 commit 6552e4c
Show file tree
Hide file tree
Showing 101 changed files with 39 additions and 321 deletions.
1 change: 0 additions & 1 deletion ash/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2468,7 +2468,6 @@ test("ash_unittests") {
]
configs += [
"//build/config:precompiled_headers",
"//build/config/compiler:no_size_t_to_int_warning",
]

deps = [
Expand Down
2 changes: 0 additions & 2 deletions ash/app_list/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,6 @@ source_set("unit_tests") {
"views/search_result_tile_item_list_view_unittest.cc",
]

configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

deps = [
":app_list",
":test_support",
Expand Down
8 changes: 0 additions & 8 deletions base/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1990,9 +1990,6 @@ component("base") {
defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ]
}

# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

libs += [
"cfgmgr32.lib",
"powrprof.lib",
Expand Down Expand Up @@ -2600,9 +2597,6 @@ component("i18n") {
configs += [ "//build/config/compiler:optimize_max" ]
}

# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

if (is_mac) {
frameworks = [ "CoreFoundation.framework" ]
}
Expand Down Expand Up @@ -3666,10 +3660,8 @@ test("base_unittests") {
sources += [ "allocator/partition_allocator/arm_bti_test_functions.S" ]
}

# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [
":memory_tagging",
"//build/config/compiler:no_size_t_to_int_warning",
"//build/config/compiler:noshadowing",
]
}
Expand Down
4 changes: 3 additions & 1 deletion cc/metrics/compositor_frame_reporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ class CC_EXPORT CompositorFrameReporter {
void AddEventsMetrics(EventMetrics::List events_metrics);
EventMetrics::List TakeEventsMetrics();

int stage_history_size_for_testing() const { return stage_history_.size(); }
size_t stage_history_size_for_testing() const {
return stage_history_.size();
}

void OnFinishImplFrame(base::TimeTicks timestamp);
void OnAbortBeginMainFrame(base::TimeTicks timestamp);
Expand Down
28 changes: 14 additions & 14 deletions cc/metrics/compositor_frame_reporter_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,30 +132,30 @@ TEST_F(CompositorFrameReporterTest, MainFrameAbortedReportingTest) {
pipeline_reporter_->StartStage(
CompositorFrameReporter::StageType::kBeginImplFrameToSendBeginMainFrame,
Now());
EXPECT_EQ(0, pipeline_reporter_->stage_history_size_for_testing());
EXPECT_EQ(0u, pipeline_reporter_->stage_history_size_for_testing());

AdvanceNowByMs(3);
pipeline_reporter_->StartStage(
CompositorFrameReporter::StageType::kSendBeginMainFrameToCommit, Now());
EXPECT_EQ(1, pipeline_reporter_->stage_history_size_for_testing());
EXPECT_EQ(1u, pipeline_reporter_->stage_history_size_for_testing());

AdvanceNowByMs(3);
pipeline_reporter_->StartStage(
CompositorFrameReporter::StageType::kEndActivateToSubmitCompositorFrame,
Now());
EXPECT_EQ(2, pipeline_reporter_->stage_history_size_for_testing());
EXPECT_EQ(2u, pipeline_reporter_->stage_history_size_for_testing());

AdvanceNowByMs(3);
pipeline_reporter_->StartStage(
CompositorFrameReporter::StageType::
kSubmitCompositorFrameToPresentationCompositorFrame,
Now());
EXPECT_EQ(3, pipeline_reporter_->stage_history_size_for_testing());
EXPECT_EQ(3u, pipeline_reporter_->stage_history_size_for_testing());

AdvanceNowByMs(3);
pipeline_reporter_->TerminateFrame(
CompositorFrameReporter::FrameTerminationStatus::kPresentedFrame, Now());
EXPECT_EQ(4, pipeline_reporter_->stage_history_size_for_testing());
EXPECT_EQ(4u, pipeline_reporter_->stage_history_size_for_testing());

pipeline_reporter_ = nullptr;
histogram_tester.ExpectTotalCount(
Expand All @@ -177,18 +177,18 @@ TEST_F(CompositorFrameReporterTest, ReplacedByNewReporterReportingTest) {

pipeline_reporter_->StartStage(CompositorFrameReporter::StageType::kCommit,
Now());
EXPECT_EQ(0, pipeline_reporter_->stage_history_size_for_testing());
EXPECT_EQ(0u, pipeline_reporter_->stage_history_size_for_testing());

AdvanceNowByMs(3);
pipeline_reporter_->StartStage(
CompositorFrameReporter::StageType::kEndCommitToActivation, Now());
EXPECT_EQ(1, pipeline_reporter_->stage_history_size_for_testing());
EXPECT_EQ(1u, pipeline_reporter_->stage_history_size_for_testing());

AdvanceNowByMs(2);
pipeline_reporter_->TerminateFrame(
CompositorFrameReporter::FrameTerminationStatus::kReplacedByNewReporter,
Now());
EXPECT_EQ(2, pipeline_reporter_->stage_history_size_for_testing());
EXPECT_EQ(2u, pipeline_reporter_->stage_history_size_for_testing());

pipeline_reporter_ = nullptr;
histogram_tester.ExpectTotalCount("CompositorLatency.Commit", 0);
Expand All @@ -201,18 +201,18 @@ TEST_F(CompositorFrameReporterTest, SubmittedFrameReportingTest) {

pipeline_reporter_->StartStage(
CompositorFrameReporter::StageType::kActivation, Now());
EXPECT_EQ(0, pipeline_reporter_->stage_history_size_for_testing());
EXPECT_EQ(0u, pipeline_reporter_->stage_history_size_for_testing());

AdvanceNowByMs(3);
pipeline_reporter_->StartStage(
CompositorFrameReporter::StageType::kEndActivateToSubmitCompositorFrame,
Now());
EXPECT_EQ(1, pipeline_reporter_->stage_history_size_for_testing());
EXPECT_EQ(1u, pipeline_reporter_->stage_history_size_for_testing());

AdvanceNowByMs(2);
pipeline_reporter_->TerminateFrame(
CompositorFrameReporter::FrameTerminationStatus::kPresentedFrame, Now());
EXPECT_EQ(2, pipeline_reporter_->stage_history_size_for_testing());
EXPECT_EQ(2u, pipeline_reporter_->stage_history_size_for_testing());

pipeline_reporter_ = nullptr;
histogram_tester.ExpectTotalCount("CompositorLatency.Activation", 1);
Expand All @@ -237,18 +237,18 @@ TEST_F(CompositorFrameReporterTest, SubmittedDroppedFrameReportingTest) {

pipeline_reporter_->StartStage(
CompositorFrameReporter::StageType::kSendBeginMainFrameToCommit, Now());
EXPECT_EQ(0, pipeline_reporter_->stage_history_size_for_testing());
EXPECT_EQ(0u, pipeline_reporter_->stage_history_size_for_testing());

AdvanceNowByMs(3);
pipeline_reporter_->StartStage(CompositorFrameReporter::StageType::kCommit,
Now());
EXPECT_EQ(1, pipeline_reporter_->stage_history_size_for_testing());
EXPECT_EQ(1u, pipeline_reporter_->stage_history_size_for_testing());

AdvanceNowByMs(2);
pipeline_reporter_->TerminateFrame(
CompositorFrameReporter::FrameTerminationStatus::kDidNotPresentFrame,
Now());
EXPECT_EQ(2, pipeline_reporter_->stage_history_size_for_testing());
EXPECT_EQ(2u, pipeline_reporter_->stage_history_size_for_testing());

pipeline_reporter_ = nullptr;
histogram_tester.ExpectTotalCount(
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/devtools/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ static_library("devtools") {
sources = []

configs += [
"//build/config/compiler:no_size_t_to_int_warning",
"//build/config/compiler:wexit_time_destructors",
"//build/config:precompiled_headers",
]
Expand Down
2 changes: 0 additions & 2 deletions chrome/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,6 @@ static_library("test_support") {
"//testing/gtest",
]

configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

if (enable_extensions) {
sources += [
"extensions/extension_test_util.cc",
Expand Down
2 changes: 0 additions & 2 deletions chrome/common/net/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ static_library("net") {
"safe_search_util.h",
]

configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

deps = [
"//base",
"//base:i18n",
Expand Down
5 changes: 0 additions & 5 deletions chrome/install_static/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ if (is_win) {
}

libs = [ "kernel32.lib" ]

configs += [
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
"//build/config/compiler:no_size_t_to_int_warning",
]
}

# A source set for use by the module in a process that creates the
Expand Down
3 changes: 0 additions & 3 deletions chrome/installer/util/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ static_library("with_no_strings") {

configs += [
"//build/config:precompiled_headers",

# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
"//build/config/compiler:no_size_t_to_int_warning",
]

sources += [
Expand Down
2 changes: 0 additions & 2 deletions chromeos/components/proximity_auth/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ source_set("unit_tests") {
"unlock_manager_impl_unittest.cc",
]

configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

deps = [
":proximity_auth",
":test_support",
Expand Down
3 changes: 0 additions & 3 deletions components/android_system_error_page/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ static_library("android_system_error_page") {
]

configs += [
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
"//build/config/compiler:no_size_t_to_int_warning",

"//build/config/compiler:noshadowing",
]

Expand Down
3 changes: 0 additions & 3 deletions components/autofill/content/renderer/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ static_library("renderer") {
"//third_party/re2",
"//ui/base",
]

# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
}

static_library("test_support") {
Expand Down
2 changes: 0 additions & 2 deletions components/autofill/core/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,6 @@ static_library("browser") {
"//ui/native_theme:native_theme_browser",
]
}

configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
}

static_library("test_support") {
Expand Down
2 changes: 0 additions & 2 deletions components/autofill/core/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ static_library("common") {
"//ui/gfx/geometry",
"//url",
]

configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
}

component("features") {
Expand Down
2 changes: 0 additions & 2 deletions components/bookmarks/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ source_set("unit_tests") {
sources += [ "bookmark_node_data_unittest.cc" ]
deps += [ "//build:chromeos_buildflags" ]
}

configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
}

# The fuzzer depends on code that is not built on Mac.
Expand Down
2 changes: 0 additions & 2 deletions components/bookmarks/managed/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ source_set("unit_tests") {
"managed_bookmarks_tracker_unittest.cc",
]

configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

deps = [
":managed",
"//base",
Expand Down
1 change: 0 additions & 1 deletion components/browser_watcher/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ if (is_win) {
"exit_code_watcher_win_unittest.cc",
"extended_crash_reporting_win_unittest.cc",
]
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
":activity_report_proto",
":browser_watcher_client",
Expand Down
2 changes: 0 additions & 2 deletions components/browsing_data/content/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ static_library("content") {
"shared_worker_helper.h",
]

configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

deps = [
"//base",
"//components/browsing_data/core",
Expand Down
1 change: 0 additions & 1 deletion components/content_settings/core/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ static_library("browser") {
}

configs += [
"//build/config/compiler:no_size_t_to_int_warning",
"//build/config/compiler:wexit_time_destructors",
]
}
Expand Down
4 changes: 0 additions & 4 deletions components/data_reduction_proxy/core/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ static_library("test_support") {
"data_reduction_proxy_test_utils.h",
]

configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

public_deps = [ ":browser" ]
deps = [
"//base",
Expand Down Expand Up @@ -131,8 +129,6 @@ source_set("unit_tests") {
"data_usage_store_unittest.cc",
]

configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

deps = [
":browser",
":test_support",
Expand Down
2 changes: 0 additions & 2 deletions components/domain_reliability/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ source_set("unit_tests") {
"util_unittest.cc",
]

configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

deps = [
":domain_reliability",
"//base",
Expand Down
2 changes: 0 additions & 2 deletions components/history/core/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ static_library("browser") {
"android/visit_sql_handler.h",
]
}

configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
}

bundle_data("unit_tests_bundle_data") {
Expand Down
3 changes: 0 additions & 3 deletions components/keyed_service/content/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ component("content") {
"refcounted_browser_context_keyed_service_factory.h",
]

# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

defines = [ "KEYED_SERVICE_IMPLEMENTATION" ]

public_deps = [
Expand Down
2 changes: 0 additions & 2 deletions components/keyed_service/core/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ component("core") {
"simple_keyed_service_factory.h",
]

configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

defines = [ "KEYED_SERVICE_IMPLEMENTATION" ]

public_deps = [ "//base" ]
Expand Down
2 changes: 0 additions & 2 deletions components/ownership/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ if (is_chromeos_ash) {
testonly = true
sources = [ "owner_key_util_impl_unittest.cc" ]

configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

deps = [
":ownership",
"//base",
Expand Down
3 changes: 0 additions & 3 deletions components/password_manager/core/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,6 @@ static_library("browser") {
"password_store_signin_notifier_impl.h",
]
}

# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
}

# TODO(crbug.com/974822): Ideally, all of the "import/" subdirectory would be
Expand Down
2 changes: 0 additions & 2 deletions components/proxy_config/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ component("proxy_config") {
"proxy_prefs.h",
]

configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

defines = [ "PROXY_CONFIG_IMPLEMENTATION" ]

deps = [
Expand Down
2 changes: 0 additions & 2 deletions components/signin/core/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ static_library("browser") {
"signin_status_metrics_provider_delegate.h",
]

configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

public_deps = [
"//base",
"//components/content_settings/core/browser",
Expand Down
1 change: 0 additions & 1 deletion components/undo/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ source_set("unit_tests") {
"//components/bookmarks/test",
"//testing/gtest",
]
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
}
Loading

0 comments on commit 6552e4c

Please sign in to comment.