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_blink_platform_impl.h" | 5 #include "content/renderer/renderer_blink_platform_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" | 91 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" |
92 #include "third_party/WebKit/public/platform/WebURL.h" | 92 #include "third_party/WebKit/public/platform/WebURL.h" |
93 #include "third_party/WebKit/public/platform/WebVector.h" | 93 #include "third_party/WebKit/public/platform/WebVector.h" |
94 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eMotionListener.h" | 94 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eMotionListener.h" |
95 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eOrientationListener.h" | 95 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eOrientationListener.h" |
96 #include "ui/gfx/color_profile.h" | 96 #include "ui/gfx/color_profile.h" |
97 #include "url/gurl.h" | 97 #include "url/gurl.h" |
98 | 98 |
99 #if defined(OS_ANDROID) | 99 #if defined(OS_ANDROID) |
100 #include "content/renderer/android/synchronous_compositor_factory.h" | 100 #include "content/renderer/android/synchronous_compositor_factory.h" |
101 #include "content/renderer/media/android/audio_decoder_android.h" | |
102 #include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h" | 101 #include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h" |
103 #endif | 102 #endif |
104 | 103 |
105 #if defined(OS_MACOSX) | 104 #if defined(OS_MACOSX) |
106 #include "content/common/mac/font_descriptor.h" | 105 #include "content/common/mac/font_descriptor.h" |
107 #include "content/common/mac/font_loader.h" | 106 #include "content/common/mac/font_loader.h" |
108 #include "content/renderer/webscrollbarbehavior_impl_mac.h" | 107 #include "content/renderer/webscrollbarbehavior_impl_mac.h" |
109 #include "third_party/WebKit/public/platform/mac/WebSandboxSupport.h" | 108 #include "third_party/WebKit/public/platform/mac/WebSandboxSupport.h" |
110 #endif | 109 #endif |
111 | 110 |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 // For CHANNEL_LAYOUT_DISCRETE, pass the explicit channel count along with | 745 // For CHANNEL_LAYOUT_DISCRETE, pass the explicit channel count along with |
747 // the channel layout when creating an |AudioParameters| object. | 746 // the channel layout when creating an |AudioParameters| object. |
748 media::AudioParameters params(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, | 747 media::AudioParameters params(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, |
749 layout, static_cast<int>(sample_rate), 16, | 748 layout, static_cast<int>(sample_rate), 16, |
750 buffer_size); | 749 buffer_size); |
751 params.set_channels_for_discrete(channels); | 750 params.set_channels_for_discrete(channels); |
752 | 751 |
753 return new RendererWebAudioDeviceImpl(params, callback, session_id); | 752 return new RendererWebAudioDeviceImpl(params, callback, session_id); |
754 } | 753 } |
755 | 754 |
756 #if defined(OS_ANDROID) | |
757 bool RendererBlinkPlatformImpl::loadAudioResource( | 755 bool RendererBlinkPlatformImpl::loadAudioResource( |
758 blink::WebAudioBus* destination_bus, | 756 blink::WebAudioBus* destination_bus, |
759 const char* audio_file_data, | 757 const char* audio_file_data, |
760 size_t data_size) { | |
761 return DecodeAudioFileData(destination_bus, | |
762 audio_file_data, | |
763 data_size, | |
764 thread_safe_sender_); | |
765 } | |
766 #else | |
767 bool RendererBlinkPlatformImpl::loadAudioResource( | |
768 blink::WebAudioBus* destination_bus, | |
769 const char* audio_file_data, | |
770 size_t data_size) { | 758 size_t data_size) { |
771 return DecodeAudioFileData( | 759 return DecodeAudioFileData( |
772 destination_bus, audio_file_data, data_size); | 760 destination_bus, audio_file_data, data_size); |
773 } | 761 } |
774 #endif // defined(OS_ANDROID) | |
775 | 762 |
776 //------------------------------------------------------------------------------ | 763 //------------------------------------------------------------------------------ |
777 | 764 |
778 blink::WebMIDIAccessor* RendererBlinkPlatformImpl::createMIDIAccessor( | 765 blink::WebMIDIAccessor* RendererBlinkPlatformImpl::createMIDIAccessor( |
779 blink::WebMIDIAccessorClient* client) { | 766 blink::WebMIDIAccessorClient* client) { |
780 blink::WebMIDIAccessor* accessor = | 767 blink::WebMIDIAccessor* accessor = |
781 GetContentClient()->renderer()->OverrideCreateMIDIAccessor(client); | 768 GetContentClient()->renderer()->OverrideCreateMIDIAccessor(client); |
782 if (accessor) | 769 if (accessor) |
783 return accessor; | 770 return accessor; |
784 | 771 |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 //------------------------------------------------------------------------------ | 1275 //------------------------------------------------------------------------------ |
1289 | 1276 |
1290 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( | 1277 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( |
1291 const blink::WebBatteryStatus& status) { | 1278 const blink::WebBatteryStatus& status) { |
1292 if (!g_test_battery_status_listener) | 1279 if (!g_test_battery_status_listener) |
1293 return; | 1280 return; |
1294 g_test_battery_status_listener->updateBatteryStatus(status); | 1281 g_test_battery_status_listener->updateBatteryStatus(status); |
1295 } | 1282 } |
1296 | 1283 |
1297 } // namespace content | 1284 } // namespace content |
OLD | NEW |