OLD | NEW |
---|---|
(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_ | |
OLD | NEW |