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/renderer_webkitplatformsupport_impl.h" | 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 } | 773 } |
774 | 774 |
775 WebAudioDevice* | 775 WebAudioDevice* |
776 RendererWebKitPlatformSupportImpl::createAudioDevice( | 776 RendererWebKitPlatformSupportImpl::createAudioDevice( |
777 size_t buffer_size, | 777 size_t buffer_size, |
778 unsigned input_channels, | 778 unsigned input_channels, |
779 unsigned channels, | 779 unsigned channels, |
780 double sample_rate, | 780 double sample_rate, |
781 WebAudioDevice::RenderCallback* callback, | 781 WebAudioDevice::RenderCallback* callback, |
782 const WebKit::WebString& input_device_id) { | 782 const WebKit::WebString& input_device_id) { |
| 783 // Use a mock for testing. |
| 784 WebKit::WebAudioDevice* mock_device = |
| 785 GetContentClient()->renderer()->OverrideCreateAudioDevice(sample_rate); |
| 786 if (mock_device) |
| 787 return mock_device; |
| 788 |
783 // The |channels| does not exactly identify the channel layout of the | 789 // The |channels| does not exactly identify the channel layout of the |
784 // device. The switch statement below assigns a best guess to the channel | 790 // device. The switch statement below assigns a best guess to the channel |
785 // layout based on number of channels. | 791 // layout based on number of channels. |
786 // TODO(crogers): WebKit should give the channel layout instead of the hard | 792 // TODO(crogers): WebKit should give the channel layout instead of the hard |
787 // channel count. | 793 // channel count. |
788 media::ChannelLayout layout = media::CHANNEL_LAYOUT_UNSUPPORTED; | 794 media::ChannelLayout layout = media::CHANNEL_LAYOUT_UNSUPPORTED; |
789 switch (channels) { | 795 switch (channels) { |
790 case 1: | 796 case 1: |
791 layout = media::CHANNEL_LAYOUT_MONO; | 797 layout = media::CHANNEL_LAYOUT_MONO; |
792 break; | 798 break; |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 | 1056 |
1051 //------------------------------------------------------------------------------ | 1057 //------------------------------------------------------------------------------ |
1052 | 1058 |
1053 WebKit::WebString RendererWebKitPlatformSupportImpl::convertIDNToUnicode( | 1059 WebKit::WebString RendererWebKitPlatformSupportImpl::convertIDNToUnicode( |
1054 const WebKit::WebString& host, | 1060 const WebKit::WebString& host, |
1055 const WebKit::WebString& languages) { | 1061 const WebKit::WebString& languages) { |
1056 return net::IDNToUnicode(host.utf8(), languages.utf8()); | 1062 return net::IDNToUnicode(host.utf8(), languages.utf8()); |
1057 } | 1063 } |
1058 | 1064 |
1059 } // namespace content | 1065 } // namespace content |
OLD | NEW |