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

Side by Side Diff: webkit/plugins/npapi/plugin_list.cc

Issue 10263022: Move version metadata from PluginGroup into PluginInstaller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 and the update URLs need to be kept in sync. 58 // In particular, the identifier needs to be kept in sync.
59 59
60 // Some version ranges can be shared across operating systems. This should be 60 // Try and share the group definition for plug-ins that are
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
84 // very consistent across OS'es. 61 // very consistent across OS'es.
85 #define kFlashDefinition { \ 62 #define kFlashDefinition { \
86 "adobe-flash-player", "Flash", "Shockwave Flash", kFlashVersionRange, \ 63 "adobe-flash-player", "Flash", "Shockwave Flash" }
87 arraysize(kFlashVersionRange) }
88 64
89 #define kShockwaveDefinition { \ 65 #define kShockwaveDefinition { \
90 "adobe-shockwave", PluginGroup::kShockwaveGroupName, \ 66 "adobe-shockwave", PluginGroup::kShockwaveGroupName, \
91 "Shockwave for Director", kShockwaveVersionRange, \ 67 "Shockwave for Director" }
92 arraysize(kShockwaveVersionRange) }
93 68
94 #define kSilverlightDefinition { \ 69 #define kSilverlightDefinition { \
95 "silverlight", PluginGroup::kSilverlightGroupName, "Silverlight", \ 70 "silverlight", PluginGroup::kSilverlightGroupName, "Silverlight" }
96 kSilverlightVersionRange, arraysize(kSilverlightVersionRange) }
97 71
98 #define kChromePdfDefinition { \ 72 #define kChromePdfDefinition { \
99 "google-chrome-pdf", "Chrome PDF Viewer", "Chrome PDF Viewer", NULL, 0 } 73 "google-chrome-pdf", "Chrome PDF Viewer", "Chrome PDF Viewer" }
100 74
101 #define kGoogleTalkDefinition { \ 75 #define kGoogleTalkDefinition { \
102 "google-talk", "Google Talk", "Google Talk", NULL, 0 } 76 "google-talk", "Google Talk", "Google Talk" }
103 77
104 #if defined(OS_MACOSX) 78 #if defined(OS_MACOSX)
105 // Plugin Groups for Mac. 79 // Plugin Groups for Mac.
106 // Plugins are listed here as soon as vulnerabilities and solutions 80
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.
121 static const PluginGroupDefinition kGroupDefinitions[] = { 81 static const PluginGroupDefinition kGroupDefinitions[] = {
122 kFlashDefinition, 82 kFlashDefinition,
123 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in", 83 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in" },
124 kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange) }, 84 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java" },
125 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java",
126 kJavaVersionRange, arraysize(kJavaVersionRange) },
127 kSilverlightDefinition, 85 kSilverlightDefinition,
128 { "flip4mac", "Flip4Mac", "Flip4Mac", kFlip4MacVersionRange, 86 { "flip4mac", "Flip4Mac", "Flip4Mac" },
129 arraysize(kFlip4MacVersionRange) }, 87 { "divx-player", "DivX Plus Web Player", "DivX Plus Web Player" },
130 { "divx-player", "DivX Plus Web Player", "DivX Plus Web Player",
131 NULL, 0 },
132 kShockwaveDefinition, 88 kShockwaveDefinition,
133 kChromePdfDefinition, 89 kChromePdfDefinition,
134 kGoogleTalkDefinition, 90 kGoogleTalkDefinition,
135 }; 91 };
136 92
137 #elif defined(OS_WIN) 93 #elif defined(OS_WIN)
138 // TODO(panayiotis): We should group "RealJukebox NS Plugin" with the rest of 94 // TODO(panayiotis): We should group "RealJukebox NS Plugin" with the rest of
139 // the RealPlayer files. 95 // the RealPlayer files.
140 static const VersionRangeDefinition kQuicktimeVersionRange[] = { 96
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 };
161 static const PluginGroupDefinition kGroupDefinitions[] = { 97 static const PluginGroupDefinition kGroupDefinitions[] = {
162 kFlashDefinition, 98 kFlashDefinition,
163 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in", 99 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in" },
164 kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange) }, 100 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java" },
165 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", 101 { "adobe-reader", PluginGroup::kAdobeReaderGroupName, "Adobe Acrobat" },
166 kJavaVersionRange, arraysize(kJavaVersionRange) },
167 { "adobe-reader", PluginGroup::kAdobeReaderGroupName, "Adobe Acrobat",
168 kAdobeReaderVersionRange, arraysize(kAdobeReaderVersionRange) },
169 kSilverlightDefinition, 102 kSilverlightDefinition,
170 kShockwaveDefinition, 103 kShockwaveDefinition,
171 { "divx-player", "DivX Player", "DivX Web Player", kDivXVersionRange, 104 { "divx-player", "DivX Player", "DivX Web Player" },
172 arraysize(kDivXVersionRange) }, 105 { "realplayer", PluginGroup::kRealPlayerGroupName, "RealPlayer" },
173 { "realplayer", PluginGroup::kRealPlayerGroupName, "RealPlayer",
174 kRealPlayerVersionRange, arraysize(kRealPlayerVersionRange) },
175 // These are here for grouping, no vulnerabilities known.
176 { "windows-media-player", PluginGroup::kWindowsMediaPlayerGroupName, 106 { "windows-media-player", PluginGroup::kWindowsMediaPlayerGroupName,
177 "Windows Media Player", NULL, 0 }, 107 "Windows Media Player" },
178 { "microsoft-office", "Microsoft Office", "Microsoft Office", 108 { "microsoft-office", "Microsoft Office", "Microsoft Office" },
179 NULL, 0 }, 109 { "nvidia-3d", "NVIDIA 3D", "NVIDIA 3D" },
180 { "nvidia-3d", "NVIDIA 3D", "NVIDIA 3D", NULL, 0 },
181 kChromePdfDefinition, 110 kChromePdfDefinition,
182 kGoogleTalkDefinition, 111 kGoogleTalkDefinition,
183 }; 112 };
184 113
185 #elif defined(OS_CHROMEOS) 114 #elif defined(OS_CHROMEOS)
186 // ChromeOS generally has (autoupdated) system plug-ins and no user-installable 115 // ChromeOS generally has (autoupdated) system plug-ins and no user-installable
187 // plug-ins, so we just use these definitions for grouping. 116 // plug-ins, so we just use these definitions for grouping.
188 static const PluginGroupDefinition kGroupDefinitions[] = { 117 static const PluginGroupDefinition kGroupDefinitions[] = {
189 kFlashDefinition, 118 kFlashDefinition,
190 kChromePdfDefinition, 119 kChromePdfDefinition,
191 }; 120 };
192 121
193 #else // Most importantly, covers desktop Linux. 122 #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 };
208 123
209 static const PluginGroupDefinition kGroupDefinitions[] = { 124 static const PluginGroupDefinition kGroupDefinitions[] = {
210 // Flash on Linux is significant because there isn't yet a built-in Flash 125 // Flash on Linux is significant because there isn't yet a built-in Flash
211 // plug-in on the Linux 64-bit version of Chrome. 126 // plug-in on the Linux 64-bit version of Chrome.
212 kFlashDefinition, 127 kFlashDefinition,
213 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", 128 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java" },
214 kJavaVersionRange, arraysize(kJavaVersionRange) }, 129 { "redhat-icetea-java", "IcedTea", "IcedTea" },
215 { "redhat-icetea-java", "IcedTea", "IcedTea",
216 kRedhatIcedTeaVersionRange, arraysize(kRedhatIcedTeaVersionRange) },
217 kChromePdfDefinition, 130 kChromePdfDefinition,
218 kGoogleTalkDefinition, 131 kGoogleTalkDefinition,
219 }; 132 };
220 #endif 133 #endif
221 134
222 // static 135 // static
223 PluginList* PluginList::Singleton() { 136 PluginList* PluginList::Singleton() {
224 return g_singleton.Pointer(); 137 return g_singleton.Pointer();
225 } 138 }
226 139
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 } 633 }
721 return false; 634 return false;
722 } 635 }
723 636
724 PluginList::~PluginList() { 637 PluginList::~PluginList() {
725 } 638 }
726 639
727 640
728 } // namespace npapi 641 } // namespace npapi
729 } // namespace webkit 642 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/npapi/plugin_group_unittest.cc ('k') | webkit/plugins/npapi/plugin_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698