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