OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/public/renderer/pepper_nacl_helper.h" |
| 6 |
| 7 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" |
| 8 #include "ipc/ipc_channel_handle.h" |
| 9 #include "webkit/plugins/ppapi/plugin_module.h" |
| 10 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 11 |
| 12 namespace content { |
| 13 |
| 14 scoped_refptr<webkit::ppapi::PluginModule> CreateNaClPluginModule( |
| 15 webkit::ppapi::PluginInstance* plugin_instance, |
| 16 ppapi::PpapiPermissions permissions, |
| 17 const IPC::ChannelHandle& channel_handle, |
| 18 int nacl_process_id) { |
| 19 |
| 20 // Since we're the embedder, we can make assumptions about the delegate on |
| 21 // the instance. |
| 22 PepperPluginDelegateImpl* delegate = static_cast<PepperPluginDelegateImpl*>( |
| 23 plugin_instance->delegate()); |
| 24 if (!delegate) |
| 25 return scoped_refptr<webkit::ppapi::PluginModule>(); |
| 26 scoped_refptr<webkit::ppapi::PluginModule> plugin_module = |
| 27 delegate->CreateNaClPluginModule(plugin_instance, |
| 28 permissions, |
| 29 channel_handle, |
| 30 nacl_process_id); |
| 31 return plugin_module; |
| 32 } |
| 33 |
| 34 } // namespace content |
| 35 |
OLD | NEW |