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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 channel_handle, | 260 channel_handle, |
261 module->pp_module(), | 261 module->pp_module(), |
262 webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(), | 262 webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(), |
263 GetPreferences(), | 263 GetPreferences(), |
264 hung_filter.get())) | 264 hung_filter.get())) |
265 return scoped_refptr<webkit::ppapi::PluginModule>(); | 265 return scoped_refptr<webkit::ppapi::PluginModule>(); |
266 module->InitAsProxied(dispatcher.release()); | 266 module->InitAsProxied(dispatcher.release()); |
267 return module; | 267 return module; |
268 } | 268 } |
269 | 269 |
| 270 void PepperPluginDelegateImpl::CreatePepperHostDispatcher( |
| 271 const FilePath& plugin_path, |
| 272 int plugin_child_id, |
| 273 base::ProcessHandle plugin_process_handle, |
| 274 const IPC::ChannelHandle& channel_handle) { |
| 275 webkit::ppapi::PluginModule* module = |
| 276 PepperPluginRegistry::GetInstance()->GetLiveModule(plugin_path); |
| 277 scoped_refptr<PepperHungPluginFilter> hung_filter( |
| 278 new PepperHungPluginFilter(plugin_path, render_view_->routing_id(), |
| 279 plugin_child_id)); |
| 280 scoped_ptr<HostDispatcherWrapper> dispatcher(new HostDispatcherWrapper); |
| 281 if (dispatcher->Init( |
| 282 plugin_process_handle, |
| 283 channel_handle.name, |
| 284 module->pp_module(), |
| 285 webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(), |
| 286 GetPreferences(), |
| 287 hung_filter.get())) { |
| 288 module->InitAsProxied(dispatcher.release()); |
| 289 } |
| 290 } |
| 291 |
270 scoped_refptr<PepperBrokerImpl> PepperPluginDelegateImpl::CreateBroker( | 292 scoped_refptr<PepperBrokerImpl> PepperPluginDelegateImpl::CreateBroker( |
271 webkit::ppapi::PluginModule* plugin_module) { | 293 webkit::ppapi::PluginModule* plugin_module) { |
272 DCHECK(plugin_module); | 294 DCHECK(plugin_module); |
273 DCHECK(!plugin_module->GetBroker()); | 295 DCHECK(!plugin_module->GetBroker()); |
274 | 296 |
275 // The broker path is the same as the plugin. | 297 // The broker path is the same as the plugin. |
276 const FilePath& broker_path = plugin_module->path(); | 298 const FilePath& broker_path = plugin_module->path(); |
277 | 299 |
278 scoped_refptr<PepperBrokerImpl> broker = | 300 scoped_refptr<PepperBrokerImpl> broker = |
279 new PepperBrokerImpl(plugin_module, this); | 301 new PepperBrokerImpl(plugin_module, this); |
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1622 mouse_lock_instances_.erase(it); | 1644 mouse_lock_instances_.erase(it); |
1623 } | 1645 } |
1624 } | 1646 } |
1625 | 1647 |
1626 webkit_glue::ClipboardClient* | 1648 webkit_glue::ClipboardClient* |
1627 PepperPluginDelegateImpl::CreateClipboardClient() const { | 1649 PepperPluginDelegateImpl::CreateClipboardClient() const { |
1628 return new RendererClipboardClient; | 1650 return new RendererClipboardClient; |
1629 } | 1651 } |
1630 | 1652 |
1631 } // namespace content | 1653 } // namespace content |
OLD | NEW |