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

Unified Diff: net/ftp/ftp_network_transaction.cc

Issue 462027: Use factory to create histograms, and refcounts to track lifetimes... (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 | « net/disk_cache/stats_histogram.cc ('k') | net/ftp/ftp_server_type_histograms.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_network_transaction.cc
===================================================================
--- net/ftp/ftp_network_transaction.cc (revision 33932)
+++ net/ftp/ftp_network_transaction.cc (working copy)
@@ -1162,21 +1162,23 @@
break;
};
static bool had_error_type[NUM_OF_NET_ERROR_TYPES];
- static LinearHistogram error_flagged("Net.FtpDataConnectionErrorHappened",
- 1, NUM_OF_NET_ERROR_TYPES,
- NUM_OF_NET_ERROR_TYPES + 1);
- static LinearHistogram error_counter("Net.FtpDataConnectionErrorCount",
- 1, NUM_OF_NET_ERROR_TYPES,
- NUM_OF_NET_ERROR_TYPES + 1);
+ static scoped_refptr<Histogram> error_flagged =
+ LinearHistogram::LinearHistogramFactoryGet(
+ "Net.FtpDataConnectionErrorHappened",
+ 1, NUM_OF_NET_ERROR_TYPES, NUM_OF_NET_ERROR_TYPES + 1);
+ static scoped_refptr<Histogram> error_counter =
+ LinearHistogram::LinearHistogramFactoryGet(
+ "Net.FtpDataConnectionErrorCount",
+ 1, NUM_OF_NET_ERROR_TYPES, NUM_OF_NET_ERROR_TYPES + 1);
DCHECK(type >= 0 && type < NUM_OF_NET_ERROR_TYPES);
if (!had_error_type[type]) {
had_error_type[type] = true;
- error_flagged.SetFlags(kUmaTargetedHistogramFlag);
- error_flagged.Add(type);
+ error_flagged->SetFlags(kUmaTargetedHistogramFlag);
+ error_flagged->Add(type);
}
- error_counter.SetFlags(kUmaTargetedHistogramFlag);
- error_counter.Add(type);
+ error_counter->SetFlags(kUmaTargetedHistogramFlag);
+ error_counter->Add(type);
}
} // namespace net
« no previous file with comments | « net/disk_cache/stats_histogram.cc ('k') | net/ftp/ftp_server_type_histograms.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698