| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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/shell/renderer/layout_test/layout_test_content_renderer_client
.h" | 5 #include "content/shell/renderer/layout_test/layout_test_content_renderer_client
.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/debugger.h" | 9 #include "base/debug/debugger.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 break; | 210 break; |
| 211 case blink::WebAudioLatencyHint::kCategoryBalanced: | 211 case blink::WebAudioLatencyHint::kCategoryBalanced: |
| 212 buffer_size = | 212 buffer_size = |
| 213 media::AudioLatency::GetRtcBufferSize(hw_sample_rate, hw_buffer_size); | 213 media::AudioLatency::GetRtcBufferSize(hw_sample_rate, hw_buffer_size); |
| 214 break; | 214 break; |
| 215 case blink::WebAudioLatencyHint::kCategoryPlayback: | 215 case blink::WebAudioLatencyHint::kCategoryPlayback: |
| 216 buffer_size = | 216 buffer_size = |
| 217 media::AudioLatency::GetHighLatencyBufferSize(hw_sample_rate, 0); | 217 media::AudioLatency::GetHighLatencyBufferSize(hw_sample_rate, 0); |
| 218 break; | 218 break; |
| 219 case blink::WebAudioLatencyHint::kCategoryExact: | 219 case blink::WebAudioLatencyHint::kCategoryExact: |
| 220 // TODO(andrew.macpherson@soundtrap.com): http://crbug.com/708917 | 220 buffer_size = media::AudioLatency::GetExactBufferSize( |
| 221 buffer_size = std::min( | 221 base::TimeDelta::FromSecondsD(latency_hint.Seconds()), hw_sample_rate, |
| 222 4096, media::AudioLatency::GetExactBufferSize( | 222 hw_buffer_size); |
| 223 base::TimeDelta::FromSecondsD(latency_hint.Seconds()), | |
| 224 hw_sample_rate, hw_buffer_size)); | |
| 225 break; | 223 break; |
| 226 default: | 224 default: |
| 227 NOTREACHED(); | 225 NOTREACHED(); |
| 228 break; | 226 break; |
| 229 } | 227 } |
| 230 test_runner::WebTestInterfaces* interfaces = | 228 test_runner::WebTestInterfaces* interfaces = |
| 231 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces(); | 229 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces(); |
| 232 return interfaces->CreateAudioDevice(hw_sample_rate, buffer_size); | 230 return interfaces->CreateAudioDevice(hw_sample_rate, buffer_size); |
| 233 } | 231 } |
| 234 | 232 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 switches::kStableReleaseMode)) { | 266 switches::kStableReleaseMode)) { |
| 269 blink::WebRuntimeFeatures::EnableTestOnlyFeatures(true); | 267 blink::WebRuntimeFeatures::EnableTestOnlyFeatures(true); |
| 270 } | 268 } |
| 271 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 269 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 272 switches::kEnableFontAntialiasing)) { | 270 switches::kEnableFontAntialiasing)) { |
| 273 blink::SetFontAntialiasingEnabledForTest(true); | 271 blink::SetFontAntialiasingEnabledForTest(true); |
| 274 } | 272 } |
| 275 } | 273 } |
| 276 | 274 |
| 277 } // namespace content | 275 } // namespace content |
| OLD | NEW |