| 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/audio_device_factory.h" | 5 #include "content/renderer/media/audio_device_factory.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // static | 25 // static |
| 26 AudioDeviceFactory* AudioDeviceFactory::factory_ = NULL; | 26 AudioDeviceFactory* AudioDeviceFactory::factory_ = NULL; |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 #if defined(OS_WIN) | 29 #if defined(OS_WIN) |
| 30 // Due to driver deadlock issues on Windows (http://crbug/422522) there is a | 30 // Due to driver deadlock issues on Windows (http://crbug/422522) there is a |
| 31 // chance device authorization response is never received from the browser side. | 31 // chance device authorization response is never received from the browser side. |
| 32 // In this case we will time out, to avoid renderer hang forever waiting for | 32 // In this case we will time out, to avoid renderer hang forever waiting for |
| 33 // device authorization (http://crbug/615589). This will result in "no audio". | 33 // device authorization (http://crbug/615589). This will result in "no audio". |
| 34 const int64_t kMaxAuthorizationTimeoutMs = 1000; | 34 const int64_t kMaxAuthorizationTimeoutMs = 1000; |
| 35 #elif defined(OS_MACOSX) |
| 36 const int64_t kMaxAuthorizationTimeoutMs = 2000; |
| 35 #else | 37 #else |
| 36 const int64_t kMaxAuthorizationTimeoutMs = 0; // No timeout. | 38 const int64_t kMaxAuthorizationTimeoutMs = 0; // No timeout. |
| 37 #endif // defined(OS_WIN) | 39 #endif // defined(OS_WIN) |
| 38 | 40 |
| 39 scoped_refptr<media::AudioOutputDevice> NewOutputDevice( | 41 scoped_refptr<media::AudioOutputDevice> NewOutputDevice( |
| 40 int render_frame_id, | 42 int render_frame_id, |
| 41 int session_id, | 43 int session_id, |
| 42 const std::string& device_id, | 44 const std::string& device_id, |
| 43 const url::Origin& security_origin) { | 45 const url::Origin& security_origin) { |
| 44 AudioMessageFilter* const filter = AudioMessageFilter::Get(); | 46 AudioMessageFilter* const filter = AudioMessageFilter::Get(); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 device_id, security_origin); | 213 device_id, security_origin); |
| 212 if (sink) | 214 if (sink) |
| 213 return sink; | 215 return sink; |
| 214 } | 216 } |
| 215 | 217 |
| 216 return NewOutputDevice(render_frame_id, session_id, device_id, | 218 return NewOutputDevice(render_frame_id, session_id, device_id, |
| 217 security_origin); | 219 security_origin); |
| 218 } | 220 } |
| 219 | 221 |
| 220 } // namespace content | 222 } // namespace content |
| OLD | NEW |