OLD | NEW |
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/stringize_macros.h" | 8 #include "base/stringize_macros.h" |
9 | 9 |
10 namespace net { | 10 namespace net { |
11 | 11 |
12 const char kErrorDomain[] = "net"; | 12 const char kErrorDomain[] = "net"; |
13 | 13 |
14 const char* ErrorToString(int error) { | 14 const char* ErrorToString(int error) { |
15 if (error == 0) | 15 if (error == 0) |
16 return "net::OK"; | 16 return "net::OK"; |
17 | 17 |
18 switch (error) { | 18 switch (error) { |
19 #define NET_ERROR(label, value) \ | 19 #define NET_ERROR(label, value) \ |
20 case ERR_ ## label: \ | 20 case ERR_ ## label: \ |
21 return "net::" STRINGIZE_NO_EXPANSION(ERR_ ## label); | 21 return "net::" STRINGIZE_NO_EXPANSION(ERR_ ## label); |
22 #include "net/base/net_error_list.h" | 22 #include "net/base/net_error_list.h" |
23 #undef NET_ERROR | 23 #undef NET_ERROR |
24 default: | 24 default: |
25 return "net::<unknown>"; | 25 return "net::<unknown>"; |
26 } | 26 } |
27 } | 27 } |
28 | 28 |
| 29 std::vector<int> GetAllErrorCodesForUma() { |
| 30 std::vector<int> all_error_codes; |
| 31 #define NET_ERROR(label, value) all_error_codes.push_back(-(value)); |
| 32 #include "net/base/net_error_list.h" |
| 33 #undef NET_ERROR |
| 34 return all_error_codes; |
| 35 } |
| 36 |
29 } // namespace net | 37 } // namespace net |
OLD | NEW |