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

Unified Diff: remoting/protocol/errors.cc

Issue 1238343002: Added ConnectionTimeObserver to calculate the times to authenticate and connect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added errors.cc and cleaned up switch statements. Created 5 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
Index: remoting/protocol/errors.cc
diff --git a/remoting/protocol/errors.cc b/remoting/protocol/errors.cc
new file mode 100644
index 0000000000000000000000000000000000000000..449647b1a46d3b6a07ab811ec72392a0e9db1ae7
--- /dev/null
+++ b/remoting/protocol/errors.cc
@@ -0,0 +1,32 @@
+// Copyright 2015 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 "remoting/protocol/errors.h"
+
+#define RETURN_STRING_LITERAL(x) \
+case x: \
+return #x;
+
+namespace remoting {
+namespace protocol {
+
+const char* ErrorCodeToString(ErrorCode error) {
+ switch (error) {
+ RETURN_STRING_LITERAL(OK);
+ RETURN_STRING_LITERAL(PEER_IS_OFFLINE);
+ RETURN_STRING_LITERAL(SESSION_REJECTED);
+ RETURN_STRING_LITERAL(INCOMPATIBLE_PROTOCOL);
+ RETURN_STRING_LITERAL(AUTHENTICATION_FAILED);
+ RETURN_STRING_LITERAL(CHANNEL_CONNECTION_ERROR);
+ RETURN_STRING_LITERAL(SIGNALING_ERROR);
+ RETURN_STRING_LITERAL(SIGNALING_TIMEOUT);
+ RETURN_STRING_LITERAL(HOST_OVERLOAD);
+ RETURN_STRING_LITERAL(UNKNOWN_ERROR);
+ }
+ NOTREACHED();
+ return nullptr;
+}
+
+} // namespace protocol
+} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698