OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_privat
e_api.h" | 5 #include "chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_privat
e_api.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 SendResponse(true); | 295 SendResponse(true); |
296 } | 296 } |
297 | 297 |
298 WebrtcAudioPrivateSetAudioExperimentsFunction:: | 298 WebrtcAudioPrivateSetAudioExperimentsFunction:: |
299 WebrtcAudioPrivateSetAudioExperimentsFunction() {} | 299 WebrtcAudioPrivateSetAudioExperimentsFunction() {} |
300 | 300 |
301 WebrtcAudioPrivateSetAudioExperimentsFunction:: | 301 WebrtcAudioPrivateSetAudioExperimentsFunction:: |
302 ~WebrtcAudioPrivateSetAudioExperimentsFunction() {} | 302 ~WebrtcAudioPrivateSetAudioExperimentsFunction() {} |
303 | 303 |
304 bool WebrtcAudioPrivateSetAudioExperimentsFunction::RunAsync() { | 304 bool WebrtcAudioPrivateSetAudioExperimentsFunction::RunAsync() { |
| 305 #if BUILDFLAG(ENABLE_WEBRTC) |
305 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 306 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
306 std::unique_ptr<wap::SetAudioExperiments::Params> params( | 307 std::unique_ptr<wap::SetAudioExperiments::Params> params( |
307 wap::SetAudioExperiments::Params::Create(*args_)); | 308 wap::SetAudioExperiments::Params::Create(*args_)); |
308 EXTENSION_FUNCTION_VALIDATE(params.get()); | 309 EXTENSION_FUNCTION_VALIDATE(params.get()); |
309 | 310 |
310 if (params->audio_experiments.enable_aec3.get()) { | 311 if (params->audio_experiments.enable_aec3.get()) { |
311 content::RenderProcessHost* host = GetRenderProcessHostFromRequest( | 312 content::RenderProcessHost* host = GetRenderProcessHostFromRequest( |
312 params->request, params->security_origin); | 313 params->request, params->security_origin); |
313 if (!host) { | 314 if (!host) { |
314 SendResponse(false); | 315 SendResponse(false); |
315 return false; | 316 return false; |
316 } | 317 } |
317 | 318 |
318 host->SetEchoCanceller3(*params->audio_experiments.enable_aec3); | 319 host->SetEchoCanceller3(*params->audio_experiments.enable_aec3); |
319 } | 320 } |
320 | 321 |
321 SendResponse(true); | 322 SendResponse(true); |
322 return true; | 323 return true; |
| 324 #else |
| 325 SetError("Not supported"); |
| 326 SendResponse(false); |
| 327 return false; |
| 328 #endif |
323 } | 329 } |
324 | 330 |
325 } // namespace extensions | 331 } // namespace extensions |
OLD | NEW |