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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "net/ftp/ftp_network_transaction.h" 5 #include "net/ftp/ftp_network_transaction.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/histogram.h" 8 #include "base/histogram.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "net/base/connection_type_histograms.h" 10 #include "net/base/connection_type_histograms.h"
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 type = NET_ERROR_CONNECTION_BROKEN; 1155 type = NET_ERROR_CONNECTION_BROKEN;
1156 break; 1156 break;
1157 case ERR_CONNECTION_REFUSED: 1157 case ERR_CONNECTION_REFUSED:
1158 type = NET_ERROR_CONNECTION_REFUSED; 1158 type = NET_ERROR_CONNECTION_REFUSED;
1159 break; 1159 break;
1160 default: 1160 default:
1161 type = NET_ERROR_OTHER; 1161 type = NET_ERROR_OTHER;
1162 break; 1162 break;
1163 }; 1163 };
1164 static bool had_error_type[NUM_OF_NET_ERROR_TYPES]; 1164 static bool had_error_type[NUM_OF_NET_ERROR_TYPES];
1165 static LinearHistogram error_flagged("Net.FtpDataConnectionErrorHappened", 1165 static scoped_refptr<Histogram> error_flagged =
1166 1, NUM_OF_NET_ERROR_TYPES, 1166 LinearHistogram::LinearHistogramFactoryGet(
1167 NUM_OF_NET_ERROR_TYPES + 1); 1167 "Net.FtpDataConnectionErrorHappened",
1168 static LinearHistogram error_counter("Net.FtpDataConnectionErrorCount", 1168 1, NUM_OF_NET_ERROR_TYPES, NUM_OF_NET_ERROR_TYPES + 1);
1169 1, NUM_OF_NET_ERROR_TYPES, 1169 static scoped_refptr<Histogram> error_counter =
1170 NUM_OF_NET_ERROR_TYPES + 1); 1170 LinearHistogram::LinearHistogramFactoryGet(
1171 "Net.FtpDataConnectionErrorCount",
1172 1, NUM_OF_NET_ERROR_TYPES, NUM_OF_NET_ERROR_TYPES + 1);
1171 1173
1172 DCHECK(type >= 0 && type < NUM_OF_NET_ERROR_TYPES); 1174 DCHECK(type >= 0 && type < NUM_OF_NET_ERROR_TYPES);
1173 if (!had_error_type[type]) { 1175 if (!had_error_type[type]) {
1174 had_error_type[type] = true; 1176 had_error_type[type] = true;
1175 error_flagged.SetFlags(kUmaTargetedHistogramFlag); 1177 error_flagged->SetFlags(kUmaTargetedHistogramFlag);
1176 error_flagged.Add(type); 1178 error_flagged->Add(type);
1177 } 1179 }
1178 error_counter.SetFlags(kUmaTargetedHistogramFlag); 1180 error_counter->SetFlags(kUmaTargetedHistogramFlag);
1179 error_counter.Add(type); 1181 error_counter->Add(type);
1180 } 1182 }
1181 1183
1182 } // namespace net 1184 } // namespace net
OLDNEW
« 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