Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1169)

Unified Diff: webkit/plugins/npapi/plugin_list.cc

Issue 9874001: revert 128949 (and dependent 129252) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/plugins/npapi/plugin_list.h ('k') | webkit/plugins/npapi/plugin_list_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/npapi/plugin_list.cc
diff --git a/webkit/plugins/npapi/plugin_list.cc b/webkit/plugins/npapi/plugin_list.cc
index 260fadfefed73b20df98fe8a0f16fbee98d9eee0..2d70c010359a1531dc9a82d6086e16ae20192c95 100644
--- a/webkit/plugins/npapi/plugin_list.cc
+++ b/webkit/plugins/npapi/plugin_list.cc
@@ -53,81 +53,99 @@ bool AllowMimeTypeMismatch(const std::string& orig_mime_type,
namespace webkit {
namespace npapi {
-// Note: If you change the plug-in definitions here, also update
-// chrome/browser/resources/plugins_*.json correspondingly!
-// In particular, the identifier and the update URLs need to be kept in sync.
-
// Some version ranges can be shared across operating systems. This should be
// done where possible to avoid duplication.
+// TODO(bauerb): The |requires_authorization| flag should be part of
+// PluginGroupDefinition, not VersionRangeDefinition.
+static const VersionRangeDefinition kAllVersionsInfobarVersionRange[] = {
+ { "", "", "", true }
+};
+
+static const VersionRangeDefinition kAllVersionsNoInfobarVersionRange[] = {
+ { "", "", "", false }
+};
// This is up to date with
// http://www.adobe.com/support/security/bulletins/apsb12-03.html
// NOTE: We would like to go to the 4th component value but we cannot because
// on some platforms, such as Linux, it is not available.
static const VersionRangeDefinition kFlashVersionRange[] = {
- { "", "", "11.1.102" }
+ { "", "", "11.1.102", false }
};
// This is up to date with
// http://www.adobe.com/support/security/bulletins/apsb12-02.html
static const VersionRangeDefinition kShockwaveVersionRange[] = {
- { "", "", "11.6.4.634" }
+ { "", "", "11.6.4.634", true }
};
// This is up to date with
// http://support.microsoft.com/kb/2668562
// http://technet.microsoft.com/en-us/security/Bulletin/MS12-016
static const VersionRangeDefinition kSilverlightVersionRange[] = {
- { "0", "5", "4.1.10111.0" },
- { "5", "6", "" },
+ { "0", "5", "4.1.10111.0", false },
+ { "5", "6", "", false },
};
// Similarly, try and share the group definition for plug-ins that are
// very consistent across OS'es.
#define kFlashDefinition { \
"adobe-flash-player", "Flash", "Shockwave Flash", kFlashVersionRange,\
- arraysize(kFlashVersionRange) }
+ arraysize(kFlashVersionRange), "http://get.adobe.com/flashplayer/" }
#define kShockwaveDefinition { \
"shockwave", PluginGroup::kShockwaveGroupName, "Shockwave for Director", \
- kShockwaveVersionRange, arraysize(kShockwaveVersionRange) }
+ kShockwaveVersionRange, arraysize(kShockwaveVersionRange), \
+ "http://www.adobe.com/shockwave/download/" }
#define kSilverlightDefinition { \
"silverlight", PluginGroup::kSilverlightGroupName, "Silverlight", \
- kSilverlightVersionRange, arraysize(kSilverlightVersionRange) }
+ kSilverlightVersionRange, arraysize(kSilverlightVersionRange), \
+ "http://www.microsoft.com/getsilverlight/" }
#define kChromePdfDefinition { \
- "google-chrome-pdf", "Chrome PDF Viewer", "Chrome PDF Viewer", NULL, 0 }
+ "google-chrome-pdf", "Chrome PDF Viewer", "Chrome PDF Viewer", \
+ kAllVersionsNoInfobarVersionRange, \
+ arraysize(kAllVersionsNoInfobarVersionRange), "" }
#define kGoogleTalkDefinition { \
- "google-talk", "Google Talk", "Google Talk", NULL, 0 }
+ "google-talk", "Google Talk", "Google Talk", \
+ kAllVersionsNoInfobarVersionRange, \
+ arraysize(kAllVersionsNoInfobarVersionRange), ""}
#if defined(OS_MACOSX)
// Plugin Groups for Mac.
// Plugins are listed here as soon as vulnerabilities and solutions
// (new versions) are published.
static const VersionRangeDefinition kQuicktimeVersionRange[] = {
- { "", "", "7.6.6" }
+ { "", "", "7.6.6", true }
};
static const VersionRangeDefinition kJavaVersionRange[] = {
- { "0", "13.0", "12.8.0" }, // Leopard
- { "13.0", "14.0", "13.5.0" }, // Snow Leopard
- { "14.0", "", "14.0.3" } // Lion
+ { "0", "13.0", "12.8.0", true }, // Leopard
+ { "13.0", "14.0", "13.5.0", true }, // Snow Leopard
+ { "14.0", "", "14.0.3", true } // Lion
};
static const VersionRangeDefinition kFlip4MacVersionRange[] = {
- { "", "", "2.2.1" }
+ { "", "", "2.2.1", true }
+};
+static const VersionRangeDefinition kDivXVersionRange[] = {
+ { "", "", "", true }
};
// Note: The Adobe Reader browser plug-in is not supported in Chrome.
// Note: The Real Player plugin for mac doesn't expose a version at all.
static const PluginGroupDefinition kGroupDefinitions[] = {
kFlashDefinition,
{ "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in",
- kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange) },
+ kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange),
+ "http://www.apple.com/quicktime/download/" },
{ "java-runtime-environment", PluginGroup::kJavaGroupName, "Java",
- kJavaVersionRange, arraysize(kJavaVersionRange) },
+ kJavaVersionRange, arraysize(kJavaVersionRange),
+ "http://support.apple.com/kb/HT1338" },
kSilverlightDefinition,
{ "flip4mac", "Flip4Mac", "Flip4Mac", kFlip4MacVersionRange,
- arraysize(kFlip4MacVersionRange) },
+ arraysize(kFlip4MacVersionRange),
+ "http://www.telestream.net/flip4mac-wmv/overview.htm" },
{ "divx-player", "DivX Plus Web Player", "DivX Plus Web Player",
- NULL, 0 },
+ kDivXVersionRange, arraysize(kDivXVersionRange),
+ "http://www.divx.com/en/software/divx-plus/web-player" },
kShockwaveDefinition,
kChromePdfDefinition,
kGoogleTalkDefinition,
@@ -137,46 +155,54 @@ static const PluginGroupDefinition kGroupDefinitions[] = {
// TODO(panayiotis): We should group "RealJukebox NS Plugin" with the rest of
// the RealPlayer files.
static const VersionRangeDefinition kQuicktimeVersionRange[] = {
- { "", "", "7.6.9" }
+ { "", "", "7.6.9", true }
};
static const VersionRangeDefinition kJavaVersionRange[] = {
- { "0", "7", "6.0.310" }, // "310" is not a typo.
- { "7", "", "10.3" } // JDK7u3 identifies itself as 10.3
+ { "0", "7", "6.0.310", true }, // "310" is not a typo.
+ { "7", "", "10.3", true } // JDK7u3 identifies itself as 10.3
};
// This is up to date with
// http://www.adobe.com/support/security/bulletins/apsb12-01.html
static const VersionRangeDefinition kAdobeReaderVersionRange[] = {
- { "10", "11", "10.1.2" },
- { "0", "10", "9.5" }
+ { "10", "11", "10.1.2", false },
+ { "0", "10", "9.5", false }
};
static const VersionRangeDefinition kDivXVersionRange[] = {
- { "", "", "1.4.3.4" }
+ { "", "", "1.4.3.4", true }
};
// This is up to date with
// http://service.real.com/realplayer/security/02062012_player/en/
static const VersionRangeDefinition kRealPlayerVersionRange[] = {
- { "", "", "15.0.2.71" }
+ { "", "", "15.0.2.71", true }
};
static const PluginGroupDefinition kGroupDefinitions[] = {
kFlashDefinition,
{ "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in",
- kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange) },
+ kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange),
+ "http://www.apple.com/quicktime/download/" },
{ "java-runtime-environment", PluginGroup::kJavaGroupName, "Java",
- kJavaVersionRange, arraysize(kJavaVersionRange) },
+ kJavaVersionRange, arraysize(kJavaVersionRange),
+ "http://www.java.com/download" },
{ "adobe-reader", PluginGroup::kAdobeReaderGroupName, "Adobe Acrobat",
- kAdobeReaderVersionRange, arraysize(kAdobeReaderVersionRange) },
+ kAdobeReaderVersionRange, arraysize(kAdobeReaderVersionRange),
+ "http://get.adobe.com/reader/" },
kSilverlightDefinition,
kShockwaveDefinition,
{ "divx-player", "DivX Player", "DivX Web Player", kDivXVersionRange,
- arraysize(kDivXVersionRange) },
+ arraysize(kDivXVersionRange),
+ "http://download.divx.com/divx/autoupdate/player/"
+ "DivXWebPlayerInstaller.exe" },
{ "realplayer", PluginGroup::kRealPlayerGroupName, "RealPlayer",
- kRealPlayerVersionRange, arraysize(kRealPlayerVersionRange) },
+ kRealPlayerVersionRange, arraysize(kRealPlayerVersionRange),
+ "http://www.real.com/realplayer/download" },
// These are here for grouping, no vulnerabilities known.
{ "windows-media-player", PluginGroup::kWindowsMediaPlayerGroupName,
- "Windows Media Player", NULL, 0 },
+ "Windows Media Player", kAllVersionsInfobarVersionRange,
+ arraysize(kAllVersionsInfobarVersionRange), "" },
{ "microsoft-office", "Microsoft Office", "Microsoft Office",
- NULL, 0 },
- { "nvidia-3d", "NVIDIA 3D", "NVIDIA 3D", NULL, 0 },
+ NULL, 0, "" },
+ { "nvidia-3d", "NVIDIA 3D", "NVIDIA 3D", kAllVersionsInfobarVersionRange,
+ arraysize(kAllVersionsInfobarVersionRange), "" },
kChromePdfDefinition,
kGoogleTalkDefinition,
};
@@ -191,18 +217,18 @@ static const PluginGroupDefinition kGroupDefinitions[] = {
#else // Most importantly, covers desktop Linux.
static const VersionRangeDefinition kJavaVersionRange[] = {
- { "0", "1.7", "1.6.0.31" },
- { "1.7", "", "1.7.0.3" }
+ { "0", "1.7", "1.6.0.31", true },
+ { "1.7", "", "1.7.0.3", true }
};
// Up to date with:
// http://blog.fuseyism.com/index.php/2012/02/15/
// security-icedtea6-1-8-13-1-9-13-1-10-6-and-icedtea-2-0-1-released/
static const VersionRangeDefinition kRedhatIcedTeaVersionRange[] = {
- { "0", "1.9", "1.8.13" },
- { "1.9", "1.10", "1.9.13" },
- { "1.10", "2", "1.10.6" },
- { "2", "", "2.0.1" }
+ { "0", "1.9", "1.8.13", true },
+ { "1.9", "1.10", "1.9.13", true },
+ { "1.10", "2", "1.10.6", true },
+ { "2", "", "2.0.1", true }
};
static const PluginGroupDefinition kGroupDefinitions[] = {
@@ -210,9 +236,11 @@ static const PluginGroupDefinition kGroupDefinitions[] = {
// plug-in on the Linux 64-bit version of Chrome.
kFlashDefinition,
{ "java-runtime-environment", PluginGroup::kJavaGroupName, "Java",
- kJavaVersionRange, arraysize(kJavaVersionRange) },
+ kJavaVersionRange, arraysize(kJavaVersionRange),
+ "http://www.java.com/en/download/manual.jsp" },
{ "redhat-icetea-java", "IcedTea", "IcedTea",
- kRedhatIcedTeaVersionRange, arraysize(kRedhatIcedTeaVersionRange) },
+ kRedhatIcedTeaVersionRange, arraysize(kRedhatIcedTeaVersionRange),
+ "http://www.linuxsecurity.com/content/section/3/170/" },
kChromePdfDefinition,
kGoogleTalkDefinition,
};
@@ -412,8 +440,7 @@ void PluginList::LoadPluginsInternal(ScopedVector<PluginGroup>* plugin_groups) {
for (std::vector<FilePath>::const_iterator it = plugin_paths.begin();
it != plugin_paths.end();
++it) {
- WebPluginInfo plugin_info;
- LoadPlugin(*it, plugin_groups, &plugin_info);
+ LoadPlugin(*it, plugin_groups);
}
}
@@ -432,34 +459,35 @@ void PluginList::LoadPlugins() {
plugin_groups_.swap(new_plugin_groups);
}
-bool PluginList::LoadPlugin(const FilePath& path,
- ScopedVector<PluginGroup>* plugin_groups,
- WebPluginInfo* plugin_info) {
+void PluginList::LoadPlugin(const FilePath& path,
+ ScopedVector<PluginGroup>* plugin_groups) {
LOG_IF(ERROR, PluginList::DebugPluginLoading())
<< "Loading plugin " << path.value();
+ WebPluginInfo plugin_info;
const PluginEntryPoints* entry_points;
- if (!ReadPluginInfo(path, plugin_info, &entry_points))
- return false;
+ if (!ReadPluginInfo(path, &plugin_info, &entry_points))
+ return;
- if (!ShouldLoadPlugin(*plugin_info, plugin_groups))
- return false;
+ if (!ShouldLoadPlugin(plugin_info, plugin_groups))
+ return;
#if defined(OS_WIN) && !defined(NDEBUG)
if (path.BaseName().value() != L"npspy.dll") // Make an exception for NPSPY
#endif
{
- for (size_t i = 0; i < plugin_info->mime_types.size(); ++i) {
+ for (size_t i = 0; i < plugin_info.mime_types.size(); ++i) {
// TODO: don't load global handlers for now.
// WebKit hands to the Plugin before it tries
// to handle mimeTypes on its own.
- const std::string &mime_type = plugin_info->mime_types[i].mime_type;
+ const std::string &mime_type = plugin_info.mime_types[i].mime_type;
if (mime_type == "*")
- return false;
+ return;
}
}
- AddToPluginGroups(*plugin_info, plugin_groups);
- return true;
+
+ base::AutoLock lock(lock_);
+ AddToPluginGroups(plugin_info, plugin_groups);
}
void PluginList::GetPluginPathsToLoad(std::vector<FilePath>* plugin_paths) {
« no previous file with comments | « webkit/plugins/npapi/plugin_list.h ('k') | webkit/plugins/npapi/plugin_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698