OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/host/host_status_logger.h" | 5 #include "remoting/host/host_status_logger.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "remoting/base/constants.h" | 8 #include "remoting/base/constants.h" |
9 #include "remoting/host/host_status_monitor.h" | 9 #include "remoting/host/host_status_monitor.h" |
10 #include "remoting/host/server_log_entry_host.h" | 10 #include "remoting/host/server_log_entry_host.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 HostStatusLogger::~HostStatusLogger() { | 25 HostStatusLogger::~HostStatusLogger() { |
26 if (monitor_.get()) | 26 if (monitor_.get()) |
27 monitor_->RemoveStatusObserver(this); | 27 monitor_->RemoveStatusObserver(this); |
28 } | 28 } |
29 | 29 |
30 void HostStatusLogger::LogSessionStateChange(const std::string& jid, | 30 void HostStatusLogger::LogSessionStateChange(const std::string& jid, |
31 bool connected) { | 31 bool connected) { |
32 DCHECK(CalledOnValidThread()); | 32 DCHECK(CalledOnValidThread()); |
33 | 33 |
34 scoped_ptr<ServerLogEntry> entry( | 34 std::unique_ptr<ServerLogEntry> entry( |
35 MakeLogEntryForSessionStateChange(connected)); | 35 MakeLogEntryForSessionStateChange(connected)); |
36 AddHostFieldsToLogEntry(entry.get()); | 36 AddHostFieldsToLogEntry(entry.get()); |
37 entry->AddModeField(log_to_server_.mode()); | 37 entry->AddModeField(log_to_server_.mode()); |
38 | 38 |
39 if (connected && connection_route_type_.count(jid) > 0) | 39 if (connected && connection_route_type_.count(jid) > 0) |
40 AddConnectionTypeToLogEntry(entry.get(), connection_route_type_[jid]); | 40 AddConnectionTypeToLogEntry(entry.get(), connection_route_type_[jid]); |
41 | 41 |
42 log_to_server_.Log(*entry.get()); | 42 log_to_server_.Log(*entry.get()); |
43 } | 43 } |
44 | 44 |
(...skipping 17 matching lines...) Expand all Loading... |
62 if (channel_name == kVideoChannelName) { | 62 if (channel_name == kVideoChannelName) { |
63 connection_route_type_[jid] = route.type; | 63 connection_route_type_[jid] = route.type; |
64 } | 64 } |
65 } | 65 } |
66 | 66 |
67 void HostStatusLogger::SetSignalingStateForTest(SignalStrategy::State state) { | 67 void HostStatusLogger::SetSignalingStateForTest(SignalStrategy::State state) { |
68 log_to_server_.OnSignalStrategyStateChange(state); | 68 log_to_server_.OnSignalStrategyStateChange(state); |
69 } | 69 } |
70 | 70 |
71 } // namespace remoting | 71 } // namespace remoting |
OLD | NEW |