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/pepper/pepper_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "content/common/pepper_plugin_registry.h" | 28 #include "content/common/pepper_plugin_registry.h" |
29 #include "content/common/quota_dispatcher.h" | 29 #include "content/common/quota_dispatcher.h" |
30 #include "content/common/view_messages.h" | 30 #include "content/common/view_messages.h" |
31 #include "content/public/common/content_switches.h" | 31 #include "content/public/common/content_switches.h" |
32 #include "content/public/common/context_menu_params.h" | 32 #include "content/public/common/context_menu_params.h" |
33 #include "content/public/common/media_stream_request.h" | 33 #include "content/public/common/media_stream_request.h" |
34 #include "content/public/common/referrer.h" | 34 #include "content/public/common/referrer.h" |
35 #include "content/public/renderer/content_renderer_client.h" | 35 #include "content/public/renderer/content_renderer_client.h" |
36 #include "content/public/renderer/renderer_restrict_dispatch_group.h" | 36 #include "content/public/renderer/renderer_restrict_dispatch_group.h" |
37 #include "content/renderer/gamepad_shared_memory_reader.h" | 37 #include "content/renderer/gamepad_shared_memory_reader.h" |
38 #include "content/renderer/media/audio_hardware.h" | |
39 #include "content/renderer/media/media_stream_dispatcher.h" | 38 #include "content/renderer/media/media_stream_dispatcher.h" |
40 #include "content/renderer/media/pepper_platform_video_decoder_impl.h" | 39 #include "content/renderer/media/pepper_platform_video_decoder_impl.h" |
| 40 #include "content/renderer/media/renderer_audio_hardware_config.h" |
41 #include "content/renderer/p2p/socket_dispatcher.h" | 41 #include "content/renderer/p2p/socket_dispatcher.h" |
42 #include "content/renderer/pepper/content_renderer_pepper_host_factory.h" | 42 #include "content/renderer/pepper/content_renderer_pepper_host_factory.h" |
43 #include "content/renderer/pepper/pepper_broker_impl.h" | 43 #include "content/renderer/pepper/pepper_broker_impl.h" |
44 #include "content/renderer/pepper/pepper_device_enumeration_event_handler.h" | 44 #include "content/renderer/pepper/pepper_device_enumeration_event_handler.h" |
45 #include "content/renderer/pepper/pepper_hung_plugin_filter.h" | 45 #include "content/renderer/pepper/pepper_hung_plugin_filter.h" |
46 #include "content/renderer/pepper/pepper_in_process_resource_creation.h" | 46 #include "content/renderer/pepper/pepper_in_process_resource_creation.h" |
47 #include "content/renderer/pepper/pepper_platform_audio_input_impl.h" | 47 #include "content/renderer/pepper/pepper_platform_audio_input_impl.h" |
48 #include "content/renderer/pepper/pepper_platform_audio_output_impl.h" | 48 #include "content/renderer/pepper/pepper_platform_audio_output_impl.h" |
49 #include "content/renderer/pepper/pepper_platform_context_3d_impl.h" | 49 #include "content/renderer/pepper/pepper_platform_context_3d_impl.h" |
50 #include "content/renderer/pepper/pepper_platform_image_2d_impl.h" | 50 #include "content/renderer/pepper/pepper_platform_image_2d_impl.h" |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 render_view_->reportFindInPageMatchCount(identifier, total, final_result); | 857 render_view_->reportFindInPageMatchCount(identifier, total, final_result); |
858 } | 858 } |
859 | 859 |
860 void PepperPluginDelegateImpl::SelectedFindResultChanged(int identifier, | 860 void PepperPluginDelegateImpl::SelectedFindResultChanged(int identifier, |
861 int index) { | 861 int index) { |
862 render_view_->reportFindInPageSelection( | 862 render_view_->reportFindInPageSelection( |
863 identifier, index + 1, WebKit::WebRect()); | 863 identifier, index + 1, WebKit::WebRect()); |
864 } | 864 } |
865 | 865 |
866 uint32_t PepperPluginDelegateImpl::GetAudioHardwareOutputSampleRate() { | 866 uint32_t PepperPluginDelegateImpl::GetAudioHardwareOutputSampleRate() { |
867 return static_cast<uint32_t>(GetAudioOutputSampleRate()); | 867 RenderThreadImpl* thread = RenderThreadImpl::current(); |
| 868 return thread->GetAudioHardwareConfig()->GetOutputSampleRate(); |
868 } | 869 } |
869 | 870 |
870 uint32_t PepperPluginDelegateImpl::GetAudioHardwareOutputBufferSize() { | 871 uint32_t PepperPluginDelegateImpl::GetAudioHardwareOutputBufferSize() { |
871 return static_cast<uint32_t>(GetAudioOutputBufferSize()); | 872 RenderThreadImpl* thread = RenderThreadImpl::current(); |
| 873 return thread->GetAudioHardwareConfig()->GetOutputBufferSize(); |
872 } | 874 } |
873 | 875 |
874 webkit::ppapi::PluginDelegate::PlatformAudioOutput* | 876 webkit::ppapi::PluginDelegate::PlatformAudioOutput* |
875 PepperPluginDelegateImpl::CreateAudioOutput( | 877 PepperPluginDelegateImpl::CreateAudioOutput( |
876 uint32_t sample_rate, | 878 uint32_t sample_rate, |
877 uint32_t sample_count, | 879 uint32_t sample_count, |
878 webkit::ppapi::PluginDelegate::PlatformAudioOutputClient* client) { | 880 webkit::ppapi::PluginDelegate::PlatformAudioOutputClient* client) { |
879 return PepperPlatformAudioOutputImpl::Create( | 881 return PepperPlatformAudioOutputImpl::Create( |
880 static_cast<int>(sample_rate), static_cast<int>(sample_count), | 882 static_cast<int>(sample_rate), static_cast<int>(sample_count), |
881 GetRoutingID(), client); | 883 GetRoutingID(), client); |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1640 RenderWidgetFullscreenPepper* container = | 1642 RenderWidgetFullscreenPepper* container = |
1641 static_cast<RenderWidgetFullscreenPepper*>( | 1643 static_cast<RenderWidgetFullscreenPepper*>( |
1642 instance->fullscreen_container()); | 1644 instance->fullscreen_container()); |
1643 return container->mouse_lock_dispatcher(); | 1645 return container->mouse_lock_dispatcher(); |
1644 } else { | 1646 } else { |
1645 return render_view_->mouse_lock_dispatcher(); | 1647 return render_view_->mouse_lock_dispatcher(); |
1646 } | 1648 } |
1647 } | 1649 } |
1648 | 1650 |
1649 } // namespace content | 1651 } // namespace content |
OLD | NEW |