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

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

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

Powered by Google App Engine
This is Rietveld 408576698