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

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

Issue 320403002: Pull out common code from client and host versions of LogToServer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
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_LOG_TO_SERVER_CLIENT_H_
6 #define REMOTING_CLIENT_LOG_TO_SERVER_CLIENT_H_
7
8 #include "base/time/time.h"
9 #include "remoting/jingle_glue/log_to_server.h"
10 #include "remoting/protocol/connection_to_host.h"
11 #include "remoting/protocol/errors.h"
12
13 namespace remoting {
14
15 class ChromotingStats;
16
17 // LogToServerClient sends client log entries to a server.
18 // The contents of the log entries are described in server_log_entry_client.cc.
19 // They do not contain any personally identifiable information.
20 class LogToServerClient : public LogToServer {
21 public:
22 LogToServerClient(ServerLogEntry::Mode mode,
23 SignalStrategy* signal_strategy,
24 const std::string& directory_bot_jid);
25 virtual ~LogToServerClient() OVERRIDE;
26
27 void LogSessionStateChange(protocol::ConnectionToHost::State state,
28 protocol::ErrorCode error);
29 void LogStatistics(remoting::ChromotingStats* statistics);
30
31 private:
32 // Generates a new random session ID.
33 void GenerateSessionId();
34
35 // Expire the session ID if the maximum duration has been exceeded.
36 void MaybeExpireSessionId();
37
38 // A randomly generated session ID to be attached to log messages. This
39 // is regenerated at the start of a new session.
40 std::string session_id_;
41
42 // Start time of the session.
43 base::TimeTicks session_start_time_;
44
45 // Time when the session ID was generated.
46 base::TimeTicks session_id_generation_time_;
47
48 DISALLOW_COPY_AND_ASSIGN(LogToServerClient);
49 };
50
51 } // namespace remoting
52
53 #endif // REMOTING_CLIENT_LOG_TO_SERVER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698