Index: remoting/host/host_exit_codes.h |
diff --git a/remoting/host/host_exit_codes.h b/remoting/host/host_exit_codes.h |
index b325d1f2b64e0bba7a960f356c2cbf7f094703ba..b798d0ca9896ebf547863571d14241d33e0f41a6 100644 |
--- a/remoting/host/host_exit_codes.h |
+++ b/remoting/host/host_exit_codes.h |
@@ -33,6 +33,25 @@ enum HostExitCodes { |
kMaxPermanentErrorExitCode = kUsernameMismatchExitCode |
}; |
+const int PERMANENT_ERROR_EXIT_CODE_COUNT = |
+ kMaxPermanentErrorExitCode - kMinPermanentErrorExitCode + 1; |
+ |
+const std::string HostExitCodeStrings[] = { |
rmsousa
2013/07/09 03:13:41
Nit: Please create a .cc file for the string defin
weitao
2013/07/09 19:02:17
Done.
|
+ "INVALID_HOST_CONFIGURATION", |
+ "INVALID_HOST_ID", |
+ "INVALID_OAUTH_CREDENTIALS", |
+ "INVALID_HOST_DOMAIN", |
+ "LOGIN_SCREEN_NOT_SUPPORTED", |
+ "USERNAME_MISMATCH" |
+}; |
+ |
+inline std::string ExitCodeToString(int exit_code) { |
rmsousa
2013/07/09 03:13:41
Nit: Please take a HostExitCode (rather than int)
weitao
2013/07/09 19:02:17
Done.
|
+ DCHECK(exit_code >= kMinPermanentErrorExitCode && |
rmsousa
2013/07/09 03:13:41
This will DCHECK for exit_code kSuccessExitCode (w
weitao
2013/07/09 19:02:17
Done.
|
+ exit_code <= kMaxPermanentErrorExitCode); |
+ |
+ return HostExitCodeStrings[exit_code - kMinPermanentErrorExitCode]; |
+} |
+ |
} // namespace remoting |
#endif // REMOTING_HOST_HOST_EXIT_CODES_H_ |