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

Unified Diff: extensions/shell/renderer/shell_content_renderer_client.cc

Issue 437503004: Add NaCl support to app_shell (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (nacl-init) rebase Created 6 years, 4 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: extensions/shell/renderer/shell_content_renderer_client.cc
diff --git a/extensions/shell/renderer/shell_content_renderer_client.cc b/extensions/shell/renderer/shell_content_renderer_client.cc
index c7a9be6d227da2969d9efe8679714e2bbd002368..b6f8ed714fd2a08c1fdf0777cc6cd8843912c822 100644
--- a/extensions/shell/renderer/shell_content_renderer_client.cc
+++ b/extensions/shell/renderer/shell_content_renderer_client.cc
@@ -16,6 +16,13 @@
#include "extensions/shell/renderer/shell_extensions_renderer_client.h"
#include "extensions/shell/renderer/shell_renderer_main_delegate.h"
+#if !defined(DISABLE_NACL)
+#include "components/nacl/common/nacl_constants.h"
+#include "components/nacl/renderer/nacl_helper.h"
+#include "components/nacl/renderer/ppb_nacl_private_impl.h"
+#include "ppapi/c/private/ppb_nacl_private.h"
+#endif
+
using blink::WebFrame;
using blink::WebString;
using content::RenderThread;
@@ -93,8 +100,15 @@ void ShellContentRendererClient::RenderThreadStarted() {
void ShellContentRendererClient::RenderFrameCreated(
content::RenderFrame* render_frame) {
- // ShellFrameHelper destroyes itself when the RenderFrame is destroyed.
+ // ShellFrameHelper destroys itself when the RenderFrame is destroyed.
new ShellFrameHelper(render_frame, extension_dispatcher_.get());
+
+ // TODO(jamescook): Do we need to add a new PepperHelper(render_frame) here?
+ // It doesn't seem necessary for either Pepper or NaCl.
+ // http://crbug.com/403004
+#if !defined(DISABLE_NACL)
+ new nacl::NaClHelper(render_frame);
+#endif
}
void ShellContentRendererClient::RenderViewCreated(
@@ -104,6 +118,22 @@ void ShellContentRendererClient::RenderViewCreated(
delegate_->OnViewCreated(render_view);
}
+bool ShellContentRendererClient::OverrideCreatePlugin(
+ content::RenderFrame* render_frame,
+ blink::WebLocalFrame* frame,
+ const blink::WebPluginParams& params,
+ blink::WebPlugin** plugin) {
+ // Allow the content module to create the plugin.
+ return false;
+}
+
+blink::WebPlugin* ShellContentRendererClient::CreatePluginReplacement(
+ content::RenderFrame* render_frame,
+ const base::FilePath& plugin_path) {
+ // Don't provide a custom "failed to load" plugin.
+ return NULL;
+}
+
bool ShellContentRendererClient::WillSendRequest(
blink::WebFrame* frame,
content::PageTransition transition_type,
@@ -123,6 +153,27 @@ void ShellContentRendererClient::DidCreateScriptContext(
frame, context, extension_group, world_id);
}
+const void* ShellContentRendererClient::CreatePPAPIInterface(
+ const std::string& interface_name) {
+#if !defined(DISABLE_NACL)
+ if (interface_name == PPB_NACL_PRIVATE_INTERFACE)
+ return nacl::GetNaClPrivateInterface();
+#endif
+ return NULL;
+}
+
+bool ShellContentRendererClient::IsExternalPepperPlugin(
+ const std::string& module_name) {
+#if !defined(DISABLE_NACL)
+ // TODO(bbudge) remove this when the trusted NaCl plugin has been removed.
+ // We must defer certain plugin events for NaCl instances since we switch
+ // from the in-process to the out-of-process proxy after instantiating them.
+ return module_name == nacl::kNaClPluginName;
+#else
+ return false;
+#endif
+}
+
bool ShellContentRendererClient::ShouldEnableSiteIsolationPolicy() const {
// Extension renderers don't need site isolation.
return false;

Powered by Google App Engine
This is Rietveld 408576698