OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/plugins/npapi/plugin_list.h" | 5 #include "webkit/plugins/npapi/plugin_list.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 return allow; | 48 return allow; |
49 } | 49 } |
50 | 50 |
51 } | 51 } |
52 | 52 |
53 namespace webkit { | 53 namespace webkit { |
54 namespace npapi { | 54 namespace npapi { |
55 | 55 |
56 // Note: If you change the plug-in definitions here, also update | 56 // Note: If you change the plug-in definitions here, also update |
57 // chrome/browser/resources/plugins_*.json correspondingly! | 57 // chrome/browser/resources/plugins_*.json correspondingly! |
58 // In particular, the identifier needs to be kept in sync. | 58 // In particular, the identifier and the update URLs need to be kept in sync. |
59 | 59 |
60 // Try and share the group definition for plug-ins that are | 60 // Some version ranges can be shared across operating systems. This should be |
| 61 // done where possible to avoid duplication. |
| 62 |
| 63 // This is up to date with |
| 64 // http://www.adobe.com/support/security/bulletins/apsb12-03.html |
| 65 // NOTE: We would like to go to the 4th component value but we cannot because |
| 66 // on some platforms, such as Linux, it is not available. |
| 67 static const VersionRangeDefinition kFlashVersionRange[] = { |
| 68 { "", "", "11.1.102" } |
| 69 }; |
| 70 // This is up to date with |
| 71 // http://www.adobe.com/support/security/bulletins/apsb12-02.html |
| 72 static const VersionRangeDefinition kShockwaveVersionRange[] = { |
| 73 { "", "", "11.6.4.634" } |
| 74 }; |
| 75 // This is up to date with |
| 76 // http://support.microsoft.com/kb/2668562 |
| 77 // http://technet.microsoft.com/en-us/security/Bulletin/MS12-016 |
| 78 static const VersionRangeDefinition kSilverlightVersionRange[] = { |
| 79 { "0", "5", "4.1.10111.0" }, |
| 80 { "5", "6", "" }, |
| 81 }; |
| 82 |
| 83 // Similarly, try and share the group definition for plug-ins that are |
61 // very consistent across OS'es. | 84 // very consistent across OS'es. |
62 #define kFlashDefinition { \ | 85 #define kFlashDefinition { \ |
63 "adobe-flash-player", "Flash", "Shockwave Flash" } | 86 "adobe-flash-player", "Flash", "Shockwave Flash", kFlashVersionRange, \ |
| 87 arraysize(kFlashVersionRange) } |
64 | 88 |
65 #define kShockwaveDefinition { \ | 89 #define kShockwaveDefinition { \ |
66 "adobe-shockwave", PluginGroup::kShockwaveGroupName, \ | 90 "adobe-shockwave", PluginGroup::kShockwaveGroupName, \ |
67 "Shockwave for Director" } | 91 "Shockwave for Director", kShockwaveVersionRange, \ |
| 92 arraysize(kShockwaveVersionRange) } |
68 | 93 |
69 #define kSilverlightDefinition { \ | 94 #define kSilverlightDefinition { \ |
70 "silverlight", PluginGroup::kSilverlightGroupName, "Silverlight" } | 95 "silverlight", PluginGroup::kSilverlightGroupName, "Silverlight", \ |
| 96 kSilverlightVersionRange, arraysize(kSilverlightVersionRange) } |
71 | 97 |
72 #define kChromePdfDefinition { \ | 98 #define kChromePdfDefinition { \ |
73 "google-chrome-pdf", "Chrome PDF Viewer", "Chrome PDF Viewer" } | 99 "google-chrome-pdf", "Chrome PDF Viewer", "Chrome PDF Viewer", NULL, 0 } |
74 | 100 |
75 #define kGoogleTalkDefinition { \ | 101 #define kGoogleTalkDefinition { \ |
76 "google-talk", "Google Talk", "Google Talk" } | 102 "google-talk", "Google Talk", "Google Talk", NULL, 0 } |
77 | 103 |
78 #if defined(OS_MACOSX) | 104 #if defined(OS_MACOSX) |
79 // Plugin Groups for Mac. | 105 // Plugin Groups for Mac. |
80 | 106 // Plugins are listed here as soon as vulnerabilities and solutions |
| 107 // (new versions) are published. |
| 108 static const VersionRangeDefinition kQuicktimeVersionRange[] = { |
| 109 { "", "", "7.6.6" } |
| 110 }; |
| 111 static const VersionRangeDefinition kJavaVersionRange[] = { |
| 112 { "0", "13.0", "12.8.0" }, // Leopard |
| 113 { "13.0", "14.0", "13.5.0" }, // Snow Leopard |
| 114 { "14.0", "", "14.0.3" } // Lion |
| 115 }; |
| 116 static const VersionRangeDefinition kFlip4MacVersionRange[] = { |
| 117 { "", "", "2.2.1" } |
| 118 }; |
| 119 // Note: The Adobe Reader browser plug-in is not supported in Chrome. |
| 120 // Note: The Real Player plugin for mac doesn't expose a version at all. |
81 static const PluginGroupDefinition kGroupDefinitions[] = { | 121 static const PluginGroupDefinition kGroupDefinitions[] = { |
82 kFlashDefinition, | 122 kFlashDefinition, |
83 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in" }, | 123 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in", |
84 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java" }, | 124 kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange) }, |
| 125 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", |
| 126 kJavaVersionRange, arraysize(kJavaVersionRange) }, |
85 kSilverlightDefinition, | 127 kSilverlightDefinition, |
86 { "flip4mac", "Flip4Mac", "Flip4Mac" }, | 128 { "flip4mac", "Flip4Mac", "Flip4Mac", kFlip4MacVersionRange, |
87 { "divx-player", "DivX Plus Web Player", "DivX Plus Web Player" }, | 129 arraysize(kFlip4MacVersionRange) }, |
| 130 { "divx-player", "DivX Plus Web Player", "DivX Plus Web Player", |
| 131 NULL, 0 }, |
88 kShockwaveDefinition, | 132 kShockwaveDefinition, |
89 kChromePdfDefinition, | 133 kChromePdfDefinition, |
90 kGoogleTalkDefinition, | 134 kGoogleTalkDefinition, |
91 }; | 135 }; |
92 | 136 |
93 #elif defined(OS_WIN) | 137 #elif defined(OS_WIN) |
94 // TODO(panayiotis): We should group "RealJukebox NS Plugin" with the rest of | 138 // TODO(panayiotis): We should group "RealJukebox NS Plugin" with the rest of |
95 // the RealPlayer files. | 139 // the RealPlayer files. |
96 | 140 static const VersionRangeDefinition kQuicktimeVersionRange[] = { |
| 141 { "", "", "7.6.9" } |
| 142 }; |
| 143 static const VersionRangeDefinition kJavaVersionRange[] = { |
| 144 { "0", "7", "6.0.310" }, // "310" is not a typo. |
| 145 { "7", "", "10.3" } // JDK7u3 identifies itself as 10.3 |
| 146 }; |
| 147 // This is up to date with |
| 148 // http://www.adobe.com/support/security/bulletins/apsb12-08.html |
| 149 static const VersionRangeDefinition kAdobeReaderVersionRange[] = { |
| 150 { "10", "11", "10.1.3" }, |
| 151 { "0", "10", "9.5.1" } |
| 152 }; |
| 153 static const VersionRangeDefinition kDivXVersionRange[] = { |
| 154 { "", "", "1.4.3.4" } |
| 155 }; |
| 156 // This is up to date with |
| 157 // http://service.real.com/realplayer/security/02062012_player/en/ |
| 158 static const VersionRangeDefinition kRealPlayerVersionRange[] = { |
| 159 { "", "", "15.0.2.71" } |
| 160 }; |
97 static const PluginGroupDefinition kGroupDefinitions[] = { | 161 static const PluginGroupDefinition kGroupDefinitions[] = { |
98 kFlashDefinition, | 162 kFlashDefinition, |
99 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in" }, | 163 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in", |
100 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java" }, | 164 kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange) }, |
101 { "adobe-reader", PluginGroup::kAdobeReaderGroupName, "Adobe Acrobat" }, | 165 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", |
| 166 kJavaVersionRange, arraysize(kJavaVersionRange) }, |
| 167 { "adobe-reader", PluginGroup::kAdobeReaderGroupName, "Adobe Acrobat", |
| 168 kAdobeReaderVersionRange, arraysize(kAdobeReaderVersionRange) }, |
102 kSilverlightDefinition, | 169 kSilverlightDefinition, |
103 kShockwaveDefinition, | 170 kShockwaveDefinition, |
104 { "divx-player", "DivX Player", "DivX Web Player" }, | 171 { "divx-player", "DivX Player", "DivX Web Player", kDivXVersionRange, |
105 { "realplayer", PluginGroup::kRealPlayerGroupName, "RealPlayer" }, | 172 arraysize(kDivXVersionRange) }, |
| 173 { "realplayer", PluginGroup::kRealPlayerGroupName, "RealPlayer", |
| 174 kRealPlayerVersionRange, arraysize(kRealPlayerVersionRange) }, |
| 175 // These are here for grouping, no vulnerabilities known. |
106 { "windows-media-player", PluginGroup::kWindowsMediaPlayerGroupName, | 176 { "windows-media-player", PluginGroup::kWindowsMediaPlayerGroupName, |
107 "Windows Media Player" }, | 177 "Windows Media Player", NULL, 0 }, |
108 { "microsoft-office", "Microsoft Office", "Microsoft Office" }, | 178 { "microsoft-office", "Microsoft Office", "Microsoft Office", |
109 { "nvidia-3d", "NVIDIA 3D", "NVIDIA 3D" }, | 179 NULL, 0 }, |
| 180 { "nvidia-3d", "NVIDIA 3D", "NVIDIA 3D", NULL, 0 }, |
110 kChromePdfDefinition, | 181 kChromePdfDefinition, |
111 kGoogleTalkDefinition, | 182 kGoogleTalkDefinition, |
112 }; | 183 }; |
113 | 184 |
114 #elif defined(OS_CHROMEOS) | 185 #elif defined(OS_CHROMEOS) |
115 // ChromeOS generally has (autoupdated) system plug-ins and no user-installable | 186 // ChromeOS generally has (autoupdated) system plug-ins and no user-installable |
116 // plug-ins, so we just use these definitions for grouping. | 187 // plug-ins, so we just use these definitions for grouping. |
117 static const PluginGroupDefinition kGroupDefinitions[] = { | 188 static const PluginGroupDefinition kGroupDefinitions[] = { |
118 kFlashDefinition, | 189 kFlashDefinition, |
119 kChromePdfDefinition, | 190 kChromePdfDefinition, |
120 }; | 191 }; |
121 | 192 |
122 #else // Most importantly, covers desktop Linux. | 193 #else // Most importantly, covers desktop Linux. |
| 194 static const VersionRangeDefinition kJavaVersionRange[] = { |
| 195 { "0", "1.7", "1.6.0.31" }, |
| 196 { "1.7", "", "1.7.0.3" } |
| 197 }; |
| 198 |
| 199 // Up to date with: |
| 200 // http://blog.fuseyism.com/index.php/2012/02/15/ |
| 201 // security-icedtea6-1-8-13-1-9-13-1-10-6-and-icedtea-2-0-1-released/ |
| 202 static const VersionRangeDefinition kRedhatIcedTeaVersionRange[] = { |
| 203 { "0", "1.9", "1.8.13" }, |
| 204 { "1.9", "1.10", "1.9.13" }, |
| 205 { "1.10", "2", "1.10.6" }, |
| 206 { "2", "", "2.0.1" } |
| 207 }; |
123 | 208 |
124 static const PluginGroupDefinition kGroupDefinitions[] = { | 209 static const PluginGroupDefinition kGroupDefinitions[] = { |
125 // Flash on Linux is significant because there isn't yet a built-in Flash | 210 // Flash on Linux is significant because there isn't yet a built-in Flash |
126 // plug-in on the Linux 64-bit version of Chrome. | 211 // plug-in on the Linux 64-bit version of Chrome. |
127 kFlashDefinition, | 212 kFlashDefinition, |
128 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java" }, | 213 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", |
129 { "redhat-icetea-java", "IcedTea", "IcedTea" }, | 214 kJavaVersionRange, arraysize(kJavaVersionRange) }, |
| 215 { "redhat-icetea-java", "IcedTea", "IcedTea", |
| 216 kRedhatIcedTeaVersionRange, arraysize(kRedhatIcedTeaVersionRange) }, |
130 kChromePdfDefinition, | 217 kChromePdfDefinition, |
131 kGoogleTalkDefinition, | 218 kGoogleTalkDefinition, |
132 }; | 219 }; |
133 #endif | 220 #endif |
134 | 221 |
135 // static | 222 // static |
136 PluginList* PluginList::Singleton() { | 223 PluginList* PluginList::Singleton() { |
137 return g_singleton.Pointer(); | 224 return g_singleton.Pointer(); |
138 } | 225 } |
139 | 226 |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 } | 720 } |
634 return false; | 721 return false; |
635 } | 722 } |
636 | 723 |
637 PluginList::~PluginList() { | 724 PluginList::~PluginList() { |
638 } | 725 } |
639 | 726 |
640 | 727 |
641 } // namespace npapi | 728 } // namespace npapi |
642 } // namespace webkit | 729 } // namespace webkit |
OLD | NEW |