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 <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 advanced_constraint.renderToAssociatedSink.exact(); | 196 advanced_constraint.renderToAssociatedSink.exact(); |
197 break; | 197 break; |
198 } | 198 } |
199 } | 199 } |
200 } | 200 } |
201 if (user_media_request.video()) { | 201 if (user_media_request.video()) { |
202 controls.video.requested = true; | 202 controls.video.requested = true; |
203 } | 203 } |
204 CopyBlinkRequestToStreamControls(user_media_request, &controls); | 204 CopyBlinkRequestToStreamControls(user_media_request, &controls); |
205 | 205 |
206 security_origin = | 206 security_origin = blink::WebStringToGURL( |
207 blink::WebStringToGURL(user_media_request.securityOrigin().toString()); | 207 user_media_request.getSecurityOrigin().toString()); |
208 DCHECK(render_frame()->GetWebFrame() == | 208 DCHECK(render_frame()->GetWebFrame() == |
209 static_cast<blink::WebFrame*>( | 209 static_cast<blink::WebFrame*>( |
210 user_media_request.ownerDocument().frame())); | 210 user_media_request.ownerDocument().frame())); |
211 } | 211 } |
212 | 212 |
213 DVLOG(1) << "UserMediaClientImpl::requestUserMedia(" << request_id << ", [ " | 213 DVLOG(1) << "UserMediaClientImpl::requestUserMedia(" << request_id << ", [ " |
214 << "audio=" << (controls.audio.requested) | 214 << "audio=" << (controls.audio.requested) |
215 << " select associated sink: " | 215 << " select associated sink: " |
216 << enable_automatic_output_device_selection | 216 << enable_automatic_output_device_selection |
217 << ", video=" << (controls.video.requested) << " ], " | 217 << ", video=" << (controls.video.requested) << " ], " |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 int audio_input_request_id = g_next_request_id++; | 278 int audio_input_request_id = g_next_request_id++; |
279 int video_input_request_id = g_next_request_id++; | 279 int video_input_request_id = g_next_request_id++; |
280 int audio_output_request_id = g_next_request_id++; | 280 int audio_output_request_id = g_next_request_id++; |
281 | 281 |
282 // |media_devices_request| can't be mocked, so in tests it will be empty (the | 282 // |media_devices_request| can't be mocked, so in tests it will be empty (the |
283 // underlying pointer is null). In order to use this function in a test we | 283 // underlying pointer is null). In order to use this function in a test we |
284 // need to check if it isNull. | 284 // need to check if it isNull. |
285 GURL security_origin; | 285 GURL security_origin; |
286 if (!media_devices_request.isNull()) { | 286 if (!media_devices_request.isNull()) { |
287 security_origin = blink::WebStringToGURL( | 287 security_origin = blink::WebStringToGURL( |
288 media_devices_request.securityOrigin().toString()); | 288 media_devices_request.getSecurityOrigin().toString()); |
289 } | 289 } |
290 | 290 |
291 DVLOG(1) << "UserMediaClientImpl::requestMediaDevices(" | 291 DVLOG(1) << "UserMediaClientImpl::requestMediaDevices(" |
292 << audio_input_request_id | 292 << audio_input_request_id |
293 << ", " << video_input_request_id << ", " << audio_output_request_id | 293 << ", " << video_input_request_id << ", " << audio_output_request_id |
294 << ", " << security_origin.spec() << ")"; | 294 << ", " << security_origin.spec() << ")"; |
295 | 295 |
296 media_devices_requests_.push_back(new MediaDevicesRequestInfo( | 296 media_devices_requests_.push_back(new MediaDevicesRequestInfo( |
297 media_devices_request, | 297 media_devices_request, |
298 audio_input_request_id, | 298 audio_input_request_id, |
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1146 return; | 1146 return; |
1147 } | 1147 } |
1148 } | 1148 } |
1149 } | 1149 } |
1150 | 1150 |
1151 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { | 1151 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { |
1152 return !sources_waiting_for_callback_.empty(); | 1152 return !sources_waiting_for_callback_.empty(); |
1153 } | 1153 } |
1154 | 1154 |
1155 } // namespace content | 1155 } // namespace content |
OLD | NEW |