summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsehr@google.com <sehr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-10 03:21:14 +0000
committersehr@google.com <sehr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-10 03:21:14 +0000
commitd2139663640f674e7c56b1e139616c62c2b58885 (patch)
tree9afede65658f12bd00bf6cbf416a66e33c7737f1 /chrome
parent665112a28e524eed5892bc1eebb453ae3f0d64c3 (diff)
downloadchromium_src-d2139663640f674e7c56b1e139616c62c2b58885.zip
chromium_src-d2139663640f674e7c56b1e139616c62c2b58885.tar.gz
chromium_src-d2139663640f674e7c56b1e139616c62c2b58885.tar.bz2
Re-enable the build of Pepper support by default (issue 464074, svn revision 34161).
There were problems building Skia and others for the 64-bit linux versions of the Pepper test plugin, so I have disabled building that plugin except on Windows for now and added a TODO. One significant addition to the previous comment lines. The flag enable_gpu=1 now causes the build definition ENABLE_GPU=1 to allow guarding of dependent code. BUG=none TEST=none Review URL: http://codereview.chromium.org/481001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34227 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc1
-rwxr-xr-xchrome/chrome_renderer.gypi2
-rw-r--r--chrome/common/chrome_switches.cc3
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/renderer/render_view.cc32
5 files changed, 26 insertions, 13 deletions
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index c7325ad..05a452d 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -517,6 +517,7 @@ void BrowserRenderProcessHost::PropogateBrowserCommandLineToRenderer(
switches::kSimpleDataSource,
switches::kEnableBenchmarking,
switches::kInternalNaCl,
+ switches::kInternalPepper,
switches::kDisableByteRangeSupport,
switches::kDisableDatabases,
switches::kDisableDesktopNotifications,
diff --git a/chrome/chrome_renderer.gypi b/chrome/chrome_renderer.gypi
index f1e7c36c..ebe31de 100755
--- a/chrome/chrome_renderer.gypi
+++ b/chrome/chrome_renderer.gypi
@@ -148,7 +148,7 @@
],
},
'conditions': [
- ['enable_pepper==1', {
+ ['enable_gpu==1', {
'dependencies': [
'../gpu/gpu.gyp:gpu_plugin',
],
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 3160bd8..f64b451 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -313,6 +313,9 @@ const char kIncognito[] = "incognito";
// Runs the Native Client inside the renderer process.
const char kInternalNaCl[] = "internal-nacl";
+// Runs a trusted Pepper plugin inside the renderer process.
+const char kInternalPepper[] = "internal-pepper";
+
// Specifies the flags passed to JS engine
const char kJavaScriptFlags[] = "js-flags";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 5d97788..9698cdf 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -99,6 +99,7 @@ extern const char kImport[];
extern const char kInProcessPlugins[];
extern const char kIncognito[];
extern const char kInternalNaCl[];
+extern const char kInternalPepper[];
extern const char kJavaScriptFlags[];
extern const char kLoadExtension[];
extern const char kLoadPlugin[];
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;