Index: blimp/net/helium/helium_result.h |
diff --git a/blimp/net/helium/helium_result.h b/blimp/net/helium/helium_result.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..41c93e3a90c7be39e0ad9b07327733a34c26bec1 |
--- /dev/null |
+++ b/blimp/net/helium/helium_result.h |
@@ -0,0 +1,30 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef BLIMP_NET_HELIUM_HELIUM_RESULT_H_ |
+#define BLIMP_NET_HELIUM_HELIUM_RESULT_H_ |
+ |
+#include "blimp/net/blimp_net_export.h" |
+ |
+namespace blimp { |
+ |
+// Defines the canonical list of Helium result codes. |
+// HeliumResult::OK is the only non-error code. |
+// All other codes are considered errors and are prefixed by ERR_. |
+// See error_list.h for the unprefixed list of error codes. |
+// |
+// (Approach is inspired by net/base/net_errors.h) |
+enum HeliumResult { |
+ 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
|
+#define HELIUM_ERROR(label, value) ERR_## label = value, |
+#include "blimp/net/helium/helium_errors.h" |
scf
2016/10/03 17:57:45
this is really neat
|
+#undef HELIUM_ERROR |
+}; |
+ |
+// Gets a human-readable string representation of |result|. |
+const char* BLIMP_NET_EXPORT HeliumResultToString(HeliumResult result); |
+ |
+} // namespace blimp |
+ |
+#endif // BLIMP_NET_HELIUM_HELIUM_RESULT_H_ |