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

Side by Side 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: Removed unused headers. Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « remoting/protocol/connection_to_host.h ('k') | remoting/protocol/errors.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/connection_to_host_impl.h" 5 #include "remoting/protocol/connection_to_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "remoting/base/constants.h" 10 #include "remoting/base/constants.h"
(...skipping 30 matching lines...) Expand all
41 if (session_.get()) 41 if (session_.get())
42 session_.reset(); 42 session_.reset();
43 43
44 if (session_manager_.get()) 44 if (session_manager_.get())
45 session_manager_.reset(); 45 session_manager_.reset();
46 46
47 if (signal_strategy_) 47 if (signal_strategy_)
48 signal_strategy_->RemoveListener(this); 48 signal_strategy_->RemoveListener(this);
49 } 49 }
50 50
51 #define RETURN_STRING_LITERAL(x) \
52 case x: \
53 return #x;
54
55 const char* ConnectionToHost::StateToString(State state) {
56 switch (state) {
57 RETURN_STRING_LITERAL(INITIALIZING);
58 RETURN_STRING_LITERAL(CONNECTING);
59 RETURN_STRING_LITERAL(AUTHENTICATED);
60 RETURN_STRING_LITERAL(CONNECTED);
61 RETURN_STRING_LITERAL(CLOSED);
62 RETURN_STRING_LITERAL(FAILED);
63 }
64 NOTREACHED();
65 return nullptr;
66 }
67
51 void ConnectionToHostImpl::Connect( 68 void ConnectionToHostImpl::Connect(
52 SignalStrategy* signal_strategy, 69 SignalStrategy* signal_strategy,
53 scoped_ptr<TransportFactory> transport_factory, 70 scoped_ptr<TransportFactory> transport_factory,
54 scoped_ptr<Authenticator> authenticator, 71 scoped_ptr<Authenticator> authenticator,
55 const std::string& host_jid, 72 const std::string& host_jid,
56 HostEventCallback* event_callback) { 73 HostEventCallback* event_callback) {
57 DCHECK(client_stub_); 74 DCHECK(client_stub_);
58 DCHECK(clipboard_stub_); 75 DCHECK(clipboard_stub_);
59 DCHECK(monitored_video_stub_); 76 DCHECK(monitored_video_stub_);
60 77
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 311
295 if (state != state_) { 312 if (state != state_) {
296 state_ = state; 313 state_ = state;
297 error_ = error; 314 error_ = error;
298 event_callback_->OnConnectionState(state_, error_); 315 event_callback_->OnConnectionState(state_, error_);
299 } 316 }
300 } 317 }
301 318
302 } // namespace protocol 319 } // namespace protocol
303 } // namespace remoting 320 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/connection_to_host.h ('k') | remoting/protocol/errors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698