summaryrefslogtreecommitdiffstats
path: root/remoting/client/server_log_entry_client.h
blob: 84c2207398dac01faa2c8821278a9686199906b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2014 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_CLIENT_SERVER_LOG_ENTRY_CLIENT_H_
#define REMOTING_CLIENT_SERVER_LOG_ENTRY_CLIENT_H_

#include "base/time/time.h"
#include "remoting/protocol/connection_to_host.h"
#include "remoting/protocol/errors.h"

namespace remoting {

class ServerLogEntry;

namespace protocol {
class PerformanceTracker;
}  // namespace protocol

// Constructs a log entry for a session state change.
scoped_ptr<ServerLogEntry> MakeLogEntryForSessionStateChange(
    protocol::ConnectionToHost::State state,
    protocol::ErrorCode error);

// Constructs a log entry for reporting statistics.
scoped_ptr<ServerLogEntry> MakeLogEntryForStatistics(
    protocol::PerformanceTracker* statistics);

// Constructs a log entry for reporting session ID is old.
scoped_ptr<ServerLogEntry> MakeLogEntryForSessionIdOld(
    const std::string& session_id);

// Constructs a log entry for reporting session ID is old.
scoped_ptr<ServerLogEntry> MakeLogEntryForSessionIdNew(
    const std::string& session_id);

void AddClientFieldsToLogEntry(ServerLogEntry* entry);
void AddSessionIdToLogEntry(ServerLogEntry* entry, const std::string& id);
void AddSessionDurationToLogEntry(ServerLogEntry* entry,
                                  base::TimeDelta duration);

}  // namespace remoting

#endif  // REMOTING_CLIENT_SERVER_LOG_ENTRY_CLIENT_H_