sergeyu | d3022d36 | 2015-12-18 05:43:21 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "remoting/protocol/connection_to_host.h" |
| 6 | |
| 7 | #include "base/logging.h" |
| 8 | |
| 9 | namespace remoting { |
| 10 | namespace protocol { |
| 11 | |
| 12 | #define RETURN_STRING_LITERAL(x) \ |
| 13 | case x: \ |
| 14 | return #x; |
| 15 | |
| 16 | const char* ConnectionToHost::StateToString(State state) { |
| 17 | switch (state) { |
| 18 | RETURN_STRING_LITERAL(INITIALIZING); |
| 19 | RETURN_STRING_LITERAL(CONNECTING); |
| 20 | RETURN_STRING_LITERAL(AUTHENTICATED); |
| 21 | RETURN_STRING_LITERAL(CONNECTED); |
| 22 | RETURN_STRING_LITERAL(CLOSED); |
| 23 | RETURN_STRING_LITERAL(FAILED); |
| 24 | } |
| 25 | NOTREACHED(); |
| 26 | return nullptr; |
| 27 | } |
| 28 | |
| 29 | } // namespace protocol |
| 30 | } // namespace remoting |