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 15 matching lines...) Expand all Loading... |
26 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 26 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
27 #include "content/common/pepper_file_messages.h" | 27 #include "content/common/pepper_file_messages.h" |
28 #include "content/common/pepper_plugin_registry.h" | 28 #include "content/common/pepper_plugin_registry.h" |
29 #include "content/common/pepper_messages.h" | 29 #include "content/common/pepper_messages.h" |
30 #include "content/common/quota_dispatcher.h" | 30 #include "content/common/quota_dispatcher.h" |
31 #include "content/common/view_messages.h" | 31 #include "content/common/view_messages.h" |
32 #include "content/public/common/content_switches.h" | 32 #include "content/public/common/content_switches.h" |
33 #include "content/public/common/context_menu_params.h" | 33 #include "content/public/common/context_menu_params.h" |
34 #include "content/public/common/media_stream_request.h" | 34 #include "content/public/common/media_stream_request.h" |
35 #include "content/public/renderer/content_renderer_client.h" | 35 #include "content/public/renderer/content_renderer_client.h" |
| 36 #include "content/renderer/browser_plugin/browser_plugin_constants.h" |
36 #include "content/renderer/gamepad_shared_memory_reader.h" | 37 #include "content/renderer/gamepad_shared_memory_reader.h" |
37 #include "content/renderer/media/audio_hardware.h" | 38 #include "content/renderer/media/audio_hardware.h" |
38 #include "content/renderer/media/media_stream_dispatcher.h" | 39 #include "content/renderer/media/media_stream_dispatcher.h" |
39 #include "content/renderer/media/pepper_platform_video_decoder_impl.h" | 40 #include "content/renderer/media/pepper_platform_video_decoder_impl.h" |
40 #include "content/renderer/p2p/p2p_transport_impl.h" | 41 #include "content/renderer/p2p/p2p_transport_impl.h" |
41 #include "content/renderer/p2p/socket_dispatcher.h" | 42 #include "content/renderer/p2p/socket_dispatcher.h" |
42 #include "content/renderer/pepper/pepper_broker_impl.h" | 43 #include "content/renderer/pepper/pepper_broker_impl.h" |
43 #include "content/renderer/pepper/pepper_device_enumeration_event_handler.h" | 44 #include "content/renderer/pepper/pepper_device_enumeration_event_handler.h" |
44 #include "content/renderer/pepper/pepper_hung_plugin_filter.h" | 45 #include "content/renderer/pepper/pepper_hung_plugin_filter.h" |
45 #include "content/renderer/pepper/pepper_platform_audio_input_impl.h" | 46 #include "content/renderer/pepper/pepper_platform_audio_input_impl.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 channel_handle, | 258 channel_handle, |
258 module->pp_module(), | 259 module->pp_module(), |
259 webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(), | 260 webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(), |
260 GetPreferences(), | 261 GetPreferences(), |
261 hung_filter.get())) | 262 hung_filter.get())) |
262 return scoped_refptr<webkit::ppapi::PluginModule>(); | 263 return scoped_refptr<webkit::ppapi::PluginModule>(); |
263 module->InitAsProxied(dispatcher.release()); | 264 module->InitAsProxied(dispatcher.release()); |
264 return module; | 265 return module; |
265 } | 266 } |
266 | 267 |
| 268 scoped_refptr<webkit::ppapi::PluginModule> |
| 269 PepperPluginDelegateImpl::CreateBrowserPluginModule( |
| 270 const IPC::ChannelHandle& channel_handle, |
| 271 int guest_process_id) { |
| 272 BrowserPluginRegistry* registry = |
| 273 RenderThreadImpl::current()->browser_plugin_registry(); |
| 274 scoped_refptr<webkit::ppapi::PluginModule> module = |
| 275 registry->GetModule(guest_process_id); |
| 276 if (module) |
| 277 return module; |
| 278 |
| 279 scoped_refptr<PepperHungPluginFilter> hung_filter( |
| 280 new PepperHungPluginFilter(FilePath(kBrowserPluginPath), |
| 281 render_view_->routing_id(), |
| 282 guest_process_id)); |
| 283 // Create a new HostDispatcher for the proxying, and hook it to a new |
| 284 // PluginModule. |
| 285 module = new webkit::ppapi::PluginModule(kBrowserPluginName, |
| 286 FilePath(kBrowserPluginPath), |
| 287 registry); |
| 288 RenderThreadImpl::current()->browser_plugin_registry()->AddModule( |
| 289 guest_process_id, module); |
| 290 scoped_ptr<HostDispatcherWrapper> dispatcher(new HostDispatcherWrapper); |
| 291 if (!dispatcher->Init( |
| 292 channel_handle, |
| 293 module->pp_module(), |
| 294 webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(), |
| 295 GetPreferences(), |
| 296 hung_filter.get())) |
| 297 return scoped_refptr<webkit::ppapi::PluginModule>(); |
| 298 module->InitAsProxied(dispatcher.release()); |
| 299 return module; |
| 300 } |
| 301 |
267 scoped_refptr<PepperBrokerImpl> PepperPluginDelegateImpl::CreateBroker( | 302 scoped_refptr<PepperBrokerImpl> PepperPluginDelegateImpl::CreateBroker( |
268 webkit::ppapi::PluginModule* plugin_module) { | 303 webkit::ppapi::PluginModule* plugin_module) { |
269 DCHECK(plugin_module); | 304 DCHECK(plugin_module); |
270 DCHECK(!plugin_module->GetBroker()); | 305 DCHECK(!plugin_module->GetBroker()); |
271 | 306 |
272 // The broker path is the same as the plugin. | 307 // The broker path is the same as the plugin. |
273 const FilePath& broker_path = plugin_module->path(); | 308 const FilePath& broker_path = plugin_module->path(); |
274 | 309 |
275 scoped_refptr<PepperBrokerImpl> broker = | 310 scoped_refptr<PepperBrokerImpl> broker = |
276 new PepperBrokerImpl(plugin_module, this); | 311 new PepperBrokerImpl(plugin_module, this); |
(...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1623 mouse_lock_instances_.erase(it); | 1658 mouse_lock_instances_.erase(it); |
1624 } | 1659 } |
1625 } | 1660 } |
1626 | 1661 |
1627 webkit_glue::ClipboardClient* | 1662 webkit_glue::ClipboardClient* |
1628 PepperPluginDelegateImpl::CreateClipboardClient() const { | 1663 PepperPluginDelegateImpl::CreateClipboardClient() const { |
1629 return new RendererClipboardClient; | 1664 return new RendererClipboardClient; |
1630 } | 1665 } |
1631 | 1666 |
1632 } // namespace content | 1667 } // namespace content |
OLD | NEW |