OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "content/renderer/media/peer_connection_tracker.h" | 4 #include "content/renderer/media/peer_connection_tracker.h" |
5 | 5 |
6 #include "base/strings/string_number_conversions.h" | 6 #include "base/strings/string_number_conversions.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "base/thread_task_runner_handle.h" | 8 #include "base/thread_task_runner_handle.h" |
9 #include "content/common/media/peer_connection_tracker_messages.h" | 9 #include "content/common/media/peer_connection_tracker_messages.h" |
10 #include "content/renderer/media/rtc_media_constraints.h" | 10 #include "content/renderer/media/rtc_media_constraints.h" |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
297 IPC_MESSAGE_HANDLER(PeerConnectionTracker_GetAllStats, OnGetAllStats) | 297 IPC_MESSAGE_HANDLER(PeerConnectionTracker_GetAllStats, OnGetAllStats) |
298 IPC_MESSAGE_HANDLER(PeerConnectionTracker_OnSuspend, OnSuspend) | 298 IPC_MESSAGE_HANDLER(PeerConnectionTracker_OnSuspend, OnSuspend) |
299 IPC_MESSAGE_UNHANDLED(handled = false) | 299 IPC_MESSAGE_UNHANDLED(handled = false) |
300 IPC_END_MESSAGE_MAP() | 300 IPC_END_MESSAGE_MAP() |
301 return handled; | 301 return handled; |
302 } | 302 } |
303 | 303 |
304 void PeerConnectionTracker::OnGetAllStats() { | 304 void PeerConnectionTracker::OnGetAllStats() { |
305 DCHECK(main_thread_.CalledOnValidThread()); | 305 DCHECK(main_thread_.CalledOnValidThread()); |
306 | 306 |
307 const std::string empty_track_id; | |
307 for (PeerConnectionIdMap::iterator it = peer_connection_id_map_.begin(); | 308 for (PeerConnectionIdMap::iterator it = peer_connection_id_map_.begin(); |
308 it != peer_connection_id_map_.end(); ++it) { | 309 it != peer_connection_id_map_.end(); ++it) { |
309 rtc::scoped_refptr<InternalStatsObserver> observer( | 310 rtc::scoped_refptr<InternalStatsObserver> observer( |
310 new rtc::RefCountedObject<InternalStatsObserver>(it->second)); | 311 new rtc::RefCountedObject<InternalStatsObserver>(it->second)); |
311 | 312 |
313 // The last type parameter is ignored when the track id is empty. | |
312 it->first->GetStats( | 314 it->first->GetStats( |
perkj_chrome
2014/10/31 08:37:24
oh, this is the reason there is a getStats and Get
tommi (sloooow) - chröme
2014/10/31 10:06:32
Yup, I tried to remove it but yeah
| |
313 observer, | 315 observer, |
314 NULL, | 316 webrtc::PeerConnectionInterface::kStatsOutputLevelDebug, |
315 webrtc::PeerConnectionInterface::kStatsOutputLevelDebug); | 317 empty_track_id, blink::WebMediaStreamSource::TypeAudio); |
316 } | 318 } |
317 } | 319 } |
318 | 320 |
319 void PeerConnectionTracker::OnSuspend() { | 321 void PeerConnectionTracker::OnSuspend() { |
320 DCHECK(main_thread_.CalledOnValidThread()); | 322 DCHECK(main_thread_.CalledOnValidThread()); |
321 for (PeerConnectionIdMap::iterator it = peer_connection_id_map_.begin(); | 323 for (PeerConnectionIdMap::iterator it = peer_connection_id_map_.begin(); |
322 it != peer_connection_id_map_.end(); ++it) { | 324 it != peer_connection_id_map_.end(); ++it) { |
323 it->first->CloseClientPeerConnection(); | 325 it->first->CloseClientPeerConnection(); |
324 } | 326 } |
325 } | 327 } |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
575 DCHECK(main_thread_.CalledOnValidThread()); | 577 DCHECK(main_thread_.CalledOnValidThread()); |
576 if (peer_connection_id_map_.find(pc_handler) == peer_connection_id_map_.end()) | 578 if (peer_connection_id_map_.find(pc_handler) == peer_connection_id_map_.end()) |
577 return; | 579 return; |
578 | 580 |
579 RenderThreadImpl::current()->Send( | 581 RenderThreadImpl::current()->Send( |
580 new PeerConnectionTrackerHost_UpdatePeerConnection( | 582 new PeerConnectionTrackerHost_UpdatePeerConnection( |
581 peer_connection_id_map_[pc_handler], type, value)); | 583 peer_connection_id_map_[pc_handler], type, value)); |
582 } | 584 } |
583 | 585 |
584 } // namespace content | 586 } // namespace content |
OLD | NEW |