Commit df00bfd9 authored by shess@chromium.org's avatar shess@chromium.org

Enable Pepper threading on canary.

BUG=161286


Review URL: https://chromiumcodereview.appspot.com/11419260

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170633 0039d316-1c4b-4281-b951-d872f2087c98
parent b49c0117
......@@ -34,6 +34,7 @@
#include "ui/base/resource/resource_bundle.h"
#include "webkit/plugins/npapi/plugin_list.h"
#include "webkit/plugins/plugin_constants.h"
#include "webkit/plugins/plugin_switches.h"
#include "webkit/user_agent/user_agent_util.h"
#include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR.
......@@ -313,14 +314,22 @@ void AddPepperFlashFromCommandLine(
bool GetBundledPepperFlash(content::PepperPluginInfo* plugin,
bool* override_npapi_flash) {
CommandLine* command_line = CommandLine::ForCurrentProcess();
if (!command_line->HasSwitch(switches::kDisablePepperThreading) &&
!command_line->HasSwitch(switches::kEnablePepperThreading)) {
chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
if (channel == chrome::VersionInfo::CHANNEL_CANARY)
command_line->AppendSwitch(switches::kEnablePepperThreading);
}
#if defined(FLAPPER_AVAILABLE)
// Ignore bundled Pepper Flash if there is Pepper Flash specified from the
// command-line.
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kPpapiFlashPath))
if (command_line->HasSwitch(switches::kPpapiFlashPath))
return false;
bool force_disable = CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableBundledPpapiFlash);
bool force_disable =
command_line->HasSwitch(switches::kDisableBundledPpapiFlash);
if (force_disable)
return false;
......@@ -334,8 +343,8 @@ bool GetBundledPepperFlash(content::PepperPluginInfo* plugin,
if (!PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &flash_path))
return false;
bool force_enable = CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableBundledPpapiFlash);
bool force_enable =
command_line->HasSwitch(switches::kEnableBundledPpapiFlash);
*plugin = CreatePepperFlashInfo(flash_path, FLAPPER_VERSION_STRING);
*override_npapi_flash = force_enable || IsPepperFlashEnabledByDefault();
......
......@@ -236,6 +236,7 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) {
// TODO(vtl): Stop passing flash args in the command line, on windows is
// going to explode.
static const char* kPluginForwardSwitches[] = {
switches::kDisablePepperThreading,
switches::kDisableSeccompFilterSandbox,
switches::kEnablePepperThreading,
#if defined(OS_MACOSX)
......
......@@ -61,8 +61,13 @@ PpapiThread::PpapiThread(const CommandLine& command_line, bool is_broker)
globals->set_plugin_proxy_delegate(this);
globals->set_command_line(
command_line.GetSwitchValueASCII(switches::kPpapiFlashArgs));
globals->set_enable_threading(
command_line.HasSwitch(switches::kEnablePepperThreading));
if (command_line.HasSwitch(switches::kDisablePepperThreading)) {
globals->set_enable_threading(false);
} else if (command_line.HasSwitch(switches::kEnablePepperThreading)) {
globals->set_enable_threading(true);
} else {
globals->set_enable_threading(false);
}
webkit_platform_support_.reset(new PpapiWebKitPlatformSupportImpl);
WebKit::initialize(webkit_platform_support_.get());
......
......@@ -18,6 +18,9 @@ const char kPpapiFlashArgs[] = "ppapi-flash-args";
// Set to true to allow threadsafety support in native Pepper plugins.
const char kEnablePepperThreading[] = "enable-pepper-threading";
// Set to true to not allow threadsafety support in native Pepper plugins.
const char kDisablePepperThreading[] = "disable-pepper-threading";
#if defined(OS_WIN)
// Used by the plugins_test when testing the older WMP plugin to force the new
// plugin to not get loaded.
......
......@@ -14,6 +14,7 @@ WEBKIT_PLUGINS_EXPORT extern const char kDebugPluginLoading[];
WEBKIT_PLUGINS_EXPORT extern const char kDisablePepper3d[];
WEBKIT_PLUGINS_EXPORT extern const char kPpapiFlashArgs[];
WEBKIT_PLUGINS_EXPORT extern const char kEnablePepperThreading[];
WEBKIT_PLUGINS_EXPORT extern const char kDisablePepperThreading[];
#if defined(OS_WIN)
WEBKIT_PLUGINS_EXPORT extern const char kUseOldWMPPlugin[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment