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_platform_audio_input_impl.h" | 45 #include "content/renderer/pepper/pepper_platform_audio_input_impl.h" |
45 #include "content/renderer/pepper/pepper_platform_audio_output_impl.h" | 46 #include "content/renderer/pepper/pepper_platform_audio_output_impl.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
252 plugin_process_handle, | 253 plugin_process_handle, |
253 channel_handle, | 254 channel_handle, |
254 module->pp_module(), | 255 module->pp_module(), |
255 webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(), | 256 webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(), |
256 GetPreferences())) | 257 GetPreferences())) |
257 return scoped_refptr<webkit::ppapi::PluginModule>(); | 258 return scoped_refptr<webkit::ppapi::PluginModule>(); |
258 module->InitAsProxied(dispatcher.release()); | 259 module->InitAsProxied(dispatcher.release()); |
259 return module; | 260 return module; |
260 } | 261 } |
261 | 262 |
263 scoped_refptr<webkit::ppapi::PluginModule> | |
264 PepperPluginDelegateImpl::CreateBrowserPluginModule( | |
265 base::ProcessHandle process_handle, | |
266 const IPC::ChannelHandle& channel_handle) { | |
267 // Create a new HostDispatcher for the proxying, and hook it to a new | |
268 // PluginModule. Note that AddLiveModule must be called before any early | |
jam
2012/04/06 21:05:23
? you're not calling AddLiveModule
Fady Samuel
2012/04/06 22:46:32
This began as a copy-and-paste and trimming of Cre
| |
269 // returns since the module's destructor will remove itself. | |
270 scoped_refptr<webkit::ppapi::PluginModule> module = | |
271 new webkit::ppapi::PluginModule(kBrowserPluginName, | |
272 FilePath(kBrowserPluginPath), | |
273 NULL /* lifetime delegate */); | |
274 | |
275 scoped_ptr<HostDispatcherWrapper> dispatcher(new HostDispatcherWrapper); | |
276 if (!dispatcher->Init( | |
277 process_handle, | |
278 channel_handle, | |
279 module->pp_module(), | |
280 webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(), | |
281 GetPreferences())) | |
282 return scoped_refptr<webkit::ppapi::PluginModule>(); | |
283 module->InitAsProxied(dispatcher.release()); | |
284 return module; | |
285 } | |
286 | |
262 scoped_refptr<PepperBrokerImpl> PepperPluginDelegateImpl::CreateBroker( | 287 scoped_refptr<PepperBrokerImpl> PepperPluginDelegateImpl::CreateBroker( |
263 webkit::ppapi::PluginModule* plugin_module) { | 288 webkit::ppapi::PluginModule* plugin_module) { |
264 DCHECK(plugin_module); | 289 DCHECK(plugin_module); |
265 DCHECK(!plugin_module->GetBroker()); | 290 DCHECK(!plugin_module->GetBroker()); |
266 | 291 |
267 // The broker path is the same as the plugin. | 292 // The broker path is the same as the plugin. |
268 const FilePath& broker_path = plugin_module->path(); | 293 const FilePath& broker_path = plugin_module->path(); |
269 | 294 |
270 scoped_refptr<PepperBrokerImpl> broker = | 295 scoped_refptr<PepperBrokerImpl> broker = |
271 new PepperBrokerImpl(plugin_module, this); | 296 new PepperBrokerImpl(plugin_module, this); |
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1609 mouse_lock_instances_.erase(it); | 1634 mouse_lock_instances_.erase(it); |
1610 } | 1635 } |
1611 } | 1636 } |
1612 | 1637 |
1613 webkit_glue::ClipboardClient* | 1638 webkit_glue::ClipboardClient* |
1614 PepperPluginDelegateImpl::CreateClipboardClient() const { | 1639 PepperPluginDelegateImpl::CreateClipboardClient() const { |
1615 return new RendererClipboardClient; | 1640 return new RendererClipboardClient; |
1616 } | 1641 } |
1617 | 1642 |
1618 } // namespace content | 1643 } // namespace content |
OLD | NEW |