diff options
Diffstat (limited to 'net/base')
-rw-r--r-- | net/base/connection_type_histograms.cc | 26 | ||||
-rw-r--r-- | net/base/mime_sniffer.cc | 5 | ||||
-rw-r--r-- | net/base/sdch_manager.cc | 6 |
3 files changed, 11 insertions, 26 deletions
diff --git a/net/base/connection_type_histograms.cc b/net/base/connection_type_histograms.cc index 81affa5..7326a92 100644 --- a/net/base/connection_type_histograms.cc +++ b/net/base/connection_type_histograms.cc @@ -22,30 +22,20 @@ namespace net { // 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! } diff --git a/net/base/mime_sniffer.cc b/net/base/mime_sniffer.cc index df0f171..8e063cb 100644 --- a/net/base/mime_sniffer.cc +++ b/net/base/mime_sniffer.cc @@ -213,9 +213,8 @@ static const MagicNumber kSniffableTags[] = { static scoped_refptr<Histogram> UMASnifferHistogramGet(const char* name, int array_size) { scoped_refptr<Histogram> counter = - LinearHistogram::LinearHistogramFactoryGet( - name, 1, array_size - 1, array_size); - counter->SetFlags(kUmaTargetedHistogramFlag); + LinearHistogram::FactoryGet(name, 1, array_size - 1, array_size, + Histogram::kUmaTargetedHistogramFlag); return counter; } diff --git a/net/base/sdch_manager.cc b/net/base/sdch_manager.cc index 126a1b6..b279749 100644 --- a/net/base/sdch_manager.cc +++ b/net/base/sdch_manager.cc @@ -32,11 +32,7 @@ SdchManager* SdchManager::Global() { // static void SdchManager::SdchErrorRecovery(ProblemCodes problem) { - static scoped_refptr<Histogram> histogram = - LinearHistogram::LinearHistogramFactoryGet("Sdch3.ProblemCodes_4", - MIN_PROBLEM_CODE + 1, MAX_PROBLEM_CODE - 1, MAX_PROBLEM_CODE); - histogram->SetFlags(kUmaTargetedHistogramFlag); - histogram->Add(problem); + UMA_HISTOGRAM_ENUMERATION("Sdch3.ProblemCodes_4", problem, MAX_PROBLEM_CODE); } // static |