summaryrefslogtreecommitdiff
path: root/chromium/components/startup_metric_utils
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-05-17 17:24:03 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2022-06-22 07:51:41 +0000
commit774f54339e5db91f785733232d3950366db65d07 (patch)
tree068e1b47bd1af94d77094ed12b604a6b83d9c22a /chromium/components/startup_metric_utils
parentf7eaed5286974984ba5f9e3189d8f49d03e99f81 (diff)
downloadqtwebengine-chromium-774f54339e5db91f785733232d3950366db65d07.tar.gz
BASELINE: Update Chromium to 102.0.5005.57
Change-Id: I885f714bb40ee724c28f94ca6bd8dbdb39915158 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/startup_metric_utils')
-rw-r--r--chromium/components/startup_metric_utils/browser/startup_metric_utils.cc53
-rw-r--r--chromium/components/startup_metric_utils/browser/startup_metric_utils.h7
2 files changed, 4 insertions, 56 deletions
diff --git a/chromium/components/startup_metric_utils/browser/startup_metric_utils.cc b/chromium/components/startup_metric_utils/browser/startup_metric_utils.cc
index 9216c68651a..4f4c0f81e62 100644
--- a/chromium/components/startup_metric_utils/browser/startup_metric_utils.cc
+++ b/chromium/components/startup_metric_utils/browser/startup_metric_utils.cc
@@ -13,7 +13,6 @@
#include "base/check_op.h"
#include "base/containers/flat_set.h"
#include "base/dcheck_is_on.h"
-#include "base/memory/memory_pressure_listener.h"
#include "base/metrics/histogram.h"
#include "base/metrics/histogram_functions.h"
#include "base/no_destructor.h"
@@ -55,10 +54,6 @@ base::TimeTicks g_message_loop_start_ticks;
base::TimeTicks g_browser_window_display_ticks;
-base::MemoryPressureListener::MemoryPressureLevel
- g_max_pressure_level_before_first_non_empty_paint = base::
- MemoryPressureListener::MemoryPressureLevel::MEMORY_PRESSURE_LEVEL_NONE;
-
// An enumeration of startup temperatures. This must be kept in sync with the
// UMA StartupType enumeration defined in histograms.xml.
enum StartupTemperature {
@@ -260,40 +255,6 @@ void UmaHistogramWithTraceAndTemperature(
end_ticks);
}
-// Extension to the UmaHistogramWithTraceAndTemperature that records a
-// suffixed version of the histogram indicating the maximum pressure encountered
-// until now. Note that this is based on the
-// |g_max_pressure_level_before_first_non_empty_paint| value.
-void UmaHistogramAndTraceWithTemperatureAndMaxPressure(
- void (*histogram_function)(const std::string& name, base::TimeDelta),
- const char* histogram_basename,
- base::TimeTicks begin_ticks,
- base::TimeTicks end_ticks) {
- UmaHistogramWithTraceAndTemperature(histogram_function, histogram_basename,
- begin_ticks, end_ticks);
- const auto value = end_ticks - begin_ticks;
- switch (g_max_pressure_level_before_first_non_empty_paint) {
- case base::MemoryPressureListener::MemoryPressureLevel::
- MEMORY_PRESSURE_LEVEL_NONE:
- (*histogram_function)(
- base::StrCat({histogram_basename, ".NoMemoryPressure"}), value);
- break;
- case base::MemoryPressureListener::MemoryPressureLevel::
- MEMORY_PRESSURE_LEVEL_MODERATE:
- (*histogram_function)(
- base::StrCat({histogram_basename, ".ModerateMemoryPressure"}), value);
- break;
- case base::MemoryPressureListener::MemoryPressureLevel::
- MEMORY_PRESSURE_LEVEL_CRITICAL:
- (*histogram_function)(
- base::StrCat({histogram_basename, ".CriticalMemoryPressure"}), value);
- break;
- default:
- NOTREACHED();
- break;
- }
-}
-
// On Windows, records the number of hard-faults that have occurred in the
// current chrome.exe process since it was started. This is a nop on other
// platforms.
@@ -544,10 +505,10 @@ void RecordFirstWebContentsNonEmptyPaint(
if (!ShouldLogStartupHistogram())
return;
- UmaHistogramAndTraceWithTemperatureAndMaxPressure(
- &base::UmaHistogramLongTimes100,
- "Startup.FirstWebContents.NonEmptyPaint3", g_application_start_ticks,
- now);
+ UmaHistogramWithTraceAndTemperature(&base::UmaHistogramLongTimes100,
+ "Startup.FirstWebContents.NonEmptyPaint3",
+ g_application_start_ticks, now);
+
UmaHistogramWithTemperature(
&base::UmaHistogramLongTimes100,
"Startup.BrowserMessageLoopStart.To.NonEmptyPaint2",
@@ -620,10 +581,4 @@ void RecordExternalStartupMetric(const char* histogram_name,
SetNonBrowserUIDisplayed();
}
-void OnMemoryPressureBeforeFirstNonEmptyPaint(
- base::MemoryPressureListener::MemoryPressureLevel level) {
- if (level > g_max_pressure_level_before_first_non_empty_paint)
- g_max_pressure_level_before_first_non_empty_paint = level;
-}
-
} // namespace startup_metric_utils
diff --git a/chromium/components/startup_metric_utils/browser/startup_metric_utils.h b/chromium/components/startup_metric_utils/browser/startup_metric_utils.h
index 7e26f9a99c6..23d3f94b15b 100644
--- a/chromium/components/startup_metric_utils/browser/startup_metric_utils.h
+++ b/chromium/components/startup_metric_utils/browser/startup_metric_utils.h
@@ -5,7 +5,6 @@
#ifndef COMPONENTS_STARTUP_METRIC_UTILS_BROWSER_STARTUP_METRIC_UTILS_H_
#define COMPONENTS_STARTUP_METRIC_UTILS_BROWSER_STARTUP_METRIC_UTILS_H_
-#include "base/memory/memory_pressure_listener.h"
#include "base/time/time.h"
// Utility functions to support metric collection for browser startup. Timings
@@ -109,12 +108,6 @@ void RecordExternalStartupMetric(const char* histogram_name,
base::TimeTicks completion_ticks,
bool set_non_browser_ui_displayed);
-// Records memory pressure events occurring before the first web contents had a
-// non-empty paint.
-// This should only be called from the browser UI thread.
-void OnMemoryPressureBeforeFirstNonEmptyPaint(
- base::MemoryPressureListener::MemoryPressureLevel level);
-
} // namespace startup_metric_utils
#endif // COMPONENTS_STARTUP_METRIC_UTILS_BROWSER_STARTUP_METRIC_UTILS_H_