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 | 4 |
5 #include "content/browser/webrtc/webrtc_internals.h" | 5 #include "content/browser/webrtc/webrtc_internals.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 if (observers_.might_have_observers()) | 262 if (observers_.might_have_observers()) |
263 return; | 263 return; |
264 | 264 |
265 // Disables event log and audio debug recordings if enabled and the last | 265 // Disables event log and audio debug recordings if enabled and the last |
266 // webrtc-internals page is going away. | 266 // webrtc-internals page is going away. |
267 DisableAudioDebugRecordings(); | 267 DisableAudioDebugRecordings(); |
268 DisableEventLogRecordings(); | 268 DisableEventLogRecordings(); |
269 | 269 |
270 // TODO(tommi): Consider removing all the peer_connection_data_. | 270 // TODO(tommi): Consider removing all the peer_connection_data_. |
271 for (auto& dictionary : peer_connection_data_) | 271 for (auto& dictionary : peer_connection_data_) |
272 FreeLogList(dictionary.get()); | 272 FreeLogList(&dictionary); |
273 } | 273 } |
274 | 274 |
275 void WebRTCInternals::UpdateObserver(WebRTCInternalsUIObserver* observer) { | 275 void WebRTCInternals::UpdateObserver(WebRTCInternalsUIObserver* observer) { |
276 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 276 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
277 if (peer_connection_data_.GetSize() > 0) | 277 if (peer_connection_data_.GetSize() > 0) |
278 observer->OnUpdate("updateAllPeerConnections", &peer_connection_data_); | 278 observer->OnUpdate("updateAllPeerConnections", &peer_connection_data_); |
279 | 279 |
280 for (const auto& request : get_user_media_requests_) { | 280 for (const auto& request : get_user_media_requests_) { |
281 observer->OnUpdate("addGetUserMedia", request.get()); | 281 observer->OnUpdate("addGetUserMedia", &request); |
282 } | 282 } |
283 } | 283 } |
284 | 284 |
285 void WebRTCInternals::EnableAudioDebugRecordings( | 285 void WebRTCInternals::EnableAudioDebugRecordings( |
286 content::WebContents* web_contents) { | 286 content::WebContents* web_contents) { |
287 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 287 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
288 #if BUILDFLAG(ENABLE_WEBRTC) | 288 #if BUILDFLAG(ENABLE_WEBRTC) |
289 #if defined(OS_ANDROID) | 289 #if defined(OS_ANDROID) |
290 EnableAudioDebugRecordingsOnAllRenderProcessHosts(); | 290 EnableAudioDebugRecordingsOnAllRenderProcessHosts(); |
291 #else | 291 #else |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 | 584 |
585 if (this_pid == static_cast<int>(pid) && this_lid == lid) { | 585 if (this_pid == static_cast<int>(pid) && this_lid == lid) { |
586 if (index) | 586 if (index) |
587 *index = i; | 587 *index = i; |
588 return record; | 588 return record; |
589 } | 589 } |
590 } | 590 } |
591 return nullptr; | 591 return nullptr; |
592 } | 592 } |
593 } // namespace content | 593 } // namespace content |
OLD | NEW |