Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2078)

Unified Diff: content/renderer/pepper/pepper_nacl_helper.cc

Issue 11140046: Add a content API to connect a Native Client module to an out-of-process PPAPI proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
+

Powered by Google App Engine
This is Rietveld 408576698