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

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

Issue 2750543003: Support AudioContextOptions latencyHint as double. (Closed)
Patch Set: Fix audiocontextoptions LayoutTest. Created 3 years, 8 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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 666
667 WebAudioDevice* RendererBlinkPlatformImpl::createAudioDevice( 667 WebAudioDevice* RendererBlinkPlatformImpl::createAudioDevice(
668 unsigned input_channels, 668 unsigned input_channels,
669 unsigned channels, 669 unsigned channels,
670 const blink::WebAudioLatencyHint& latency_hint, 670 const blink::WebAudioLatencyHint& latency_hint,
671 WebAudioDevice::RenderCallback* callback, 671 WebAudioDevice::RenderCallback* callback,
672 const blink::WebString& input_device_id, 672 const blink::WebString& input_device_id,
673 const blink::WebSecurityOrigin& security_origin) { 673 const blink::WebSecurityOrigin& security_origin) {
674 // Use a mock for testing. 674 // Use a mock for testing.
675 blink::WebAudioDevice* mock_device = 675 blink::WebAudioDevice* mock_device =
676 GetContentClient()->renderer()->OverrideCreateAudioDevice(); 676 GetContentClient()->renderer()->OverrideCreateAudioDevice(latency_hint);
677 if (mock_device) 677 if (mock_device)
678 return mock_device; 678 return mock_device;
679 679
680 // The |channels| does not exactly identify the channel layout of the 680 // The |channels| does not exactly identify the channel layout of the
681 // device. The switch statement below assigns a best guess to the channel 681 // device. The switch statement below assigns a best guess to the channel
682 // layout based on number of channels. 682 // layout based on number of channels.
683 media::ChannelLayout layout = media::GuessChannelLayout(channels); 683 media::ChannelLayout layout = media::GuessChannelLayout(channels);
684 if (layout == media::CHANNEL_LAYOUT_UNSUPPORTED) 684 if (layout == media::CHANNEL_LAYOUT_UNSUPPORTED)
685 layout = media::CHANNEL_LAYOUT_DISCRETE; 685 layout = media::CHANNEL_LAYOUT_DISCRETE;
686 686
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 //------------------------------------------------------------------------------ 1272 //------------------------------------------------------------------------------
1273 void RendererBlinkPlatformImpl::requestPurgeMemory() { 1273 void RendererBlinkPlatformImpl::requestPurgeMemory() {
1274 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but 1274 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but
1275 // ChildMemoryCoordinator isn't always available as it's only initialized 1275 // ChildMemoryCoordinator isn't always available as it's only initialized
1276 // when kMemoryCoordinatorV0 is enabled. 1276 // when kMemoryCoordinatorV0 is enabled.
1277 // Use ChildMemoryCoordinator when memory coordinator is always enabled. 1277 // Use ChildMemoryCoordinator when memory coordinator is always enabled.
1278 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory(); 1278 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory();
1279 } 1279 }
1280 1280
1281 } // namespace content 1281 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698