OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper_plugin_delegate_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "content/common/pepper_file_messages.h" | 24 #include "content/common/pepper_file_messages.h" |
25 #include "content/common/pepper_plugin_registry.h" | 25 #include "content/common/pepper_plugin_registry.h" |
26 #include "content/common/pepper_messages.h" | 26 #include "content/common/pepper_messages.h" |
27 #include "content/common/view_messages.h" | 27 #include "content/common/view_messages.h" |
28 #include "content/renderer/content_renderer_client.h" | 28 #include "content/renderer/content_renderer_client.h" |
29 #include "content/renderer/gpu/command_buffer_proxy.h" | 29 #include "content/renderer/gpu/command_buffer_proxy.h" |
30 #include "content/renderer/gpu/gpu_channel_host.h" | 30 #include "content/renderer/gpu/gpu_channel_host.h" |
31 #include "content/renderer/gpu/renderer_gl_context.h" | 31 #include "content/renderer/gpu/renderer_gl_context.h" |
32 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" | 32 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" |
33 #include "content/renderer/media/audio_message_filter.h" | 33 #include "content/renderer/media/audio_message_filter.h" |
| 34 #include "content/renderer/media/audio_message_filter_creator.h" |
34 #include "content/renderer/p2p/p2p_transport_impl.h" | 35 #include "content/renderer/p2p/p2p_transport_impl.h" |
35 #include "content/renderer/pepper_platform_context_3d_impl.h" | 36 #include "content/renderer/pepper_platform_context_3d_impl.h" |
36 #include "content/renderer/pepper_platform_video_decoder_impl.h" | 37 #include "content/renderer/pepper_platform_video_decoder_impl.h" |
37 #include "content/renderer/render_thread.h" | 38 #include "content/renderer/render_thread.h" |
38 #include "content/renderer/render_view.h" | 39 #include "content/renderer/render_view.h" |
39 #include "content/renderer/render_widget_fullscreen_pepper.h" | 40 #include "content/renderer/render_widget_fullscreen_pepper.h" |
40 #include "content/renderer/webplugin_delegate_proxy.h" | 41 #include "content/renderer/webplugin_delegate_proxy.h" |
41 #include "ipc/ipc_channel_handle.h" | 42 #include "ipc/ipc_channel_handle.h" |
42 #include "ppapi/c/dev/pp_video_dev.h" | 43 #include "ppapi/c/dev/pp_video_dev.h" |
43 #include "ppapi/c/pp_errors.h" | 44 #include "ppapi/c/pp_errors.h" |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 int index) { | 844 int index) { |
844 render_view_->reportFindInPageSelection( | 845 render_view_->reportFindInPageSelection( |
845 identifier, index + 1, WebKit::WebRect()); | 846 identifier, index + 1, WebKit::WebRect()); |
846 } | 847 } |
847 | 848 |
848 webkit::ppapi::PluginDelegate::PlatformAudio* | 849 webkit::ppapi::PluginDelegate::PlatformAudio* |
849 PepperPluginDelegateImpl::CreateAudio( | 850 PepperPluginDelegateImpl::CreateAudio( |
850 uint32_t sample_rate, uint32_t sample_count, | 851 uint32_t sample_rate, uint32_t sample_count, |
851 webkit::ppapi::PluginDelegate::PlatformAudio::Client* client) { | 852 webkit::ppapi::PluginDelegate::PlatformAudio::Client* client) { |
852 scoped_refptr<PlatformAudioImpl> audio( | 853 scoped_refptr<PlatformAudioImpl> audio( |
853 new PlatformAudioImpl(render_view_->audio_message_filter())); | 854 new PlatformAudioImpl(AudioMessageFilterCreator::SharedFilter())); |
854 if (audio->Initialize(sample_rate, sample_count, client)) { | 855 if (audio->Initialize(sample_rate, sample_count, client)) { |
855 // Balanced by Release invoked in PlatformAudioImpl::ShutDownOnIOThread(). | 856 // Balanced by Release invoked in PlatformAudioImpl::ShutDownOnIOThread(). |
856 return audio.release(); | 857 return audio.release(); |
857 } else { | 858 } else { |
858 return NULL; | 859 return NULL; |
859 } | 860 } |
860 } | 861 } |
861 | 862 |
862 // If a broker has not already been created for this plugin, creates one. | 863 // If a broker has not already been created for this plugin, creates one. |
863 webkit::ppapi::PluginDelegate::PpapiBroker* | 864 webkit::ppapi::PluginDelegate::PpapiBroker* |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1328 if (!base::SharedMemory::IsHandleValid(handle)) { | 1329 if (!base::SharedMemory::IsHandleValid(handle)) { |
1329 DLOG(WARNING) << "Browser failed to allocate shared memory"; | 1330 DLOG(WARNING) << "Browser failed to allocate shared memory"; |
1330 return NULL; | 1331 return NULL; |
1331 } | 1332 } |
1332 return new base::SharedMemory(handle, false); | 1333 return new base::SharedMemory(handle, false); |
1333 } | 1334 } |
1334 | 1335 |
1335 ppapi::Preferences PepperPluginDelegateImpl::GetPreferences() { | 1336 ppapi::Preferences PepperPluginDelegateImpl::GetPreferences() { |
1336 return ppapi::Preferences(render_view_->webkit_preferences()); | 1337 return ppapi::Preferences(render_view_->webkit_preferences()); |
1337 } | 1338 } |
OLD | NEW |