| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/protocol/errors.h" | 5 #include "remoting/protocol/errors.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace remoting { | 9 namespace remoting { |
| 10 namespace protocol { | 10 namespace protocol { |
| 11 | 11 |
| 12 #define RETURN_STRING_LITERAL(x) \ | 12 #define RETURN_STRING_LITERAL(x) \ |
| 13 case x: \ | 13 case x: \ |
| 14 return #x; | 14 return #x; |
| 15 | 15 |
| 16 const char* ErrorCodeToString(ErrorCode error) { | 16 const char* ErrorCodeToString(ErrorCode error) { |
| 17 switch (error) { | 17 switch (error) { |
| 18 RETURN_STRING_LITERAL(OK); | 18 RETURN_STRING_LITERAL(OK); |
| 19 RETURN_STRING_LITERAL(PEER_IS_OFFLINE); | 19 RETURN_STRING_LITERAL(PEER_IS_OFFLINE); |
| 20 RETURN_STRING_LITERAL(SESSION_REJECTED); | 20 RETURN_STRING_LITERAL(SESSION_REJECTED); |
| 21 RETURN_STRING_LITERAL(INCOMPATIBLE_PROTOCOL); | 21 RETURN_STRING_LITERAL(INCOMPATIBLE_PROTOCOL); |
| 22 RETURN_STRING_LITERAL(AUTHENTICATION_FAILED); | 22 RETURN_STRING_LITERAL(AUTHENTICATION_FAILED); |
| 23 RETURN_STRING_LITERAL(INVALID_ACCOUNT); |
| 23 RETURN_STRING_LITERAL(CHANNEL_CONNECTION_ERROR); | 24 RETURN_STRING_LITERAL(CHANNEL_CONNECTION_ERROR); |
| 24 RETURN_STRING_LITERAL(SIGNALING_ERROR); | 25 RETURN_STRING_LITERAL(SIGNALING_ERROR); |
| 25 RETURN_STRING_LITERAL(SIGNALING_TIMEOUT); | 26 RETURN_STRING_LITERAL(SIGNALING_TIMEOUT); |
| 26 RETURN_STRING_LITERAL(HOST_OVERLOAD); | 27 RETURN_STRING_LITERAL(HOST_OVERLOAD); |
| 27 RETURN_STRING_LITERAL(MAX_SESSION_LENGTH); | 28 RETURN_STRING_LITERAL(MAX_SESSION_LENGTH); |
| 28 RETURN_STRING_LITERAL(HOST_CONFIGURATION_ERROR); | 29 RETURN_STRING_LITERAL(HOST_CONFIGURATION_ERROR); |
| 29 RETURN_STRING_LITERAL(UNKNOWN_ERROR); | 30 RETURN_STRING_LITERAL(UNKNOWN_ERROR); |
| 30 } | 31 } |
| 31 NOTREACHED(); | 32 NOTREACHED(); |
| 32 return nullptr; | 33 return nullptr; |
| 33 } | 34 } |
| 34 | 35 |
| 35 } // namespace protocol | 36 } // namespace protocol |
| 36 } // namespace remoting | 37 } // namespace remoting |
| OLD | NEW |