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

Side by Side Diff: remoting/client/client_status_logger.h

Issue 2753963002: Refactoring and rewriting the chromoting jni instance to be chromoting session. (Closed)
Patch Set: Updating based on feedback. Created 3 years, 8 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
« no previous file with comments | « remoting/client/chromoting_session.cc ('k') | remoting/client/client_status_logger.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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_CLIENT_CLIENT_STATUS_LOGGER_H_
6 #define REMOTING_CLIENT_CLIENT_STATUS_LOGGER_H_
7
8 #include "base/macros.h"
9 #include "base/threading/non_thread_safe.h"
10 #include "base/time/time.h"
11 #include "remoting/protocol/connection_to_host.h"
12 #include "remoting/protocol/errors.h"
13 #include "remoting/signaling/log_to_server.h"
14
15 namespace remoting {
16
17 namespace protocol {
18 class PerformanceTracker;
19 } // namespace protocol
20
21 // ClientStatusLogger sends client log entries to a server.
22 // The contents of the log entries are described in server_log_entry_client.cc.
23 // They do not contain any personally identifiable information.
24 class ClientStatusLogger : public base::NonThreadSafe {
25 public:
26 ClientStatusLogger(ServerLogEntry::Mode mode,
27 SignalStrategy* signal_strategy,
28 const std::string& directory_bot_jid);
29 ~ClientStatusLogger();
30
31 void LogSessionStateChange(protocol::ConnectionToHost::State state,
32 protocol::ErrorCode error);
33 void LogStatistics(protocol::PerformanceTracker* perf_tracker);
34
35 // Allows test code to fake SignalStrategy state change events.
36 void SetSignalingStateForTest(SignalStrategy::State state);
37
38 private:
39 LogToServer log_to_server_;
40
41 // Generates a new random session ID.
42 void GenerateSessionId();
43
44 // Expire the session ID if the maximum duration has been exceeded.
45 void MaybeExpireSessionId();
46
47 // A randomly generated session ID to be attached to log messages. This
48 // is regenerated at the start of a new session.
49 std::string session_id_;
50
51 // Start time of the session.
52 base::TimeTicks session_start_time_;
53
54 // Time when the session ID was generated.
55 base::TimeTicks session_id_generation_time_;
56
57 DISALLOW_COPY_AND_ASSIGN(ClientStatusLogger);
58 };
59
60 } // namespace remoting
61
62 #endif // REMOTING_CLIENT_CLIENT_STATUS_LOGGER_H_
OLDNEW
« no previous file with comments | « remoting/client/chromoting_session.cc ('k') | remoting/client/client_status_logger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698