Index: remoting/protocol/connection_to_host_impl.cc |
diff --git a/remoting/protocol/connection_to_host_impl.cc b/remoting/protocol/connection_to_host_impl.cc |
index f4cef0c125c8554833cd9af19595f8ff2681f9a8..7f1f185f7ab905e1a85dfc7b99be469e0fbbb562 100644 |
--- a/remoting/protocol/connection_to_host_impl.cc |
+++ b/remoting/protocol/connection_to_host_impl.cc |
@@ -22,6 +22,10 @@ |
#include "remoting/protocol/transport.h" |
#include "remoting/protocol/video_stub.h" |
+#define RETURN_STRING_LITERAL(x) \ |
Sergey Ulanov
2015/07/30 22:00:44
nit: move this next to StateToString()
tonychun
2015/07/30 23:20:26
Done.
|
+case x: \ |
+return #x; |
+ |
namespace remoting { |
namespace protocol { |
@@ -48,6 +52,19 @@ ConnectionToHostImpl::~ConnectionToHostImpl() { |
signal_strategy_->RemoveListener(this); |
} |
+const char* ConnectionToHost::StateToString(State state) { |
+ switch (state) { |
+ RETURN_STRING_LITERAL(INITIALIZING); |
+ RETURN_STRING_LITERAL(CONNECTING); |
+ RETURN_STRING_LITERAL(AUTHENTICATED); |
+ RETURN_STRING_LITERAL(CONNECTED); |
+ RETURN_STRING_LITERAL(CLOSED); |
+ RETURN_STRING_LITERAL(FAILED); |
+ } |
+ NOTREACHED(); |
+ return nullptr; |
+} |
+ |
void ConnectionToHostImpl::Connect( |
SignalStrategy* signal_strategy, |
scoped_ptr<TransportFactory> transport_factory, |