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/media/webrtc/webrtc_internals.h" | 5 #include "content/browser/media/webrtc/webrtc_internals.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // webrtc-internals page is going away. | 256 // webrtc-internals page is going away. |
257 if (audio_debug_recordings_ && !observers_.might_have_observers()) | 257 if (audio_debug_recordings_ && !observers_.might_have_observers()) |
258 DisableAudioDebugRecordings(); | 258 DisableAudioDebugRecordings(); |
259 } | 259 } |
260 | 260 |
261 void WebRTCInternals::UpdateObserver(WebRTCInternalsUIObserver* observer) { | 261 void WebRTCInternals::UpdateObserver(WebRTCInternalsUIObserver* observer) { |
262 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 262 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
263 if (peer_connection_data_.GetSize() > 0) | 263 if (peer_connection_data_.GetSize() > 0) |
264 observer->OnUpdate("updateAllPeerConnections", &peer_connection_data_); | 264 observer->OnUpdate("updateAllPeerConnections", &peer_connection_data_); |
265 | 265 |
266 for (base::ListValue::iterator it = get_user_media_requests_.begin(); | 266 for (const auto& request : get_user_media_requests_) { |
267 it != get_user_media_requests_.end(); | 267 observer->OnUpdate("addGetUserMedia", request.get()); |
268 ++it) { | |
269 observer->OnUpdate("addGetUserMedia", *it); | |
270 } | 268 } |
271 } | 269 } |
272 | 270 |
273 void WebRTCInternals::EnableAudioDebugRecordings( | 271 void WebRTCInternals::EnableAudioDebugRecordings( |
274 content::WebContents* web_contents) { | 272 content::WebContents* web_contents) { |
275 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 273 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
276 #if defined(ENABLE_WEBRTC) | 274 #if defined(ENABLE_WEBRTC) |
277 #if defined(OS_ANDROID) | 275 #if defined(OS_ANDROID) |
278 EnableAudioDebugRecordingsOnAllRenderProcessHosts(); | 276 EnableAudioDebugRecordingsOnAllRenderProcessHosts(); |
279 #else | 277 #else |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 while (!pending_updates_.empty()) { | 511 while (!pending_updates_.empty()) { |
514 const auto& update = pending_updates_.front(); | 512 const auto& update = pending_updates_.front(); |
515 FOR_EACH_OBSERVER(WebRTCInternalsUIObserver, | 513 FOR_EACH_OBSERVER(WebRTCInternalsUIObserver, |
516 observers_, | 514 observers_, |
517 OnUpdate(update.command(), update.value())); | 515 OnUpdate(update.command(), update.value())); |
518 pending_updates_.pop(); | 516 pending_updates_.pop(); |
519 } | 517 } |
520 } | 518 } |
521 | 519 |
522 } // namespace content | 520 } // namespace content |
OLD | NEW |