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

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

Issue 2385913002: Define canonical enum for "HeliumResult" status values. (Closed)
Patch Set: Created 4 years, 3 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.cc
diff --git a/blimp/net/helium/helium_result.cc b/blimp/net/helium/helium_result.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4e8be4873cf51677d76f604e8c3141e949571d02
--- /dev/null
+++ b/blimp/net/helium/helium_result.cc
@@ -0,0 +1,24 @@
+// 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.
+
+#include "blimp/net/helium/helium_result.h"
+
+namespace blimp {
+
+const char* HeliumResultToString(HeliumResult result) {
+ switch (result) {
+ case HeliumResult::OK:
+ return "OK";
+ break;
+#define HELIUM_ERROR(label, value) \
+ case HeliumResult::ERR_##label: \
+ return "ERR_" #label;
+ break;
+#include "blimp/net/helium/helium_errors.h"
CJ 2016/10/03 20:47:33 Just for my own knowledge, why does the include co
Kevin M 2016/10/03 22:32:19 This is an unconventional use of preprocessor incl
CJ 2016/10/03 22:36:31 I get that a switch statement is being created, I
+#undef HELIUM_ERROR
+ }
+}
+
+} // namespace blimp
+

Powered by Google App Engine
This is Rietveld 408576698