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

Unified Diff: remoting/host/host_exit_codes.h

Issue 18075003: Host offline status reporting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 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
« no previous file with comments | « no previous file | remoting/host/host_status_sender.h » ('j') | remoting/host/server_log_entry.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « no previous file | remoting/host/host_status_sender.h » ('j') | remoting/host/server_log_entry.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698