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

Unified Diff: net/base/connection_type_histograms.cc

Issue 515033: Cleanup histogram classes mixing SetFlags into FactoryGet arguments... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years 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 | « chrome/renderer/render_thread.cc ('k') | net/base/mime_sniffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/connection_type_histograms.cc
===================================================================
--- net/base/connection_type_histograms.cc (revision 35277)
+++ net/base/connection_type_histograms.cc (working copy)
@@ -22,30 +22,20 @@
// expansion.
void UpdateConnectionTypeHistograms(ConnectionType type, bool success) {
static bool had_connection_type[NUM_OF_CONNECTION_TYPES];
- static scoped_refptr<Histogram> had_histogram =
- LinearHistogram::LinearHistogramFactoryGet("Net.HadConnectionType2",
- 1, NUM_OF_CONNECTION_TYPES,
- NUM_OF_CONNECTION_TYPES + 1);
- static scoped_refptr<Histogram> success_histogram =
- LinearHistogram::LinearHistogramFactoryGet("Net.ConnectionTypeCount2",
- 1, NUM_OF_CONNECTION_TYPES,
- NUM_OF_CONNECTION_TYPES + 1);
- static scoped_refptr<Histogram> failed_histogram =
- LinearHistogram::LinearHistogramFactoryGet("Net.ConnectionTypeFailCount2",
- 1, NUM_OF_CONNECTION_TYPES,
- NUM_OF_CONNECTION_TYPES + 1);
if (type >= 0 && type < NUM_OF_CONNECTION_TYPES) {
if (!had_connection_type[type]) {
had_connection_type[type] = true;
- had_histogram->SetFlags(kUmaTargetedHistogramFlag);
- had_histogram->Add(type);
+ UMA_HISTOGRAM_ENUMERATION("Net.HadConnectionType2",
+ type, NUM_OF_CONNECTION_TYPES);
}
- Histogram* histogram;
- histogram = success ? success_histogram.get() : failed_histogram.get();
- histogram->SetFlags(kUmaTargetedHistogramFlag);
- histogram->Add(type);
+ if (success)
+ UMA_HISTOGRAM_ENUMERATION("Net.ConnectionTypeCount2",
+ type, NUM_OF_CONNECTION_TYPES);
+ else
+ UMA_HISTOGRAM_ENUMERATION("Net.ConnectionTypeFailCount2",
+ type, NUM_OF_CONNECTION_TYPES);
} else {
NOTREACHED(); // Someone's logging an invalid type!
}
« no previous file with comments | « chrome/renderer/render_thread.cc ('k') | net/base/mime_sniffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698