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 8626bf40ee96244283fd69842927e3da6db1af9e..8efb2c878c499f6e52390e9a45ca049e2420b427 100644 |
--- a/chrome/browser/metrics/first_web_contents_profiler.cc |
+++ b/chrome/browser/metrics/first_web_contents_profiler.cc |
@@ -170,9 +170,15 @@ void FirstWebContentsProfiler::FinishedCollectingMetrics( |
} |
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()) |
+ if (IsFinishedCollectingMetrics() || |
+ finish_reason == FinishReason::ABANDON_CONTENT_DESTROYED || |
+ finish_reason == FinishReason::ABANDON_BLOCKING_UI) { |
delegate_->ProfilerFinishedCollectingMetrics(); |
+ } |
} |
#endif // !defined(OS_ANDROID) |