Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2490)

Unified Diff: chrome/browser/metrics/first_web_contents_profiler.cc

Issue 1450913003: Remove v1 of Startup.FirstWebContents.* stats deprecated in M48. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@e2_better_ownership_model_firstwebcontentsprofiler
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/startup_metric_utils/browser/startup_metric_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/first_web_contents_profiler.cc
diff --git a/chrome/browser/metrics/first_web_contents_profiler.cc b/chrome/browser/metrics/first_web_contents_profiler.cc
index 72d47f98384877cce0de6ddbf17aee806f8f20f4..038bbf0ae1716925d792ee5b6971c91015ce49e1 100644
--- a/chrome/browser/metrics/first_web_contents_profiler.cc
+++ b/chrome/browser/metrics/first_web_contents_profiler.cc
@@ -41,8 +41,7 @@ FirstWebContentsProfiler::FirstWebContentsProfiler(
collected_paint_metric_(false),
collected_load_metric_(false),
collected_main_navigation_start_metric_(false),
- collected_main_navigation_finished_metric_(false),
- finished_(false) {}
+ collected_main_navigation_finished_metric_(false) {}
void FirstWebContentsProfiler::DidFirstVisuallyNonEmptyPaint() {
if (collected_paint_metric_)
@@ -53,11 +52,8 @@ void FirstWebContentsProfiler::DidFirstVisuallyNonEmptyPaint() {
}
collected_paint_metric_ = true;
- const base::TimeTicks now = base::TimeTicks::Now();
- // Record the old metric unconditionally.
- startup_metric_utils::RecordDeprecatedFirstWebContentsNonEmptyPaint(now);
- if (!finished_)
- startup_metric_utils::RecordFirstWebContentsNonEmptyPaint(now);
+ startup_metric_utils::RecordFirstWebContentsNonEmptyPaint(
+ base::TimeTicks::Now());
metrics::TrackingSynchronizer::OnProfilingPhaseCompleted(
metrics::ProfilerEventProto::EVENT_FIRST_NONEMPTY_PAINT);
@@ -75,11 +71,8 @@ void FirstWebContentsProfiler::DocumentOnLoadCompletedInMainFrame() {
}
collected_load_metric_ = true;
- const base::TimeTicks now = base::TimeTicks::Now();
- // Record the old metric unconditionally.
- startup_metric_utils::RecordDeprecatedFirstWebContentsMainFrameLoad(now);
- if (!finished_)
- startup_metric_utils::RecordFirstWebContentsMainFrameLoad(now);
+ startup_metric_utils::RecordFirstWebContentsMainFrameLoad(
+ base::TimeTicks::Now());
if (IsFinishedCollectingMetrics())
FinishedCollectingMetrics(FinishReason::DONE);
@@ -154,28 +147,18 @@ bool FirstWebContentsProfiler::IsFinishedCollectingMetrics() {
void FirstWebContentsProfiler::FinishedCollectingMetrics(
FinishReason finish_reason) {
- if (!finished_) {
- UMA_HISTOGRAM_ENUMERATION("Startup.FirstWebContents.FinishReason",
+ UMA_HISTOGRAM_ENUMERATION("Startup.FirstWebContents.FinishReason",
+ finish_reason, FinishReason::ENUM_MAX);
+ if (!collected_paint_metric_) {
+ UMA_HISTOGRAM_ENUMERATION("Startup.FirstWebContents.FinishReason_NoPaint",
finish_reason, FinishReason::ENUM_MAX);
- if (!collected_paint_metric_) {
- UMA_HISTOGRAM_ENUMERATION("Startup.FirstWebContents.FinishReason_NoPaint",
- finish_reason, FinishReason::ENUM_MAX);
- }
- if (!collected_load_metric_) {
- UMA_HISTOGRAM_ENUMERATION("Startup.FirstWebContents.FinishReason_NoLoad",
- finish_reason, FinishReason::ENUM_MAX);
- }
- finished_ = true;
}
-
- // Continue recording deprecated v1 stats (see |finished_|) except in
- // scenarios where stats collection was already being abandonned previously.
- // TODO(gab): Delete right away when getting rid of |finished_|.
- if (IsFinishedCollectingMetrics() ||
- finish_reason == FinishReason::ABANDON_CONTENT_DESTROYED ||
- finish_reason == FinishReason::ABANDON_BLOCKING_UI) {
- delete this;
+ if (!collected_load_metric_) {
+ UMA_HISTOGRAM_ENUMERATION("Startup.FirstWebContents.FinishReason_NoLoad",
+ finish_reason, FinishReason::ENUM_MAX);
}
+
+ delete this;
}
#endif // !defined(OS_ANDROID)
« no previous file with comments | « no previous file | components/startup_metric_utils/browser/startup_metric_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698