diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/renderer_host/browser_render_process_host.cc | 1 | ||||
-rwxr-xr-x | chrome/chrome_renderer.gypi | 2 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 3 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 | ||||
-rw-r--r-- | chrome/renderer/render_view.cc | 32 |
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; |