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

Side by Side Diff: remoting/test/chromoting_connection_observer.h

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: 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
joedow 2015/07/20 16:30:58 Is it intentional that you have not added this to
tonychun 2015/07/20 17:49:59 This is a partial CL. Once my changes for environm
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_TEST_CHROMOTING_CONNECTION_OBSERVER_H_
6 #define REMOTING_TEST_CHROMOTING_CONNECTION_OBSERVER_H_
7
8 #include <map>
9
10 #include "remoting/test/remote_connection_observer.h"
11
12 namespace remoting {
13 namespace test {
14
15 // Observes and calculates the time between each state change of the chromoting
16 // connection process.
17 class ChromotingConnectionObserver
joedow 2015/07/20 16:30:58 I would probably just call this class a connection
tonychun 2015/07/20 17:49:59 Done.
18 : public RemoteConnectionObserver {
19 public:
20 ChromotingConnectionObserver();
21 ~ChromotingConnectionObserver() override;
22
23 // RemoteConnectionObserver interface.
24 void ConnectionStateChanged(protocol::ConnectionToHost::State state,
25 protocol::ErrorCode error_code) override;
26 void ConnectionReady(bool ready) override;
27 void RouteChanged(const std::string& channel_name,
28 const protocol::TransportRoute& route) override;
29 void CapabilitiesSet(const std::string& capabilities) override;
30 void PairingResponseSet(
31 const protocol::PairingResponse& pairing_response) override;
32 void HostMessageReceived(const protocol::ExtensionMessage& message) override;
33
34 private:
35 // Used to convert connection states to strings.
36 std::map<protocol::ConnectionToHost::State, std::string> state_map_;
37
38 // Saves the latest state the ChromotingClient is in.
39 protocol::ConnectionToHost::State current_state_;
40
41 // Used to find the time difference between subsequent calls to
42 // ConnectionStateChanged.
43 base::TimeTicks delta_;
joedow 2015/07/20 16:30:58 I think this var should be renamed as delta_ isn't
tonychun 2015/07/20 17:49:59 Done.
44
45 DISALLOW_COPY_AND_ASSIGN(ChromotingConnectionObserver);
46 };
47
48 } // namespace test
49 } // namespace remoting
50
51 #endif // REMOTING_TEST_CHROMOTING_CONNECTION_OBSERVER_H_
OLDNEW
« no previous file with comments | « no previous file | remoting/test/chromoting_connection_observer.cc » ('j') | remoting/test/chromoting_connection_observer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698