| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // empty string as the current device ID. | 115 // empty string as the current device ID. |
| 116 if (media::AudioDeviceDescription::IsDefaultDevice(raw_id)) | 116 if (media::AudioDeviceDescription::IsDefaultDevice(raw_id)) |
| 117 return media::AudioDeviceDescription::kDefaultDeviceId; | 117 return media::AudioDeviceDescription::kDefaultDeviceId; |
| 118 | 118 |
| 119 url::Origin security_origin(source_url().GetOrigin()); | 119 url::Origin security_origin(source_url().GetOrigin()); |
| 120 return content::GetHMACForMediaDeviceID(device_id_salt(), security_origin, | 120 return content::GetHMACForMediaDeviceID(device_id_salt(), security_origin, |
| 121 raw_id); | 121 raw_id); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void WebrtcAudioPrivateFunction::InitDeviceIDSalt() { | 124 void WebrtcAudioPrivateFunction::InitDeviceIDSalt() { |
| 125 device_id_salt_ = GetProfile()->GetResourceContext()->GetMediaDeviceIDSalt(); | 125 device_id_salt_ = GetProfile()->GetMediaDeviceIDSalt(); |
| 126 } | 126 } |
| 127 | 127 |
| 128 std::string WebrtcAudioPrivateFunction::device_id_salt() const { | 128 std::string WebrtcAudioPrivateFunction::device_id_salt() const { |
| 129 return device_id_salt_; | 129 return device_id_salt_; |
| 130 } | 130 } |
| 131 | 131 |
| 132 // TODO(hlundin): Stolen from WebrtcLoggingPrivateFunction. | 132 // TODO(hlundin): Stolen from WebrtcLoggingPrivateFunction. |
| 133 // Consolidate and improve. http://crbug.com/710371 | 133 // Consolidate and improve. http://crbug.com/710371 |
| 134 content::RenderProcessHost* | 134 content::RenderProcessHost* |
| 135 WebrtcAudioPrivateFunction::GetRenderProcessHostFromRequest( | 135 WebrtcAudioPrivateFunction::GetRenderProcessHostFromRequest( |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 } | 316 } |
| 317 | 317 |
| 318 host->SetEchoCanceller3(*params->audio_experiments.enable_aec3); | 318 host->SetEchoCanceller3(*params->audio_experiments.enable_aec3); |
| 319 } | 319 } |
| 320 | 320 |
| 321 SendResponse(true); | 321 SendResponse(true); |
| 322 return true; | 322 return true; |
| 323 } | 323 } |
| 324 | 324 |
| 325 } // namespace extensions | 325 } // namespace extensions |
| OLD | NEW |