summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorsehr@google.com <sehr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-09 17:19:22 +0000
committersehr@google.com <sehr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-09 17:19:22 +0000
commit5f6397ecb4c7bc92295adc8d21bd87e698ac5622 (patch)
tree140bdcb6f5680147521296fabd1dafcb9159a892 /chrome/renderer
parente5307cef6dcdc2ab5d4445cd57938dbf4d5e30c3 (diff)
downloadchromium_src-5f6397ecb4c7bc92295adc8d21bd87e698ac5622.zip
chromium_src-5f6397ecb4c7bc92295adc8d21bd87e698ac5622.tar.gz
chromium_src-5f6397ecb4c7bc92295adc8d21bd87e698ac5622.tar.bz2
Enable Pepper support by default, including building the test plugin.
This is needed because the NaCl plugin code that runs in the renderer needs to use Pepper APIs all the time, and NaCl support has been enabled by default for several months now. To cause an untrusted Pepper plugin to run in the renderer one needs to specify the --internal-pepper flag. I have also removed the enable_pepper flag from gyp. As the build of the GPU process was tied to this flag, I have renamed the flag to enable_gpu. TEST=none BUG=none Review URL: http://codereview.chromium.org/464074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34161 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/render_view.cc32
1 files changed, 20 insertions, 12 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 4718a5c..c9d4f44 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#if defined(ENABLE_PEPPER)
-#define PEPPER_APIS_ENABLED
-#endif
-
#include "chrome/renderer/render_view.h"
#include <algorithm>
@@ -2641,24 +2637,36 @@ webkit_glue::WebPluginDelegate* RenderView::CreatePluginDelegate(
else
mime_type_to_use = &mime_type;
-#if defined(PEPPER_APIS_ENABLED)
+ bool use_pepper_host = false;
+ bool in_process_plugin = RenderProcess::current()->in_process_plugins();
+ // Check for trusted Pepper plugins.
const char kPepperPrefix[] = "pepper-";
if (StartsWithASCII(*mime_type_to_use, kPepperPrefix, true)) {
- return WebPluginDelegatePepper::Create(
- path, *mime_type_to_use, gfx::NativeViewFromId(host_window_));
+ if (CommandLine::ForCurrentProcess()->
+ HasSwitch(switches::kInternalPepper)) {
+ in_process_plugin = true;
+ use_pepper_host = true;
+ } else {
+ // In process Pepper plugins must be explicitly enabled.
+ return NULL;
+ }
}
-#endif
-
- bool in_process_plugin = RenderProcess::current()->in_process_plugins();
+ // Check for Native Client modules.
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInternalNaCl)) {
if (mime_type == "application/x-nacl-srpc") {
in_process_plugin = true;
+ use_pepper_host = true;
}
}
if (in_process_plugin) {
#if defined(OS_WIN) // In-proc plugins aren't supported on Linux or Mac.
- return WebPluginDelegateImpl::Create(
- path, *mime_type_to_use, gfx::NativeViewFromId(host_window_));
+ if (use_pepper_host) {
+ return WebPluginDelegatePepper::Create(
+ path, *mime_type_to_use, gfx::NativeViewFromId(host_window_));
+ } else {
+ return WebPluginDelegateImpl::Create(
+ path, *mime_type_to_use, gfx::NativeViewFromId(host_window_));
+ }
#else
NOTIMPLEMENTED();
return NULL;