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

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

Issue 9536013: Move |requires_authorization| flag for plug-ins out of webkit/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copyright 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 2d70c010359a1531dc9a82d6086e16ae20192c95..260fadfefed73b20df98fe8a0f16fbee98d9eee0 100644
--- a/webkit/plugins/npapi/plugin_list.cc
+++ b/webkit/plugins/npapi/plugin_list.cc
@@ -53,99 +53,81 @@ 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", false }
+ { "", "", "11.1.102" }
};
// This is up to date with
// http://www.adobe.com/support/security/bulletins/apsb12-02.html
static const VersionRangeDefinition kShockwaveVersionRange[] = {
- { "", "", "11.6.4.634", true }
+ { "", "", "11.6.4.634" }
};
// 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", false },
- { "5", "6", "", false },
+ { "0", "5", "4.1.10111.0" },
+ { "5", "6", "" },
};
// 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), "http://get.adobe.com/flashplayer/" }
+ arraysize(kFlashVersionRange) }
#define kShockwaveDefinition { \
"shockwave", PluginGroup::kShockwaveGroupName, "Shockwave for Director", \
- kShockwaveVersionRange, arraysize(kShockwaveVersionRange), \
- "http://www.adobe.com/shockwave/download/" }
+ kShockwaveVersionRange, arraysize(kShockwaveVersionRange) }
#define kSilverlightDefinition { \
"silverlight", PluginGroup::kSilverlightGroupName, "Silverlight", \
- kSilverlightVersionRange, arraysize(kSilverlightVersionRange), \
- "http://www.microsoft.com/getsilverlight/" }
+ kSilverlightVersionRange, arraysize(kSilverlightVersionRange) }
#define kChromePdfDefinition { \
- "google-chrome-pdf", "Chrome PDF Viewer", "Chrome PDF Viewer", \
- kAllVersionsNoInfobarVersionRange, \
- arraysize(kAllVersionsNoInfobarVersionRange), "" }
+ "google-chrome-pdf", "Chrome PDF Viewer", "Chrome PDF Viewer", NULL, 0 }
#define kGoogleTalkDefinition { \
- "google-talk", "Google Talk", "Google Talk", \
- kAllVersionsNoInfobarVersionRange, \
- arraysize(kAllVersionsNoInfobarVersionRange), ""}
+ "google-talk", "Google Talk", "Google Talk", NULL, 0 }
#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", true }
+ { "", "", "7.6.6" }
};
static const VersionRangeDefinition kJavaVersionRange[] = {
- { "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
+ { "0", "13.0", "12.8.0" }, // Leopard
+ { "13.0", "14.0", "13.5.0" }, // Snow Leopard
+ { "14.0", "", "14.0.3" } // Lion
};
static const VersionRangeDefinition kFlip4MacVersionRange[] = {
- { "", "", "2.2.1", true }
-};
-static const VersionRangeDefinition kDivXVersionRange[] = {
- { "", "", "", true }
+ { "", "", "2.2.1" }
};
// 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),
- "http://www.apple.com/quicktime/download/" },
+ kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange) },
{ "java-runtime-environment", PluginGroup::kJavaGroupName, "Java",
- kJavaVersionRange, arraysize(kJavaVersionRange),
- "http://support.apple.com/kb/HT1338" },
+ kJavaVersionRange, arraysize(kJavaVersionRange) },
kSilverlightDefinition,
{ "flip4mac", "Flip4Mac", "Flip4Mac", kFlip4MacVersionRange,
- arraysize(kFlip4MacVersionRange),
- "http://www.telestream.net/flip4mac-wmv/overview.htm" },
+ arraysize(kFlip4MacVersionRange) },
{ "divx-player", "DivX Plus Web Player", "DivX Plus Web Player",
- kDivXVersionRange, arraysize(kDivXVersionRange),
- "http://www.divx.com/en/software/divx-plus/web-player" },
+ NULL, 0 },
kShockwaveDefinition,
kChromePdfDefinition,
kGoogleTalkDefinition,
@@ -155,54 +137,46 @@ 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", true }
+ { "", "", "7.6.9" }
};
static const VersionRangeDefinition kJavaVersionRange[] = {
- { "0", "7", "6.0.310", true }, // "310" is not a typo.
- { "7", "", "10.3", true } // JDK7u3 identifies itself as 10.3
+ { "0", "7", "6.0.310" }, // "310" is not a typo.
+ { "7", "", "10.3" } // 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", false },
- { "0", "10", "9.5", false }
+ { "10", "11", "10.1.2" },
+ { "0", "10", "9.5" }
};
static const VersionRangeDefinition kDivXVersionRange[] = {
- { "", "", "1.4.3.4", true }
+ { "", "", "1.4.3.4" }
};
// This is up to date with
// http://service.real.com/realplayer/security/02062012_player/en/
static const VersionRangeDefinition kRealPlayerVersionRange[] = {
- { "", "", "15.0.2.71", true }
+ { "", "", "15.0.2.71" }
};
static const PluginGroupDefinition kGroupDefinitions[] = {
kFlashDefinition,
{ "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in",
- kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange),
- "http://www.apple.com/quicktime/download/" },
+ kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange) },
{ "java-runtime-environment", PluginGroup::kJavaGroupName, "Java",
- kJavaVersionRange, arraysize(kJavaVersionRange),
- "http://www.java.com/download" },
+ kJavaVersionRange, arraysize(kJavaVersionRange) },
{ "adobe-reader", PluginGroup::kAdobeReaderGroupName, "Adobe Acrobat",
- kAdobeReaderVersionRange, arraysize(kAdobeReaderVersionRange),
- "http://get.adobe.com/reader/" },
+ kAdobeReaderVersionRange, arraysize(kAdobeReaderVersionRange) },
kSilverlightDefinition,
kShockwaveDefinition,
{ "divx-player", "DivX Player", "DivX Web Player", kDivXVersionRange,
- arraysize(kDivXVersionRange),
- "http://download.divx.com/divx/autoupdate/player/"
- "DivXWebPlayerInstaller.exe" },
+ arraysize(kDivXVersionRange) },
{ "realplayer", PluginGroup::kRealPlayerGroupName, "RealPlayer",
- kRealPlayerVersionRange, arraysize(kRealPlayerVersionRange),
- "http://www.real.com/realplayer/download" },
+ kRealPlayerVersionRange, arraysize(kRealPlayerVersionRange) },
// These are here for grouping, no vulnerabilities known.
{ "windows-media-player", PluginGroup::kWindowsMediaPlayerGroupName,
- "Windows Media Player", kAllVersionsInfobarVersionRange,
- arraysize(kAllVersionsInfobarVersionRange), "" },
+ "Windows Media Player", NULL, 0 },
{ "microsoft-office", "Microsoft Office", "Microsoft Office",
- NULL, 0, "" },
- { "nvidia-3d", "NVIDIA 3D", "NVIDIA 3D", kAllVersionsInfobarVersionRange,
- arraysize(kAllVersionsInfobarVersionRange), "" },
+ NULL, 0 },
+ { "nvidia-3d", "NVIDIA 3D", "NVIDIA 3D", NULL, 0 },
kChromePdfDefinition,
kGoogleTalkDefinition,
};
@@ -217,18 +191,18 @@ static const PluginGroupDefinition kGroupDefinitions[] = {
#else // Most importantly, covers desktop Linux.
static const VersionRangeDefinition kJavaVersionRange[] = {
- { "0", "1.7", "1.6.0.31", true },
- { "1.7", "", "1.7.0.3", true }
+ { "0", "1.7", "1.6.0.31" },
+ { "1.7", "", "1.7.0.3" }
};
// 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", true },
- { "1.9", "1.10", "1.9.13", true },
- { "1.10", "2", "1.10.6", true },
- { "2", "", "2.0.1", true }
+ { "0", "1.9", "1.8.13" },
+ { "1.9", "1.10", "1.9.13" },
+ { "1.10", "2", "1.10.6" },
+ { "2", "", "2.0.1" }
};
static const PluginGroupDefinition kGroupDefinitions[] = {
@@ -236,11 +210,9 @@ static const PluginGroupDefinition kGroupDefinitions[] = {
// plug-in on the Linux 64-bit version of Chrome.
kFlashDefinition,
{ "java-runtime-environment", PluginGroup::kJavaGroupName, "Java",
- kJavaVersionRange, arraysize(kJavaVersionRange),
- "http://www.java.com/en/download/manual.jsp" },
+ kJavaVersionRange, arraysize(kJavaVersionRange) },
{ "redhat-icetea-java", "IcedTea", "IcedTea",
- kRedhatIcedTeaVersionRange, arraysize(kRedhatIcedTeaVersionRange),
- "http://www.linuxsecurity.com/content/section/3/170/" },
+ kRedhatIcedTeaVersionRange, arraysize(kRedhatIcedTeaVersionRange) },
kChromePdfDefinition,
kGoogleTalkDefinition,
};
@@ -440,7 +412,8 @@ void PluginList::LoadPluginsInternal(ScopedVector<PluginGroup>* plugin_groups) {
for (std::vector<FilePath>::const_iterator it = plugin_paths.begin();
it != plugin_paths.end();
++it) {
- LoadPlugin(*it, plugin_groups);
+ WebPluginInfo plugin_info;
+ LoadPlugin(*it, plugin_groups, &plugin_info);
}
}
@@ -459,35 +432,34 @@ void PluginList::LoadPlugins() {
plugin_groups_.swap(new_plugin_groups);
}
-void PluginList::LoadPlugin(const FilePath& path,
- ScopedVector<PluginGroup>* plugin_groups) {
+bool PluginList::LoadPlugin(const FilePath& path,
+ ScopedVector<PluginGroup>* plugin_groups,
+ WebPluginInfo* plugin_info) {
LOG_IF(ERROR, PluginList::DebugPluginLoading())
<< "Loading plugin " << path.value();
- WebPluginInfo plugin_info;
const PluginEntryPoints* entry_points;
- if (!ReadPluginInfo(path, &plugin_info, &entry_points))
- return;
+ if (!ReadPluginInfo(path, plugin_info, &entry_points))
+ return false;
- if (!ShouldLoadPlugin(plugin_info, plugin_groups))
- return;
+ if (!ShouldLoadPlugin(*plugin_info, plugin_groups))
+ return false;
#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;
+ return false;
}
}
-
- base::AutoLock lock(lock_);
- AddToPluginGroups(plugin_info, plugin_groups);
+ AddToPluginGroups(*plugin_info, plugin_groups);
+ return true;
}
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