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 18 matching lines...) Expand all Loading... | |
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 scoped_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) { | 39 if (connected && connection_route_type_.count(jid) > 0) |
Jamie
2015/12/10 18:34:15
Why this change? And why not just change the DCHEC
Sergey Ulanov
2015/12/10 22:18:17
Currently WebrtcTransport doesn't report route typ
Jamie
2015/12/10 22:29:17
Do you mean that with WebRTC LogSessionStateChange
Sergey Ulanov
2015/12/10 22:48:05
No. With WebrtcTransport LogSessionStateChange() i
| |
40 DCHECK_EQ(connection_route_type_.count(jid), 1u); | |
41 AddConnectionTypeToLogEntry(entry.get(), connection_route_type_[jid]); | 40 AddConnectionTypeToLogEntry(entry.get(), connection_route_type_[jid]); |
Jamie
2015/12/10 22:29:17
Is this line still correct, even if connection_rou
Sergey Ulanov
2015/12/10 22:48:05
connection_route_type_ is a map (not std::multimap
| |
42 } | 41 |
43 log_to_server_.Log(*entry.get()); | 42 log_to_server_.Log(*entry.get()); |
44 } | 43 } |
45 | 44 |
46 void HostStatusLogger::OnClientConnected(const std::string& jid) { | 45 void HostStatusLogger::OnClientConnected(const std::string& jid) { |
47 DCHECK(CalledOnValidThread()); | 46 DCHECK(CalledOnValidThread()); |
48 LogSessionStateChange(jid, true); | 47 LogSessionStateChange(jid, true); |
49 } | 48 } |
50 | 49 |
51 void HostStatusLogger::OnClientDisconnected(const std::string& jid) { | 50 void HostStatusLogger::OnClientDisconnected(const std::string& jid) { |
52 DCHECK(CalledOnValidThread()); | 51 DCHECK(CalledOnValidThread()); |
(...skipping 10 matching lines...) Expand all Loading... | |
63 if (channel_name == kVideoChannelName) { | 62 if (channel_name == kVideoChannelName) { |
64 connection_route_type_[jid] = route.type; | 63 connection_route_type_[jid] = route.type; |
65 } | 64 } |
66 } | 65 } |
67 | 66 |
68 void HostStatusLogger::SetSignalingStateForTest(SignalStrategy::State state) { | 67 void HostStatusLogger::SetSignalingStateForTest(SignalStrategy::State state) { |
69 log_to_server_.OnSignalStrategyStateChange(state); | 68 log_to_server_.OnSignalStrategyStateChange(state); |
70 } | 69 } |
71 | 70 |
72 } // namespace remoting | 71 } // namespace remoting |
OLD | NEW |