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 <algorithm> | 9 #include <algorithm> |
10 #include <utility> | 10 #include <utility> |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 } | 387 } |
388 | 388 |
389 void UserMediaClientImpl::FinalizeSelectVideoDeviceSourceSettings( | 389 void UserMediaClientImpl::FinalizeSelectVideoDeviceSourceSettings( |
390 int request_id, | 390 int request_id, |
391 const blink::WebUserMediaRequest& user_media_request, | 391 const blink::WebUserMediaRequest& user_media_request, |
392 std::unique_ptr<StreamControls> controls, | 392 std::unique_ptr<StreamControls> controls, |
393 const RequestSettings& request_settings, | 393 const RequestSettings& request_settings, |
394 const VideoDeviceCaptureSourceSelectionResult& selection_result) { | 394 const VideoDeviceCaptureSourceSelectionResult& selection_result) { |
395 DCHECK(CalledOnValidThread()); | 395 DCHECK(CalledOnValidThread()); |
396 if (selection_result.HasValue()) { | 396 if (selection_result.HasValue()) { |
397 controls->video.device_id = selection_result.device_id; | 397 controls->video.device_id = selection_result.device_id(); |
398 } else { | 398 } else { |
399 // TODO(guidou): Abort the request in all cases where |selection_result| | 399 // TODO(guidou): Abort the request in all cases where |selection_result| |
400 // has no value, as the spec mandates. | 400 // has no value, as the spec mandates. |
401 // Currently, some applications rely on the nonstandard behavior of asking | 401 // Currently, some applications rely on the nonstandard behavior of asking |
402 // for permission even if constraints cannot be satisfied or there are no | 402 // for permission even if constraints cannot be satisfied or there are no |
403 // devices. Fix once the standard behavior ceases to be disruptive. | 403 // devices. Fix once the standard behavior ceases to be disruptive. |
404 // See http://crbug.com/690491. | 404 // See http://crbug.com/690491. |
405 blink::WebString failed_constraint_name = | 405 blink::WebString failed_constraint_name = |
406 blink::WebString::fromASCII(selection_result.failed_constraint_name); | 406 blink::WebString::fromASCII(selection_result.failed_constraint_name()); |
407 blink::WebString device_id_constraint_name = blink::WebString::fromASCII( | 407 blink::WebString device_id_constraint_name = blink::WebString::fromASCII( |
408 user_media_request.videoConstraints().basic().deviceId.name()); | 408 user_media_request.videoConstraints().basic().deviceId.name()); |
409 if (failed_constraint_name.equals(device_id_constraint_name)) { | 409 if (failed_constraint_name.equals(device_id_constraint_name)) { |
410 GetUserMediaRequestFailed(user_media_request, | 410 GetUserMediaRequestFailed(user_media_request, |
411 MEDIA_DEVICE_CONSTRAINT_NOT_SATISFIED, | 411 MEDIA_DEVICE_CONSTRAINT_NOT_SATISFIED, |
412 failed_constraint_name); | 412 failed_constraint_name); |
413 return; | 413 return; |
414 } | 414 } |
415 } | 415 } |
416 FinalizeRequestUserMedia(request_id, user_media_request, std::move(controls), | 416 FinalizeRequestUserMedia(request_id, user_media_request, std::move(controls), |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 sources_waiting_for_callback_.end(), source); | 1246 sources_waiting_for_callback_.end(), source); |
1247 if (found != sources_waiting_for_callback_.end()) | 1247 if (found != sources_waiting_for_callback_.end()) |
1248 OnTrackStarted(source, result, result_name); | 1248 OnTrackStarted(source, result, result_name); |
1249 } | 1249 } |
1250 | 1250 |
1251 void UserMediaClientImpl::OnDestruct() { | 1251 void UserMediaClientImpl::OnDestruct() { |
1252 delete this; | 1252 delete this; |
1253 } | 1253 } |
1254 | 1254 |
1255 } // namespace content | 1255 } // namespace content |
OLD | NEW |