Chromium Code Reviews| Index: content/renderer/media/peer_connection_tracker.cc |
| diff --git a/content/renderer/media/peer_connection_tracker.cc b/content/renderer/media/peer_connection_tracker.cc |
| index 103236484c9fc3b573287f50850db964210f348a..b452ba95a3ee2d7e7bfaa463d08044c1fa5fdc06 100644 |
| --- a/content/renderer/media/peer_connection_tracker.cc |
| +++ b/content/renderer/media/peer_connection_tracker.cc |
| @@ -343,6 +343,8 @@ bool PeerConnectionTracker::OnControlMessageReceived( |
| IPC_BEGIN_MESSAGE_MAP(PeerConnectionTracker, message) |
| IPC_MESSAGE_HANDLER(PeerConnectionTracker_GetAllStats, OnGetAllStats) |
| IPC_MESSAGE_HANDLER(PeerConnectionTracker_OnSuspend, OnSuspend) |
| + IPC_MESSAGE_HANDLER(PeerConnectionTracker_StartEventLog, OnStartEventLog) |
| + IPC_MESSAGE_HANDLER(PeerConnectionTracker_StopEventLog, OnStopEventLog) |
| IPC_MESSAGE_UNHANDLED(handled = false) |
| IPC_END_MESSAGE_MAP() |
| return handled; |
| @@ -380,6 +382,30 @@ void PeerConnectionTracker::OnSuspend() { |
| } |
| } |
| +void PeerConnectionTracker::OnStartEventLog(int local_id, |
| + IPC::PlatformFileForTransit file, |
| + int64_t max_file_size_bytes) { |
| + DCHECK(main_thread_.CalledOnValidThread()); |
| + for (PeerConnectionIdMap::iterator it = peer_connection_id_map_.begin(); |
|
dcheng
2016/04/04 21:44:57
Consider using for (auto& kv : map_) syntax here a
Ivo-OOO until feb 6
2016/04/05 08:59:27
Thanks, looks better.
|
| + it != peer_connection_id_map_.end(); ++it) { |
| + if (it->second == local_id) { |
| + it->first->StartEventLog(file, max_file_size_bytes); |
| + return; |
| + } |
| + } |
| +} |
| + |
| +void PeerConnectionTracker::OnStopEventLog(int local_id) { |
| + DCHECK(main_thread_.CalledOnValidThread()); |
| + for (PeerConnectionIdMap::iterator it = peer_connection_id_map_.begin(); |
| + it != peer_connection_id_map_.end(); ++it) { |
| + if (it->second == local_id) { |
| + it->first->StopEventLog(); |
| + return; |
| + } |
| + } |
| +} |
| + |
| void PeerConnectionTracker::RegisterPeerConnection( |
| RTCPeerConnectionHandler* pc_handler, |
| const webrtc::PeerConnectionInterface::RTCConfiguration& config, |