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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/base/net_errors.h" 5 #include "net/base/net_errors.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/metrics/histogram.h"
8 #include "base/stringize_macros.h" 9 #include "base/stringize_macros.h"
9 10
11 namespace {
12
13 // Get all valid error codes into an array as positive numbers, for use in the
14 // |GetAllErrorCodesForUma| function below.
15 #define NET_ERROR(label, value) -(value),
16 const int kAllErrorCodes[] = {
17 #include "net/base/net_error_list.h"
18 };
19 #undef NET_ERROR
20
21 } // namespace
22
10 namespace net { 23 namespace net {
11 24
12 const char kErrorDomain[] = "net"; 25 const char kErrorDomain[] = "net";
13 26
14 const char* ErrorToString(int error) { 27 const char* ErrorToString(int error) {
15 if (error == 0) 28 if (error == 0)
16 return "net::OK"; 29 return "net::OK";
17 30
18 switch (error) { 31 switch (error) {
19 #define NET_ERROR(label, value) \ 32 #define NET_ERROR(label, value) \
20 case ERR_ ## label: \ 33 case ERR_ ## label: \
21 return "net::" STRINGIZE_NO_EXPANSION(ERR_ ## label); 34 return "net::" STRINGIZE_NO_EXPANSION(ERR_ ## label);
22 #include "net/base/net_error_list.h" 35 #include "net/base/net_error_list.h"
23 #undef NET_ERROR 36 #undef NET_ERROR
24 default: 37 default:
25 return "net::<unknown>"; 38 return "net::<unknown>";
26 } 39 }
27 } 40 }
28 41
42 std::vector<int> GetAllErrorCodesForUma() {
43 return base::CustomHistogram::ArrayToCustomRanges(
44 kAllErrorCodes, arraysize(kAllErrorCodes));
45 }
46
29 } // namespace net 47 } // namespace net
OLDNEW
« 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