| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer/media/user_media_client_impl.h" | 5 #include "content/renderer/media/user_media_client_impl.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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 void FakeMediaStreamDispatcherRequestUserMediaComplete() { | 257 void FakeMediaStreamDispatcherRequestUserMediaComplete() { |
| 258 // Audio request ID is used as the shared request ID. | 258 // Audio request ID is used as the shared request ID. |
| 259 used_media_impl_->OnStreamGenerated( | 259 used_media_impl_->OnStreamGenerated( |
| 260 ms_dispatcher_->audio_input_request_id(), | 260 ms_dispatcher_->audio_input_request_id(), |
| 261 ms_dispatcher_->stream_label(), | 261 ms_dispatcher_->stream_label(), |
| 262 ms_dispatcher_->audio_input_array(), | 262 ms_dispatcher_->audio_input_array(), |
| 263 ms_dispatcher_->video_array()); | 263 ms_dispatcher_->video_array()); |
| 264 } | 264 } |
| 265 | 265 |
| 266 void FakeMediaStreamDispatcherRequestMediaDevicesComplete() { | 266 void FakeMediaStreamDispatcherRequestMediaDevicesComplete() { |
| 267 // There may be repeated replies due to device or configuration changes. |
| 267 used_media_impl_->OnDevicesEnumerated( | 268 used_media_impl_->OnDevicesEnumerated( |
| 268 ms_dispatcher_->audio_input_request_id(), | 269 ms_dispatcher_->audio_input_request_id(), |
| 269 ms_dispatcher_->audio_input_array()); | 270 ms_dispatcher_->audio_input_array()); |
| 271 used_media_impl_->OnDevicesEnumerated( |
| 272 ms_dispatcher_->audio_input_request_id(), |
| 273 ms_dispatcher_->audio_input_array()); |
| 270 used_media_impl_->OnDevicesEnumerated( | 274 used_media_impl_->OnDevicesEnumerated( |
| 271 ms_dispatcher_->audio_output_request_id(), | 275 ms_dispatcher_->audio_output_request_id(), |
| 272 ms_dispatcher_->audio_output_array()); | 276 ms_dispatcher_->audio_output_array()); |
| 273 used_media_impl_->OnDevicesEnumerated( | 277 used_media_impl_->OnDevicesEnumerated( |
| 278 ms_dispatcher_->audio_output_request_id(), |
| 279 ms_dispatcher_->audio_output_array()); |
| 280 used_media_impl_->OnDevicesEnumerated( |
| 274 ms_dispatcher_->video_request_id(), | 281 ms_dispatcher_->video_request_id(), |
| 275 ms_dispatcher_->video_array()); | 282 ms_dispatcher_->video_array()); |
| 283 used_media_impl_->OnDevicesEnumerated( |
| 284 ms_dispatcher_->video_request_id(), |
| 285 ms_dispatcher_->video_array()); |
| 276 } | 286 } |
| 277 | 287 |
| 278 void FakeMediaStreamDispatcherRequestSourcesComplete() { | 288 void FakeMediaStreamDispatcherRequestSourcesComplete() { |
| 279 used_media_impl_->OnDevicesEnumerated( | 289 used_media_impl_->OnDevicesEnumerated( |
| 280 ms_dispatcher_->audio_input_request_id(), | 290 ms_dispatcher_->audio_input_request_id(), |
| 281 ms_dispatcher_->audio_input_array()); | 291 ms_dispatcher_->audio_input_array()); |
| 282 used_media_impl_->OnDevicesEnumerated( | 292 used_media_impl_->OnDevicesEnumerated( |
| 283 ms_dispatcher_->video_request_id(), | 293 ms_dispatcher_->video_request_id(), |
| 284 ms_dispatcher_->video_array()); | 294 ms_dispatcher_->video_array()); |
| 285 } | 295 } |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 // Now we close the web frame, if in the above Stop() call, | 714 // Now we close the web frame, if in the above Stop() call, |
| 705 // UserMediaClientImpl accidentally removed audio track, then video track will | 715 // UserMediaClientImpl accidentally removed audio track, then video track will |
| 706 // be removed again here, which is incorrect. | 716 // be removed again here, which is incorrect. |
| 707 used_media_impl_->FrameWillClose(); | 717 used_media_impl_->FrameWillClose(); |
| 708 blink::WebHeap::collectAllGarbageForTesting(); | 718 blink::WebHeap::collectAllGarbageForTesting(); |
| 709 EXPECT_EQ(1, ms_dispatcher_->stop_video_device_counter()); | 719 EXPECT_EQ(1, ms_dispatcher_->stop_video_device_counter()); |
| 710 EXPECT_EQ(1, ms_dispatcher_->stop_audio_device_counter()); | 720 EXPECT_EQ(1, ms_dispatcher_->stop_audio_device_counter()); |
| 711 } | 721 } |
| 712 | 722 |
| 713 } // namespace content | 723 } // namespace content |
| OLD | NEW |