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

Unified Diff: net/http/http_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/ftp/ftp_server_type_histograms.cc ('k') | net/socket_stream/socket_stream_metrics.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction.cc
===================================================================
--- net/http/http_network_transaction.cc (revision 33932)
+++ net/http/http_network_transaction.cc (working copy)
@@ -996,18 +996,22 @@
100);
}
- static LinearHistogram tcp_socket_type_counter(
- "Net.TCPSocketType",
- 0, ClientSocketHandle::NUM_TYPES, ClientSocketHandle::NUM_TYPES + 1);
- tcp_socket_type_counter.SetFlags(kUmaTargetedHistogramFlag);
- tcp_socket_type_counter.Add(handle.reuse_type());
+ static scoped_refptr<Histogram> tcp_socket_type_counter =
+ LinearHistogram::LinearHistogramFactoryGet(
+ "Net.TCPSocketType",
+ 1, ClientSocketHandle::NUM_TYPES, ClientSocketHandle::NUM_TYPES + 1);
+ tcp_socket_type_counter->SetFlags(kUmaTargetedHistogramFlag);
+ tcp_socket_type_counter->Add(handle.reuse_type());
if (use_late_binding_histogram) {
- static LinearHistogram tcp_socket_type_counter2(
- FieldTrial::MakeName("Net.TCPSocketType", "SocketLateBinding").data(),
- 0, ClientSocketHandle::NUM_TYPES, ClientSocketHandle::NUM_TYPES + 1);
- tcp_socket_type_counter2.SetFlags(kUmaTargetedHistogramFlag);
- tcp_socket_type_counter2.Add(handle.reuse_type());
+ static scoped_refptr<Histogram> tcp_socket_type_counter2 =
+ LinearHistogram::LinearHistogramFactoryGet(
+ FieldTrial::MakeName("Net.TCPSocketType",
+ "SocketLateBinding").data(),
+ 1, ClientSocketHandle::NUM_TYPES,
+ ClientSocketHandle::NUM_TYPES + 1);
+ tcp_socket_type_counter2->SetFlags(kUmaTargetedHistogramFlag);
+ tcp_socket_type_counter2->Add(handle.reuse_type());
}
UMA_HISTOGRAM_CLIPPED_TIMES(
@@ -1065,19 +1069,22 @@
static const bool use_late_binding_histogram =
!FieldTrial::MakeName("", "SocketLateBinding").empty();
- static LinearHistogram io_error_socket_type_counter(
- "Net.IOError_SocketReuseType",
- 0, ClientSocketHandle::NUM_TYPES, ClientSocketHandle::NUM_TYPES + 1);
- io_error_socket_type_counter.SetFlags(kUmaTargetedHistogramFlag);
- io_error_socket_type_counter.Add(handle.reuse_type());
+ static scoped_refptr<Histogram> io_error_socket_type_counter =
+ LinearHistogram::LinearHistogramFactoryGet(
+ "Net.IOError_SocketReuseType",
+ 1, ClientSocketHandle::NUM_TYPES, ClientSocketHandle::NUM_TYPES + 1);
+ io_error_socket_type_counter->SetFlags(kUmaTargetedHistogramFlag);
+ io_error_socket_type_counter->Add(handle.reuse_type());
if (use_late_binding_histogram) {
- static LinearHistogram io_error_socket_type_counter(
- FieldTrial::MakeName("Net.IOError_SocketReuseType",
- "SocketLateBinding").data(),
- 0, ClientSocketHandle::NUM_TYPES, ClientSocketHandle::NUM_TYPES + 1);
- io_error_socket_type_counter.SetFlags(kUmaTargetedHistogramFlag);
- io_error_socket_type_counter.Add(handle.reuse_type());
+ static scoped_refptr<Histogram> io_error_socket_type_counter =
+ LinearHistogram::LinearHistogramFactoryGet(
+ FieldTrial::MakeName("Net.IOError_SocketReuseType",
+ "SocketLateBinding").data(),
+ 1, ClientSocketHandle::NUM_TYPES,
+ ClientSocketHandle::NUM_TYPES + 1);
+ io_error_socket_type_counter->SetFlags(kUmaTargetedHistogramFlag);
+ io_error_socket_type_counter->Add(handle.reuse_type());
}
switch (handle.reuse_type()) {
« no previous file with comments | « net/ftp/ftp_server_type_histograms.cc ('k') | net/socket_stream/socket_stream_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698