OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef BLIMP_NET_HELIUM_HELIUM_RESULT_H_ | |
6 #define BLIMP_NET_HELIUM_HELIUM_RESULT_H_ | |
7 | |
8 #include "blimp/net/blimp_net_export.h" | |
9 | |
10 namespace blimp { | |
11 | |
12 // Defines the canonical list of Helium result codes. | |
13 // HeliumResult::OK is the only non-error code. | |
14 // All other codes are considered errors and are prefixed by ERR_. | |
15 // See error_list.h for the unprefixed list of error codes. | |
16 // | |
17 // (Approach is inspired by net/base/net_errors.h) | |
18 enum HeliumResult { | |
19 OK, | |
Garrett Casto
2016/10/03 18:40:47
Any particular reason why OK is special cased?
Kevin M
2016/10/03 22:32:19
The enum name generation step adds an ERR prefix w
| |
20 #define HELIUM_ERROR(label, value) ERR_## label = value, | |
21 #include "blimp/net/helium/helium_errors.h" | |
scf
2016/10/03 17:57:45
this is really neat
| |
22 #undef HELIUM_ERROR | |
23 }; | |
24 | |
25 // Gets a human-readable string representation of |result|. | |
26 const char* BLIMP_NET_EXPORT HeliumResultToString(HeliumResult result); | |
27 | |
28 } // namespace blimp | |
29 | |
30 #endif // BLIMP_NET_HELIUM_HELIUM_RESULT_H_ | |
OLD | NEW |