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

Unified 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: Changed to ConnectionTimeObserver. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/test/connection_time_observer.cc » ('j') | remoting/test/connection_time_observer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/test/connection_time_observer.h
diff --git a/remoting/test/connection_time_observer.h b/remoting/test/connection_time_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..0892daf53ea08afa811f099c38741ef42726fd87
--- /dev/null
+++ b/remoting/test/connection_time_observer.h
@@ -0,0 +1,39 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_TEST_CONNECTION_TIME_OBSERVER_H_
+#define REMOTING_TEST_CONNECTION_TIME_OBSERVER_H_
+
+#include "remoting/test/remote_connection_observer.h"
+
+namespace remoting {
+namespace test {
+
+// Observes and calculates the time between each state change of the chromoting
+// 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.
+class ConnectionTimeObserver
+ : public RemoteConnectionObserver {
+ public:
+ ConnectionTimeObserver();
+ ~ConnectionTimeObserver() override;
+
+ // RemoteConnectionObserver interface.
+ void ConnectionStateChanged(protocol::ConnectionToHost::State state,
+ protocol::ErrorCode error_code) override;
+
+ private:
+ // Saves the latest state the ChromotingClient is in.
+ protocol::ConnectionToHost::State current_state_;
+
+ // Used to find the time difference between subsequent calls to
+ // ConnectionStateChanged.
+ 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.
+
+ DISALLOW_COPY_AND_ASSIGN(ConnectionTimeObserver);
+};
+
+} // namespace test
+} // namespace remoting
+
+#endif // REMOTING_TEST_CONNECTION_TIME_OBSERVER_H_
« no previous file with comments | « no previous file | remoting/test/connection_time_observer.cc » ('j') | remoting/test/connection_time_observer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698