| Index: content/renderer/pepper/pepper_nacl_helper.cc
|
| ===================================================================
|
| --- content/renderer/pepper/pepper_nacl_helper.cc (revision 0)
|
| +++ content/renderer/pepper/pepper_nacl_helper.cc (revision 0)
|
| @@ -0,0 +1,35 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "content/public/renderer/pepper_nacl_helper.h"
|
| +
|
| +#include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
|
| +#include "ipc/ipc_channel_handle.h"
|
| +#include "webkit/plugins/ppapi/plugin_module.h"
|
| +#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
|
| +
|
| +namespace content {
|
| +
|
| +scoped_refptr<webkit::ppapi::PluginModule> CreateNaClPluginModule(
|
| + webkit::ppapi::PluginInstance* plugin_instance,
|
| + ppapi::PpapiPermissions permissions,
|
| + const IPC::ChannelHandle& channel_handle,
|
| + int nacl_process_id) {
|
| +
|
| + // Since we're the embedder, we can make assumptions about the delegate on
|
| + // the instance.
|
| + PepperPluginDelegateImpl* delegate = static_cast<PepperPluginDelegateImpl*>(
|
| + plugin_instance->delegate());
|
| + if (!delegate)
|
| + return scoped_refptr<webkit::ppapi::PluginModule>();
|
| + scoped_refptr<webkit::ppapi::PluginModule> plugin_module =
|
| + delegate->CreateNaClPluginModule(plugin_instance,
|
| + permissions,
|
| + channel_handle,
|
| + nacl_process_id);
|
| + return plugin_module;
|
| +}
|
| +
|
| +} // namespace content
|
| +
|
|
|