Commit 01d8f26f authored by jhorwich's avatar jhorwich Committed by Commit bot

Remove GTalk/O1D plugins and related code

This removes some special-case code used to register and load
gtbp and o1d PPAPI plugins on Linux and ChromeOS. It also removes
infrastructure used to launch these plugins.

TEST=Run PDF (out-of-process) and NaCl (in-process) plugins
BUG=392002

Review URL: https://codereview.chromium.org/374773002

Cr-Commit-Position: refs/heads/master@{#324131}
parent e3d6b757
...@@ -5714,9 +5714,6 @@ Keep your key file in a safe place. You will need it to create new versions of y ...@@ -5714,9 +5714,6 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_PLUGINS_PPAPI_OUT_OF_PROCESS" desc="Text that indicates the plugin is an out-of-process PPAPI plugin."> <message name="IDS_PLUGINS_PPAPI_OUT_OF_PROCESS" desc="Text that indicates the plugin is an out-of-process PPAPI plugin.">
PPAPI (out-of-process) PPAPI (out-of-process)
</message> </message>
<message name="IDS_PLUGINS_PPAPI_UNSANDBOXED" desc="Text that indicates the plugin is an unsandboxed out-of-process PPAPI plugin.">
PPAPI (unsandboxed)
</message>
<message name="IDS_PLUGINS_BROWSER_PLUGIN" desc="Text that indicates the plugin is a browser plugin."> <message name="IDS_PLUGINS_BROWSER_PLUGIN" desc="Text that indicates the plugin is a browser plugin.">
BROWSER PLUGIN BROWSER PLUGIN
</message> </message>
...@@ -2104,22 +2104,6 @@ TEST_F(DownloadTargetDeterminerTestWithPlugin, ...@@ -2104,22 +2104,6 @@ TEST_F(DownloadTargetDeterminerTestWithPlugin,
target_info = RunDownloadTargetDeterminer( target_info = RunDownloadTargetDeterminer(
GetPathInDownloadDir(kInitialPath), item.get()); GetPathInDownloadDir(kInitialPath), item.get());
EXPECT_FALSE(target_info->is_filetype_handled_safely); EXPECT_FALSE(target_info->is_filetype_handled_safely);
// Now register an unsandboxed PPAPI plugin. This plugin should not be
// considered secure.
ScopedRegisterInternalPlugin ppapi_unsandboxed_plugin(
plugin_service,
content::WebPluginInfo::PLUGIN_TYPE_PEPPER_UNSANDBOXED,
test_download_dir().AppendASCII("ppapi-nosandbox"),
kTestMIMEType,
"fakeext");
EXPECT_CALL(mock_plugin_filter_,
MockPluginAvailable(ppapi_unsandboxed_plugin.path()))
.WillRepeatedly(Return(true));
target_info = RunDownloadTargetDeterminer(
GetPathInDownloadDir(kInitialPath), item.get());
EXPECT_FALSE(target_info->is_filetype_handled_safely);
} }
// Check if secure handling of filetypes is determined correctly for NPAPI // Check if secure handling of filetypes is determined correctly for NPAPI
......
...@@ -118,8 +118,6 @@ base::string16 PluginTypeToString(int type) { ...@@ -118,8 +118,6 @@ base::string16 PluginTypeToString(int type) {
return l10n_util::GetStringUTF16(IDS_PLUGINS_PPAPI_IN_PROCESS); return l10n_util::GetStringUTF16(IDS_PLUGINS_PPAPI_IN_PROCESS);
case WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS: case WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS:
return l10n_util::GetStringUTF16(IDS_PLUGINS_PPAPI_OUT_OF_PROCESS); return l10n_util::GetStringUTF16(IDS_PLUGINS_PPAPI_OUT_OF_PROCESS);
case WebPluginInfo::PLUGIN_TYPE_PEPPER_UNSANDBOXED:
return l10n_util::GetStringUTF16(IDS_PLUGINS_PPAPI_UNSANDBOXED);
case WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN: case WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN:
return l10n_util::GetStringUTF16(IDS_PLUGINS_BROWSER_PLUGIN); return l10n_util::GetStringUTF16(IDS_PLUGINS_BROWSER_PLUGIN);
} }
......
...@@ -74,13 +74,6 @@ const char kPDFPluginOutOfProcessMimeType[] = ...@@ -74,13 +74,6 @@ const char kPDFPluginOutOfProcessMimeType[] =
const uint32 kPDFPluginPermissions = ppapi::PERMISSION_PRIVATE | const uint32 kPDFPluginPermissions = ppapi::PERMISSION_PRIVATE |
ppapi::PERMISSION_DEV; ppapi::PERMISSION_DEV;
const char kO1DPluginName[] = "Google Talk Plugin Video Renderer";
const char kO1DPluginMimeType[] ="application/o1d";
const char kO1DPluginExtension[] = "";
const char kO1DPluginDescription[] = "Google Talk Plugin Video Renderer";
const uint32 kO1DPluginPermissions = ppapi::PERMISSION_PRIVATE |
ppapi::PERMISSION_DEV;
const char kEffectsPluginName[] = "Google Talk Effects Plugin"; const char kEffectsPluginName[] = "Google Talk Effects Plugin";
const char kEffectsPluginMimeType[] ="application/x-ppapi-hangouts-effects"; const char kEffectsPluginMimeType[] ="application/x-ppapi-hangouts-effects";
const char kEffectsPluginExtension[] = ""; const char kEffectsPluginExtension[] = "";
...@@ -88,13 +81,6 @@ const char kEffectsPluginDescription[] = "Google Talk Effects Plugin"; ...@@ -88,13 +81,6 @@ const char kEffectsPluginDescription[] = "Google Talk Effects Plugin";
const uint32 kEffectsPluginPermissions = ppapi::PERMISSION_PRIVATE | const uint32 kEffectsPluginPermissions = ppapi::PERMISSION_PRIVATE |
ppapi::PERMISSION_DEV; ppapi::PERMISSION_DEV;
const char kGTalkPluginName[] = "Google Talk Plugin";
const char kGTalkPluginMimeType[] ="application/googletalk";
const char kGTalkPluginExtension[] = ".googletalk";
const char kGTalkPluginDescription[] = "Google Talk Plugin";
const uint32 kGTalkPluginPermissions = ppapi::PERMISSION_PRIVATE |
ppapi::PERMISSION_DEV;
content::PepperPluginInfo::GetInterfaceFunc g_pdf_get_interface; content::PepperPluginInfo::GetInterfaceFunc g_pdf_get_interface;
content::PepperPluginInfo::PPP_InitializeModuleFunc g_pdf_initialize_module; content::PepperPluginInfo::PPP_InitializeModuleFunc g_pdf_initialize_module;
content::PepperPluginInfo::PPP_ShutdownModuleFunc g_pdf_shutdown_module; content::PepperPluginInfo::PPP_ShutdownModuleFunc g_pdf_shutdown_module;
...@@ -184,25 +170,6 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) { ...@@ -184,25 +170,6 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
} }
#endif // !defined(DISABLE_NACL) #endif // !defined(DISABLE_NACL)
static bool skip_o1d_file_check = false;
if (PathService::Get(chrome::FILE_O1D_PLUGIN, &path)) {
if (skip_o1d_file_check || base::PathExists(path)) {
content::PepperPluginInfo o1d;
o1d.path = path;
o1d.name = kO1DPluginName;
o1d.is_out_of_process = true;
o1d.is_sandboxed = false;
o1d.permissions = kO1DPluginPermissions;
content::WebPluginMimeType o1d_mime_type(kO1DPluginMimeType,
kO1DPluginExtension,
kO1DPluginDescription);
o1d.mime_types.push_back(o1d_mime_type);
plugins->push_back(o1d);
skip_o1d_file_check = true;
}
}
// TODO(vrk): Remove this when NaCl effects plugin replaces the ppapi effects // TODO(vrk): Remove this when NaCl effects plugin replaces the ppapi effects
// plugin. // plugin.
static bool skip_effects_file_check = false; static bool skip_effects_file_check = false;
...@@ -212,7 +179,6 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) { ...@@ -212,7 +179,6 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
effects.path = path; effects.path = path;
effects.name = kEffectsPluginName; effects.name = kEffectsPluginName;
effects.is_out_of_process = true; effects.is_out_of_process = true;
effects.is_sandboxed = true;
effects.permissions = kEffectsPluginPermissions; effects.permissions = kEffectsPluginPermissions;
content::WebPluginMimeType effects_mime_type(kEffectsPluginMimeType, content::WebPluginMimeType effects_mime_type(kEffectsPluginMimeType,
kEffectsPluginExtension, kEffectsPluginExtension,
...@@ -224,25 +190,6 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) { ...@@ -224,25 +190,6 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
} }
} }
static bool skip_gtalk_file_check = false;
if (PathService::Get(chrome::FILE_GTALK_PLUGIN, &path)) {
if (skip_gtalk_file_check || base::PathExists(path)) {
content::PepperPluginInfo gtalk;
gtalk.path = path;
gtalk.name = kGTalkPluginName;
gtalk.is_out_of_process = true;
gtalk.is_sandboxed = false;
gtalk.permissions = kGTalkPluginPermissions;
content::WebPluginMimeType gtalk_mime_type(kGTalkPluginMimeType,
kGTalkPluginExtension,
kGTalkPluginDescription);
gtalk.mime_types.push_back(gtalk_mime_type);
plugins->push_back(gtalk);
skip_gtalk_file_check = true;
}
}
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && \ #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && \
!defined(WIDEVINE_CDM_IS_COMPONENT) !defined(WIDEVINE_CDM_IS_COMPONENT)
static bool skip_widevine_cdm_file_check = false; static bool skip_widevine_cdm_file_check = false;
......
...@@ -75,16 +75,6 @@ const base::FilePath::CharType kEffectsPluginFileName[] = ...@@ -75,16 +75,6 @@ const base::FilePath::CharType kEffectsPluginFileName[] =
FILE_PATH_LITERAL("pepper/libppeffects.so"); FILE_PATH_LITERAL("pepper/libppeffects.so");
#endif #endif
#if defined(OS_POSIX) && !defined(OS_MACOSX)
const base::FilePath::CharType kO1DPluginFileName[] =
FILE_PATH_LITERAL("pepper/libppo1d.so");
const base::FilePath::CharType kGTalkPluginFileName[] =
FILE_PATH_LITERAL("pepper/libppgoogletalk.so");
#endif // defined(OS_POSIX) && !defined(OS_MACOSX)
#if defined(OS_LINUX) #if defined(OS_LINUX)
// The path to the external extension <id>.json files. // The path to the external extension <id>.json files.
// /usr/share seems like a good choice, see: http://www.pathname.com/fhs/ // /usr/share seems like a good choice, see: http://www.pathname.com/fhs/
...@@ -375,18 +365,6 @@ bool PathProvider(int key, base::FilePath* result) { ...@@ -375,18 +365,6 @@ bool PathProvider(int key, base::FilePath* result) {
#endif #endif
cur = cur.Append(FILE_PATH_LITERAL("pnacl")); cur = cur.Append(FILE_PATH_LITERAL("pnacl"));
break; break;
#if defined(OS_POSIX) && !defined(OS_MACOSX)
case chrome::FILE_O1D_PLUGIN:
if (!PathService::Get(base::DIR_MODULE, &cur))
return false;
cur = cur.Append(kO1DPluginFileName);
break;
case chrome::FILE_GTALK_PLUGIN:
if (!PathService::Get(base::DIR_MODULE, &cur))
return false;
cur = cur.Append(kGTalkPluginFileName);
break;
#endif
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
#if defined(WIDEVINE_CDM_IS_COMPONENT) #if defined(WIDEVINE_CDM_IS_COMPONENT)
case chrome::DIR_COMPONENT_WIDEVINE_CDM: case chrome::DIR_COMPONENT_WIDEVINE_CDM:
......
...@@ -93,9 +93,7 @@ enum { ...@@ -93,9 +93,7 @@ enum {
DIR_PNACL_BASE, // Full path to the base dir for PNaCl. DIR_PNACL_BASE, // Full path to the base dir for PNaCl.
DIR_PNACL_COMPONENT, // Full path to the latest PNaCl version DIR_PNACL_COMPONENT, // Full path to the latest PNaCl version
// (subdir of DIR_PNACL_BASE). // (subdir of DIR_PNACL_BASE).
FILE_O1D_PLUGIN, // Full path to the O1D Pepper plugin file.
FILE_EFFECTS_PLUGIN, // Full path to the Effects Pepper plugin file. FILE_EFFECTS_PLUGIN, // Full path to the Effects Pepper plugin file.
FILE_GTALK_PLUGIN, // Full path to the GTalk Pepper plugin file.
DIR_COMPONENT_WIDEVINE_CDM, // Directory that contains component-updated DIR_COMPONENT_WIDEVINE_CDM, // Directory that contains component-updated
// Widevine CDM files. // Widevine CDM files.
FILE_WIDEVINE_CDM_ADAPTER, // Full path to the Widevine CDM adapter file. FILE_WIDEVINE_CDM_ADAPTER, // Full path to the Widevine CDM adapter file.
......
...@@ -74,7 +74,7 @@ class PpapiPluginSandboxedProcessLauncherDelegate ...@@ -74,7 +74,7 @@ class PpapiPluginSandboxedProcessLauncherDelegate
*base::CommandLine::ForCurrentProcess(); *base::CommandLine::ForCurrentProcess();
base::CommandLine::StringType plugin_launcher = browser_command_line base::CommandLine::StringType plugin_launcher = browser_command_line
.GetSwitchValueNative(switches::kPpapiPluginLauncher); .GetSwitchValueNative(switches::kPpapiPluginLauncher);
return !is_broker_ && plugin_launcher.empty() && info_.is_sandboxed; return !is_broker_ && plugin_launcher.empty();
} }
base::ScopedFD TakeIpcFd() override { return ipc_fd_.Pass(); } base::ScopedFD TakeIpcFd() override { return ipc_fd_.Pass(); }
#endif // OS_WIN #endif // OS_WIN
...@@ -377,13 +377,8 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) { ...@@ -377,13 +377,8 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) {
cmd_line->PrependWrapper(plugin_launcher); cmd_line->PrependWrapper(plugin_launcher);
// On posix, never use the zygote for the broker. Also, only use the zygote if // On posix, never use the zygote for the broker. Also, only use the zygote if
// the plugin is sandboxed, and we are not using a plugin launcher - having a // we are not using a plugin launcher - having a plugin launcher means we need
// plugin launcher means we need to use another process instead of just // to use another process instead of just forking the zygote.
// forking the zygote.
#if defined(OS_POSIX)
if (!info.is_sandboxed)
cmd_line->AppendSwitchASCII(switches::kNoSandbox, std::string());
#endif // OS_POSIX
process_->Launch( process_->Launch(
new PpapiPluginSandboxedProcessLauncherDelegate(is_broker_, new PpapiPluginSandboxedProcessLauncherDelegate(is_broker_,
info, info,
......
...@@ -129,10 +129,7 @@ bool MakePepperPluginInfo(const WebPluginInfo& webplugin_info, ...@@ -129,10 +129,7 @@ bool MakePepperPluginInfo(const WebPluginInfo& webplugin_info,
return false; return false;
pepper_info->is_out_of_process = pepper_info->is_out_of_process =
webplugin_info.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS || webplugin_info.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS;
webplugin_info.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_UNSANDBOXED;
pepper_info->is_sandboxed = webplugin_info.type !=
WebPluginInfo::PLUGIN_TYPE_PEPPER_UNSANDBOXED;
pepper_info->path = base::FilePath(webplugin_info.path); pepper_info->path = base::FilePath(webplugin_info.path);
pepper_info->name = base::UTF16ToASCII(webplugin_info.name); pepper_info->name = base::UTF16ToASCII(webplugin_info.name);
......
...@@ -17,7 +17,6 @@ PepperPluginInfo::EntryPoints::EntryPoints() ...@@ -17,7 +17,6 @@ PepperPluginInfo::EntryPoints::EntryPoints()
PepperPluginInfo::PepperPluginInfo() PepperPluginInfo::PepperPluginInfo()
: is_internal(false), : is_internal(false),
is_out_of_process(false), is_out_of_process(false),
is_sandboxed(true),
permissions(0) { permissions(0) {
} }
...@@ -28,9 +27,7 @@ WebPluginInfo PepperPluginInfo::ToWebPluginInfo() const { ...@@ -28,9 +27,7 @@ WebPluginInfo PepperPluginInfo::ToWebPluginInfo() const {
WebPluginInfo info; WebPluginInfo info;
info.type = is_out_of_process ? info.type = is_out_of_process ?
(is_sandboxed ? WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS :
WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS :
WebPluginInfo::PLUGIN_TYPE_PEPPER_UNSANDBOXED) :
WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS; WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS;
info.name = name.empty() ? info.name = name.empty() ?
......
...@@ -48,10 +48,6 @@ struct CONTENT_EXPORT PepperPluginInfo { ...@@ -48,10 +48,6 @@ struct CONTENT_EXPORT PepperPluginInfo {
// True when this plugin should be run out of process. Defaults to false. // True when this plugin should be run out of process. Defaults to false.
bool is_out_of_process; bool is_out_of_process;
// True when an out-of-process plugin should also be run within sandbox.
// Defaults to true.
bool is_sandboxed;
base::FilePath path; // Internal plugins have "internal-[name]" as path. base::FilePath path; // Internal plugins have "internal-[name]" as path.
std::string name; std::string name;
std::string description; std::string description;
......
...@@ -47,7 +47,6 @@ struct CONTENT_EXPORT WebPluginInfo { ...@@ -47,7 +47,6 @@ struct CONTENT_EXPORT WebPluginInfo {
PLUGIN_TYPE_NPAPI, PLUGIN_TYPE_NPAPI,
PLUGIN_TYPE_PEPPER_IN_PROCESS, PLUGIN_TYPE_PEPPER_IN_PROCESS,
PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS, PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS,
PLUGIN_TYPE_PEPPER_UNSANDBOXED,
PLUGIN_TYPE_BROWSER_PLUGIN PLUGIN_TYPE_BROWSER_PLUGIN
}; };
...@@ -64,8 +63,7 @@ struct CONTENT_EXPORT WebPluginInfo { ...@@ -64,8 +63,7 @@ struct CONTENT_EXPORT WebPluginInfo {
bool is_pepper_plugin() const { bool is_pepper_plugin() const {
return ((type == PLUGIN_TYPE_PEPPER_IN_PROCESS ) || return ((type == PLUGIN_TYPE_PEPPER_IN_PROCESS ) ||
(type == PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS) || (type == PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS));
(type == PLUGIN_TYPE_PEPPER_UNSANDBOXED));
} }
// Parse a version string as used by a plugin. This method is more lenient // Parse a version string as used by a plugin. This method is more lenient
......
...@@ -303,7 +303,7 @@ void PreloadPepperPlugins() { ...@@ -303,7 +303,7 @@ void PreloadPepperPlugins() {
std::vector<PepperPluginInfo> plugins; std::vector<PepperPluginInfo> plugins;
ComputePepperPluginList(&plugins); ComputePepperPluginList(&plugins);
for (size_t i = 0; i < plugins.size(); ++i) { for (size_t i = 0; i < plugins.size(); ++i) {
if (!plugins[i].is_internal && plugins[i].is_sandboxed) { if (!plugins[i].is_internal) {
base::NativeLibraryLoadError error; base::NativeLibraryLoadError error;
base::NativeLibrary library = base::LoadNativeLibrary(plugins[i].path, base::NativeLibrary library = base::LoadNativeLibrary(plugins[i].path,
&error); &error);
......
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