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

Side by Side Diff: chrome/browser/metrics/first_web_contents_profiler.cc

Issue 1449933002: Fix leak in FirstWebContentsProfiler introduced by special recording for deprecated v1 startup stat… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if !defined(OS_ANDROID) 5 #if !defined(OS_ANDROID)
6 6
7 #include "chrome/browser/metrics/first_web_contents_profiler.h" 7 #include "chrome/browser/metrics/first_web_contents_profiler.h"
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 if (!collected_paint_metric_) { 163 if (!collected_paint_metric_) {
164 UMA_HISTOGRAM_ENUMERATION("Startup.FirstWebContents.FinishReason_NoPaint", 164 UMA_HISTOGRAM_ENUMERATION("Startup.FirstWebContents.FinishReason_NoPaint",
165 finish_reason, FinishReason::ENUM_MAX); 165 finish_reason, FinishReason::ENUM_MAX);
166 } 166 }
167 if (!collected_load_metric_) { 167 if (!collected_load_metric_) {
168 UMA_HISTOGRAM_ENUMERATION("Startup.FirstWebContents.FinishReason_NoLoad", 168 UMA_HISTOGRAM_ENUMERATION("Startup.FirstWebContents.FinishReason_NoLoad",
169 finish_reason, FinishReason::ENUM_MAX); 169 finish_reason, FinishReason::ENUM_MAX);
170 } 170 }
171 finished_ = true; 171 finished_ = true;
172 } 172 }
173
174 // Continue recording deprecated v1 stats (see |finished_|) except in
175 // scenarios where stats collection was already being abandonned previously.
173 // TODO(gab): Delete right away when getting rid of |finished_|. 176 // TODO(gab): Delete right away when getting rid of |finished_|.
174 if (IsFinishedCollectingMetrics()) 177 if (IsFinishedCollectingMetrics() ||
178 finish_reason == FinishReason::ABANDON_CONTENT_DESTROYED ||
179 finish_reason == FinishReason::ABANDON_BLOCKING_UI) {
175 delegate_->ProfilerFinishedCollectingMetrics(); 180 delegate_->ProfilerFinishedCollectingMetrics();
181 }
176 } 182 }
177 183
178 #endif // !defined(OS_ANDROID) 184 #endif // !defined(OS_ANDROID)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698