| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef BLIMP_HELIUM_RESULT_H_ | 5 #ifndef BLIMP_HELIUM_RESULT_H_ |
| 6 #define BLIMP_HELIUM_RESULT_H_ | 6 #define BLIMP_HELIUM_RESULT_H_ |
| 7 | 7 |
| 8 #include "blimp/helium/blimp_helium_export.h" | 8 #include "blimp/helium/blimp_helium_export.h" |
| 9 | 9 |
| 10 namespace blimp { | 10 namespace blimp { |
| 11 namespace helium { | 11 namespace helium { |
| 12 | 12 |
| 13 // Defines the canonical list of Helium result codes. | 13 // Defines the canonical list of Helium result codes. |
| 14 // Result::OK is the only non-error code. | 14 // Result::SUCCESS is the only non-error code. |
| 15 // All other codes are considered errors and are prefixed by ERR_. | 15 // All other codes are considered errors and are prefixed by ERR_. |
| 16 // See error_list.h for the unprefixed list of error codes. | 16 // See error_list.h for the unprefixed list of error codes. |
| 17 // | 17 // |
| 18 // (Approach is inspired by net/base/net_errors.h) | 18 // (Approach is inspired by net/base/net_errors.h) |
| 19 enum Result { | 19 enum Result { |
| 20 SUCCESS, | 20 SUCCESS, |
| 21 #define HELIUM_ERROR(label, value) ERR_##label = value, | 21 #define HELIUM_ERROR(label, value) ERR_##label = value, |
| 22 #include "blimp/helium/errors.h" | 22 #include "blimp/helium/errors.h" |
| 23 #undef HELIUM_ERROR | 23 #undef HELIUM_ERROR |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 // Gets a human-readable string representation of |result|. | 26 // Gets a human-readable string representation of |result|. |
| 27 BLIMP_HELIUM_EXPORT const char* ResultToString(Result result); | 27 BLIMP_HELIUM_EXPORT const char* ResultToString(Result result); |
| 28 | 28 |
| 29 } // namespace helium | 29 } // namespace helium |
| 30 } // namespace blimp | 30 } // namespace blimp |
| 31 | 31 |
| 32 #endif // BLIMP_HELIUM_RESULT_H_ | 32 #endif // BLIMP_HELIUM_RESULT_H_ |
| OLD | NEW |