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

Side by Side Diff: blimp/net/helium/helium_result.h

Issue 2385913002: Define canonical enum for "HeliumResult" status values. (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698