Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(703)

Side by Side Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 2750543003: Support AudioContextOptions latencyHint as double. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/renderer_blink_platform_impl.h" 5 #include "content/renderer/renderer_blink_platform_impl.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 661
662 WebAudioDevice* RendererBlinkPlatformImpl::createAudioDevice( 662 WebAudioDevice* RendererBlinkPlatformImpl::createAudioDevice(
663 unsigned input_channels, 663 unsigned input_channels,
664 unsigned channels, 664 unsigned channels,
665 const blink::WebAudioLatencyHint& latency_hint, 665 const blink::WebAudioLatencyHint& latency_hint,
666 WebAudioDevice::RenderCallback* callback, 666 WebAudioDevice::RenderCallback* callback,
667 const blink::WebString& input_device_id, 667 const blink::WebString& input_device_id,
668 const blink::WebSecurityOrigin& security_origin) { 668 const blink::WebSecurityOrigin& security_origin) {
669 // Use a mock for testing. 669 // Use a mock for testing.
670 blink::WebAudioDevice* mock_device = 670 blink::WebAudioDevice* mock_device =
671 GetContentClient()->renderer()->OverrideCreateAudioDevice(); 671 GetContentClient()->renderer()->OverrideCreateAudioDevice(latency_hint);
672 if (mock_device) 672 if (mock_device)
673 return mock_device; 673 return mock_device;
674 674
675 // The |channels| does not exactly identify the channel layout of the 675 // The |channels| does not exactly identify the channel layout of the
676 // device. The switch statement below assigns a best guess to the channel 676 // device. The switch statement below assigns a best guess to the channel
677 // layout based on number of channels. 677 // layout based on number of channels.
678 media::ChannelLayout layout = media::GuessChannelLayout(channels); 678 media::ChannelLayout layout = media::GuessChannelLayout(channels);
679 if (layout == media::CHANNEL_LAYOUT_UNSUPPORTED) 679 if (layout == media::CHANNEL_LAYOUT_UNSUPPORTED)
680 layout = media::CHANNEL_LAYOUT_DISCRETE; 680 layout = media::CHANNEL_LAYOUT_DISCRETE;
681 681
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 //------------------------------------------------------------------------------ 1263 //------------------------------------------------------------------------------
1264 void RendererBlinkPlatformImpl::requestPurgeMemory() { 1264 void RendererBlinkPlatformImpl::requestPurgeMemory() {
1265 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but 1265 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but
1266 // ChildMemoryCoordinator isn't always available as it's only initialized 1266 // ChildMemoryCoordinator isn't always available as it's only initialized
1267 // when kMemoryCoordinatorV0 is enabled. 1267 // when kMemoryCoordinatorV0 is enabled.
1268 // Use ChildMemoryCoordinator when memory coordinator is always enabled. 1268 // Use ChildMemoryCoordinator when memory coordinator is always enabled.
1269 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory(); 1269 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory();
1270 } 1270 }
1271 1271
1272 } // namespace content 1272 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698