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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: remoting/test/chromoting_connection_observer.h
diff --git a/remoting/test/chromoting_connection_observer.h b/remoting/test/chromoting_connection_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..4c0fcff6083375053012c7b323068dcdf1b152ac
--- /dev/null
+++ b/remoting/test/chromoting_connection_observer.h
@@ -0,0 +1,51 @@
+// 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
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_TEST_CHROMOTING_CONNECTION_OBSERVER_H_
+#define REMOTING_TEST_CHROMOTING_CONNECTION_OBSERVER_H_
+
+#include <map>
+
+#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.
+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.
+ : public RemoteConnectionObserver {
+ public:
+ ChromotingConnectionObserver();
+ ~ChromotingConnectionObserver() override;
+
+ // RemoteConnectionObserver interface.
+ void ConnectionStateChanged(protocol::ConnectionToHost::State state,
+ protocol::ErrorCode error_code) override;
+ void ConnectionReady(bool ready) override;
+ void RouteChanged(const std::string& channel_name,
+ const protocol::TransportRoute& route) override;
+ void CapabilitiesSet(const std::string& capabilities) override;
+ void PairingResponseSet(
+ const protocol::PairingResponse& pairing_response) override;
+ void HostMessageReceived(const protocol::ExtensionMessage& message) override;
+
+ private:
+ // Used to convert connection states to strings.
+ std::map<protocol::ConnectionToHost::State, std::string> state_map_;
+
+ // 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 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.
+
+ DISALLOW_COPY_AND_ASSIGN(ChromotingConnectionObserver);
+};
+
+} // namespace test
+} // namespace remoting
+
+#endif // REMOTING_TEST_CHROMOTING_CONNECTION_OBSERVER_H_
« 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