Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef REMOTING_TEST_CONNECTION_TIME_OBSERVER_H_ | |
| 6 #define REMOTING_TEST_CONNECTION_TIME_OBSERVER_H_ | |
| 7 | |
| 8 #include "remoting/test/remote_connection_observer.h" | |
| 9 | |
| 10 namespace remoting { | |
| 11 namespace test { | |
| 12 | |
| 13 // Observes and calculates the time between each state change of the chromoting | |
| 14 // connection process. | |
|
Sergey Ulanov
2015/07/20 23:04:04
And it also logs the calculated values. The purpos
tonychun
2015/07/23 03:31:04
Done.
| |
| 15 class ConnectionTimeObserver | |
| 16 : public RemoteConnectionObserver { | |
| 17 public: | |
| 18 ConnectionTimeObserver(); | |
| 19 ~ConnectionTimeObserver() override; | |
| 20 | |
| 21 // RemoteConnectionObserver interface. | |
| 22 void ConnectionStateChanged(protocol::ConnectionToHost::State state, | |
| 23 protocol::ErrorCode error_code) override; | |
| 24 | |
| 25 private: | |
| 26 // Saves the latest state the ChromotingClient is in. | |
| 27 protocol::ConnectionToHost::State current_state_; | |
| 28 | |
| 29 // Used to find the time difference between subsequent calls to | |
| 30 // ConnectionStateChanged. | |
| 31 base::TimeTicks last_state_change_time_ticks; | |
|
Sergey Ulanov
2015/07/20 23:04:04
nit: call it last_state_change_time_ or last_state
Sergey Ulanov
2015/07/20 23:04:04
add _ at the end of the name
tonychun
2015/07/23 03:31:04
Done.
| |
| 32 | |
| 33 DISALLOW_COPY_AND_ASSIGN(ConnectionTimeObserver); | |
| 34 }; | |
| 35 | |
| 36 } // namespace test | |
| 37 } // namespace remoting | |
| 38 | |
| 39 #endif // REMOTING_TEST_CONNECTION_TIME_OBSERVER_H_ | |
| OLD | NEW |