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

Side by Side Diff: remoting/test/connection_time_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: Synced with recent changes to connect to local host and cleaned up Connection Time Observer. 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.
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 <map>
9
10 #include "remoting/test/remote_connection_observer.h"
11
12 namespace remoting {
13 namespace test {
14
15 // Observes and saves the times when TestChromotingClient changes its state. It
joedow 2015/07/23 16:57:55 I don't think the comment should mention the TestC
tonychun 2015/07/24 01:41:47 Good point. Thank you.
16 // allows for tests to access latency times between the different states the
17 // client was in.
18 class ConnectionTimeObserver
19 : public RemoteConnectionObserver {
20 public:
21 ConnectionTimeObserver();
22 ~ConnectionTimeObserver() override;
23
24 // RemoteConnectionObserver interface.
25 void ConnectionStateChanged(protocol::ConnectionToHost::State state,
26 protocol::ErrorCode error_code) override;
27
28 // Returns the delta time in milliseconds between |start_state| and
29 // |end_state| stored in |transition_times_map_|.
30 int GetStateTransitionDelay(
Sergey Ulanov 2015/07/23 19:20:57 Return base::TimeDelta here?
tonychun 2015/07/24 01:41:47 Done.
31 const protocol::ConnectionToHost::State& start_state,
32 const protocol::ConnectionToHost::State& end_state) const;
33
34 private:
35 // Saves the latest state the ChromotingClient is in.
joedow 2015/07/23 16:57:54 Technically the state is provided by the Connectio
tonychun 2015/07/24 01:41:47 I've changed the name to current_connection_state_
36 protocol::ConnectionToHost::State current_state_ =
37 protocol::ConnectionToHost::State::INITIALIZING;
38
39 // Stores TimeTick of states the client changes to.
40 std::map<protocol::ConnectionToHost::State, base::TimeTicks>
41 transition_times_map_;
42
43 DISALLOW_COPY_AND_ASSIGN(ConnectionTimeObserver);
44 };
45
46 } // namespace test
47 } // namespace remoting
48
49 #endif // REMOTING_TEST_CONNECTION_TIME_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698