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

Unified Diff: net/base/net_errors.cc

Issue 6975027: Add metrics for DHCP WPAD feature. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments. Created 9 years, 7 months 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/base/net_errors.h ('k') | net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_errors.cc
diff --git a/net/base/net_errors.cc b/net/base/net_errors.cc
index 6c0e09c7f13dd06b5bc63cfd674f28bd95368523..2df61f9c639e0259d9734736f7388894a096de2a 100644
--- a/net/base/net_errors.cc
+++ b/net/base/net_errors.cc
@@ -5,8 +5,21 @@
#include "net/base/net_errors.h"
#include "base/basictypes.h"
+#include "base/metrics/histogram.h"
#include "base/stringize_macros.h"
+namespace {
+
+// Get all valid error codes into an array as positive numbers, for use in the
+// |GetAllErrorCodesForUma| function below.
+#define NET_ERROR(label, value) -(value),
+const int kAllErrorCodes[] = {
+#include "net/base/net_error_list.h"
+};
+#undef NET_ERROR
+
+} // namespace
+
namespace net {
const char kErrorDomain[] = "net";
@@ -26,4 +39,9 @@ const char* ErrorToString(int error) {
}
}
+std::vector<int> GetAllErrorCodesForUma() {
+ return base::CustomHistogram::ArrayToCustomRanges(
+ kAllErrorCodes, arraysize(kAllErrorCodes));
+}
+
} // namespace net
« no previous file with comments | « net/base/net_errors.h ('k') | net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698