OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/renderer_host/media/audio_output_authorization_handler
.h" | 5 #include "content/browser/renderer_host/media/audio_output_authorization_handler
.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/task_runner_util.h" | 8 #include "base/task_runner_util.h" |
9 #include "content/browser/bad_message.h" | 9 #include "content/browser/bad_message.h" |
10 #include "content/browser/renderer_host/media/audio_input_device_manager.h" | 10 #include "content/browser/renderer_host/media/audio_input_device_manager.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 media::AudioParameters::UnavailableDeviceParams(), std::string()); | 118 media::AudioParameters::UnavailableDeviceParams(), std::string()); |
119 bad_message::ReceivedBadMessage(render_process_id_, | 119 bad_message::ReceivedBadMessage(render_process_id_, |
120 bad_message::AOAH_UNAUTHORIZED_URL); | 120 bad_message::AOAH_UNAUTHORIZED_URL); |
121 return; | 121 return; |
122 } | 122 } |
123 | 123 |
124 // Check that MediaStream device permissions have been granted for | 124 // Check that MediaStream device permissions have been granted for |
125 // nondefault devices. | 125 // nondefault devices. |
126 permission_checker_->CheckPermission( | 126 permission_checker_->CheckPermission( |
127 MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, render_process_id_, render_frame_id, | 127 MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, render_process_id_, render_frame_id, |
128 security_origin, | |
129 base::Bind(&AudioOutputAuthorizationHandler::AccessChecked, | 128 base::Bind(&AudioOutputAuthorizationHandler::AccessChecked, |
130 weak_factory_.GetWeakPtr(), std::move(cb), device_id, | 129 weak_factory_.GetWeakPtr(), std::move(cb), device_id, |
131 security_origin)); | 130 security_origin)); |
132 } | 131 } |
133 | 132 |
134 void AudioOutputAuthorizationHandler::AccessChecked( | 133 void AudioOutputAuthorizationHandler::AccessChecked( |
135 AuthorizationCompletedCallback cb, | 134 AuthorizationCompletedCallback cb, |
136 const std::string& device_id, | 135 const std::string& device_id, |
137 const url::Origin& security_origin, | 136 const url::Origin& security_origin, |
138 bool has_access) const { | 137 bool has_access) const { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 198 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
200 DCHECK(!raw_device_id.empty()); | 199 DCHECK(!raw_device_id.empty()); |
201 | 200 |
202 cb.Run(media::OUTPUT_DEVICE_STATUS_OK, should_send_id, | 201 cb.Run(media::OUTPUT_DEVICE_STATUS_OK, should_send_id, |
203 output_params.IsValid() ? output_params | 202 output_params.IsValid() ? output_params |
204 : TryToFixAudioParameters(output_params), | 203 : TryToFixAudioParameters(output_params), |
205 raw_device_id); | 204 raw_device_id); |
206 } | 205 } |
207 | 206 |
208 } // namespace content | 207 } // namespace content |
OLD | NEW |