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

Unified Diff: blimp/net/helium/helium_result.h

Issue 2385913002: Define canonical enum for "HeliumResult" status values. (Closed)
Patch Set: the android compiler is dumb Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
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..8f9f72296a8a0435d06c9df100f6b809b042ab63
--- /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 {
+ SUCCESS,
+#define HELIUM_ERROR(label, value) ERR_##label = value,
+#include "blimp/net/helium/helium_errors.h"
+#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_

Powered by Google App Engine
This is Rietveld 408576698