Commit 3e4387c0 authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

[jumbo] Give two kNodeNumberLimit constants unique names

In jumbo builds many cc files compile together in the same
translation unit, and thus share the same anonymous namespace.
That means that constants need to have unique names in the
whole build target, and not just unique in the file.

This renames two constants, one that was just added/copied and
one that already existed to give them more descriptive, and
unique, names.

TBR=maxlg@chromium.org,skobes@chromium.org

Bug: 893068
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I45ec9852370fb5572fd53e21136a21f1dd14e220
Reviewed-on: https://chromium-review.googlesource.com/c/1275891Reviewed-by: default avatarDaniel Bratell <bratell@opera.com>
Reviewed-by: default avatarSteve Kobes <skobes@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#598730}
parent 07f45e13
......@@ -20,7 +20,7 @@ namespace blink {
// Set a big enough limit for the number of nodes to ensure memory usage is
// capped. Exceeding such limit will deactivate the algorithm.
constexpr size_t kNodeNumberLimit = 5000;
constexpr size_t kImageNodeNumberLimit = 5000;
static bool LargeImageOnTop(const base::WeakPtr<ImageRecord>& a,
const base::WeakPtr<ImageRecord>& b) {
......@@ -197,7 +197,7 @@ void ImagePaintTimingDetector::RecordImage(const LayoutObject& object,
const LayoutImage* image = ToLayoutImage(&object);
if (!id_record_map_.Contains(node_id)) {
recorded_node_count_++;
if (recorded_node_count_ < kNodeNumberLimit) {
if (recorded_node_count_ < kImageNodeNumberLimit) {
LayoutRect invalidated_rect = image->FirstFragment().VisualRect();
// Do not record first size until invalidated_rect's size becomes
// non-empty.
......@@ -226,7 +226,7 @@ void ImagePaintTimingDetector::RecordImage(const LayoutObject& object,
latest_image_heap_.push(record->AsWeakPtr());
id_record_map_.insert(node_id, std::move(record));
} else {
// for assessing whether kNodeNumberLimit is large enough for all
// for assessing whether kImageNodeNumberLimit is large enough for all
// normal cases
TRACE_EVENT_INSTANT1("loading", "ImagePaintTimingDetector::OverNodeLimit",
TRACE_EVENT_SCOPE_THREAD, "recorded_node_count",
......
......@@ -20,7 +20,7 @@ namespace blink {
// Calculate metrics candidate every 1 second after the first text pre-paint.
static constexpr TimeDelta kTimerDelay = TimeDelta::FromSeconds(1);
constexpr size_t kNodeNumberLimit = 5000;
constexpr size_t kTextNodeNumberLimit = 5000;
static bool LargeTextOnTop(const std::unique_ptr<TextRecord>& a,
const std::unique_ptr<TextRecord>& b) {
......@@ -164,8 +164,8 @@ void TextPaintTimingDetector::RecordText(const LayoutObject& object,
// We deactivate the algorithm if the number of nodes exceeds limitation.
recorded_node_count_++;
if (recorded_node_count_ > kNodeNumberLimit) {
// for assessing whether kNodeNumberLimit is large enough for all
if (recorded_node_count_ > kTextNodeNumberLimit) {
// for assessing whether kTextNodeNumberLimit is large enough for all
// normal cases
TRACE_EVENT_INSTANT1("loading", "TextPaintTimingDetector::OverNodeLimit",
TRACE_EVENT_SCOPE_THREAD, "recorded_node_count",
......
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