blob: 75c455d360c8888fbe119627886b8576f75b666f [file] [log] [blame]
sergeyud3022d362015-12-18 05:43:211// 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
9namespace remoting {
10namespace protocol {
11
12#define RETURN_STRING_LITERAL(x) \
13case x: \
14return #x;
15
16const 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