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

Unified Diff: net/socket_stream/socket_stream_metrics.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/http/http_network_transaction.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket_stream/socket_stream_metrics.cc
===================================================================
--- net/socket_stream/socket_stream_metrics.cc (revision 33932)
+++ net/socket_stream/socket_stream_metrics.cc (working copy)
@@ -83,19 +83,21 @@
}
void SocketStreamMetrics::CountProtocolType(ProtocolType protocol_type) {
- static LinearHistogram counter("Net.SocketStream.ProtocolType",
- 0, NUM_PROTOCOL_TYPES,
- NUM_PROTOCOL_TYPES + 1);
- counter.SetFlags(kUmaTargetedHistogramFlag);
- counter.Add(protocol_type);
+ static scoped_refptr<Histogram> counter =
+ LinearHistogram::LinearHistogramFactoryGet(
+ "Net.SocketStream.ProtocolType",
+ 0, NUM_PROTOCOL_TYPES, NUM_PROTOCOL_TYPES + 1);
+ counter->SetFlags(kUmaTargetedHistogramFlag);
+ counter->Add(protocol_type);
}
void SocketStreamMetrics::CountConnectionType(ConnectionType connection_type) {
- static LinearHistogram counter("Net.SocketStream.ConnectionType",
- 1, NUM_CONNECTION_TYPES,
- NUM_CONNECTION_TYPES + 1);
- counter.SetFlags(kUmaTargetedHistogramFlag);
- counter.Add(connection_type);
+ static scoped_refptr<Histogram> counter =
+ LinearHistogram::LinearHistogramFactoryGet(
+ "Net.SocketStream.ConnectionType",
+ 1, NUM_CONNECTION_TYPES, NUM_CONNECTION_TYPES + 1);
+ counter->SetFlags(kUmaTargetedHistogramFlag);
+ counter->Add(connection_type);
}
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698