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

Unified Diff: remoting/protocol/connection_to_host_impl.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/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,

Powered by Google App Engine
This is Rietveld 408576698