| 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/browser/renderer_host/media/audio_renderer_host.h" | 5 #include "content/browser/renderer_host/media/audio_renderer_host.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 } | 487 } |
| 488 | 488 |
| 489 // If enumerator caching is disabled, avoid the enumeration if the default | 489 // If enumerator caching is disabled, avoid the enumeration if the default |
| 490 // device is requested, since no device ID translation is needed. | 490 // device is requested, since no device ID translation is needed. |
| 491 // If enumerator caching is enabled, it is better to use its cache, even | 491 // If enumerator caching is enabled, it is better to use its cache, even |
| 492 // for the default device. | 492 // for the default device. |
| 493 if (IsDefaultDeviceId(device_id) && | 493 if (IsDefaultDeviceId(device_id) && |
| 494 !media_stream_manager_->audio_output_device_enumerator() | 494 !media_stream_manager_->audio_output_device_enumerator() |
| 495 ->IsCacheEnabled()) { | 495 ->IsCacheEnabled()) { |
| 496 base::PostTaskAndReplyWithResult( | 496 base::PostTaskAndReplyWithResult( |
| 497 audio_manager_->GetTaskRunner().get(), FROM_HERE, | 497 audio_manager_->GetTaskRunner(), FROM_HERE, |
| 498 base::Bind(&GetDefaultDeviceInfoOnDeviceThread, audio_manager_), | 498 base::Bind(&GetDefaultDeviceInfoOnDeviceThread, audio_manager_), |
| 499 base::Bind(&AudioRendererHost::OnDeviceIDTranslated, this, stream_id, | 499 base::Bind(&AudioRendererHost::OnDeviceIDTranslated, this, stream_id, |
| 500 true)); | 500 true)); |
| 501 } else { | 501 } else { |
| 502 media_stream_manager_->audio_output_device_enumerator()->Enumerate( | 502 media_stream_manager_->audio_output_device_enumerator()->Enumerate( |
| 503 base::Bind(&AudioRendererHost::TranslateDeviceID, this, device_id, | 503 base::Bind(&AudioRendererHost::TranslateDeviceID, this, device_id, |
| 504 gurl_security_origin, | 504 gurl_security_origin, |
| 505 base::Bind(&AudioRendererHost::OnDeviceIDTranslated, this, | 505 base::Bind(&AudioRendererHost::OnDeviceIDTranslated, this, |
| 506 stream_id))); | 506 stream_id))); |
| 507 } | 507 } |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 callback.Run(false, device_info); | 822 callback.Run(false, device_info); |
| 823 } | 823 } |
| 824 | 824 |
| 825 bool AudioRendererHost::IsAuthorizationStarted(int stream_id) { | 825 bool AudioRendererHost::IsAuthorizationStarted(int stream_id) { |
| 826 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 826 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 827 const auto& i = authorizations_.find(stream_id); | 827 const auto& i = authorizations_.find(stream_id); |
| 828 return i != authorizations_.end(); | 828 return i != authorizations_.end(); |
| 829 } | 829 } |
| 830 | 830 |
| 831 } // namespace content | 831 } // namespace content |
| OLD | NEW |