| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 << actual_mime_type << " (expected " << orig_mime_type | 46 << actual_mime_type << " (expected " << orig_mime_type |
| 47 << ")"; | 47 << ")"; |
| 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 | |
| 57 // chrome/browser/resources/plugins_*.json correspondingly! | |
| 58 // In particular, the identifier and the update URLs need to be kept in sync. | |
| 59 | |
| 60 // Some version ranges can be shared across operating systems. This should be | 56 // Some version ranges can be shared across operating systems. This should be |
| 61 // done where possible to avoid duplication. | 57 // done where possible to avoid duplication. |
| 58 // TODO(bauerb): The |requires_authorization| flag should be part of |
| 59 // PluginGroupDefinition, not VersionRangeDefinition. |
| 60 static const VersionRangeDefinition kAllVersionsInfobarVersionRange[] = { |
| 61 { "", "", "", true } |
| 62 }; |
| 63 |
| 64 static const VersionRangeDefinition kAllVersionsNoInfobarVersionRange[] = { |
| 65 { "", "", "", false } |
| 66 }; |
| 62 | 67 |
| 63 // This is up to date with | 68 // This is up to date with |
| 64 // http://www.adobe.com/support/security/bulletins/apsb12-03.html | 69 // 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 | 70 // 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. | 71 // on some platforms, such as Linux, it is not available. |
| 67 static const VersionRangeDefinition kFlashVersionRange[] = { | 72 static const VersionRangeDefinition kFlashVersionRange[] = { |
| 68 { "", "", "11.1.102" } | 73 { "", "", "11.1.102", false } |
| 69 }; | 74 }; |
| 70 // This is up to date with | 75 // This is up to date with |
| 71 // http://www.adobe.com/support/security/bulletins/apsb12-02.html | 76 // http://www.adobe.com/support/security/bulletins/apsb12-02.html |
| 72 static const VersionRangeDefinition kShockwaveVersionRange[] = { | 77 static const VersionRangeDefinition kShockwaveVersionRange[] = { |
| 73 { "", "", "11.6.4.634" } | 78 { "", "", "11.6.4.634", true } |
| 74 }; | 79 }; |
| 75 // This is up to date with | 80 // This is up to date with |
| 76 // http://support.microsoft.com/kb/2668562 | 81 // http://support.microsoft.com/kb/2668562 |
| 77 // http://technet.microsoft.com/en-us/security/Bulletin/MS12-016 | 82 // http://technet.microsoft.com/en-us/security/Bulletin/MS12-016 |
| 78 static const VersionRangeDefinition kSilverlightVersionRange[] = { | 83 static const VersionRangeDefinition kSilverlightVersionRange[] = { |
| 79 { "0", "5", "4.1.10111.0" }, | 84 { "0", "5", "4.1.10111.0", false }, |
| 80 { "5", "6", "" }, | 85 { "5", "6", "", false }, |
| 81 }; | 86 }; |
| 82 | 87 |
| 83 // Similarly, try and share the group definition for plug-ins that are | 88 // Similarly, try and share the group definition for plug-ins that are |
| 84 // very consistent across OS'es. | 89 // very consistent across OS'es. |
| 85 #define kFlashDefinition { \ | 90 #define kFlashDefinition { \ |
| 86 "adobe-flash-player", "Flash", "Shockwave Flash", kFlashVersionRange,\ | 91 "adobe-flash-player", "Flash", "Shockwave Flash", kFlashVersionRange,\ |
| 87 arraysize(kFlashVersionRange) } | 92 arraysize(kFlashVersionRange), "http://get.adobe.com/flashplayer/" } |
| 88 | 93 |
| 89 #define kShockwaveDefinition { \ | 94 #define kShockwaveDefinition { \ |
| 90 "shockwave", PluginGroup::kShockwaveGroupName, "Shockwave for Director", \ | 95 "shockwave", PluginGroup::kShockwaveGroupName, "Shockwave for Director", \ |
| 91 kShockwaveVersionRange, arraysize(kShockwaveVersionRange) } | 96 kShockwaveVersionRange, arraysize(kShockwaveVersionRange), \ |
| 97 "http://www.adobe.com/shockwave/download/" } |
| 92 | 98 |
| 93 #define kSilverlightDefinition { \ | 99 #define kSilverlightDefinition { \ |
| 94 "silverlight", PluginGroup::kSilverlightGroupName, "Silverlight", \ | 100 "silverlight", PluginGroup::kSilverlightGroupName, "Silverlight", \ |
| 95 kSilverlightVersionRange, arraysize(kSilverlightVersionRange) } | 101 kSilverlightVersionRange, arraysize(kSilverlightVersionRange), \ |
| 102 "http://www.microsoft.com/getsilverlight/" } |
| 96 | 103 |
| 97 #define kChromePdfDefinition { \ | 104 #define kChromePdfDefinition { \ |
| 98 "google-chrome-pdf", "Chrome PDF Viewer", "Chrome PDF Viewer", NULL, 0 } | 105 "google-chrome-pdf", "Chrome PDF Viewer", "Chrome PDF Viewer", \ |
| 106 kAllVersionsNoInfobarVersionRange, \ |
| 107 arraysize(kAllVersionsNoInfobarVersionRange), "" } |
| 99 | 108 |
| 100 #define kGoogleTalkDefinition { \ | 109 #define kGoogleTalkDefinition { \ |
| 101 "google-talk", "Google Talk", "Google Talk", NULL, 0 } | 110 "google-talk", "Google Talk", "Google Talk", \ |
| 111 kAllVersionsNoInfobarVersionRange, \ |
| 112 arraysize(kAllVersionsNoInfobarVersionRange), ""} |
| 102 | 113 |
| 103 #if defined(OS_MACOSX) | 114 #if defined(OS_MACOSX) |
| 104 // Plugin Groups for Mac. | 115 // Plugin Groups for Mac. |
| 105 // Plugins are listed here as soon as vulnerabilities and solutions | 116 // Plugins are listed here as soon as vulnerabilities and solutions |
| 106 // (new versions) are published. | 117 // (new versions) are published. |
| 107 static const VersionRangeDefinition kQuicktimeVersionRange[] = { | 118 static const VersionRangeDefinition kQuicktimeVersionRange[] = { |
| 108 { "", "", "7.6.6" } | 119 { "", "", "7.6.6", true } |
| 109 }; | 120 }; |
| 110 static const VersionRangeDefinition kJavaVersionRange[] = { | 121 static const VersionRangeDefinition kJavaVersionRange[] = { |
| 111 { "0", "13.0", "12.8.0" }, // Leopard | 122 { "0", "13.0", "12.8.0", true }, // Leopard |
| 112 { "13.0", "14.0", "13.5.0" }, // Snow Leopard | 123 { "13.0", "14.0", "13.5.0", true }, // Snow Leopard |
| 113 { "14.0", "", "14.0.3" } // Lion | 124 { "14.0", "", "14.0.3", true } // Lion |
| 114 }; | 125 }; |
| 115 static const VersionRangeDefinition kFlip4MacVersionRange[] = { | 126 static const VersionRangeDefinition kFlip4MacVersionRange[] = { |
| 116 { "", "", "2.2.1" } | 127 { "", "", "2.2.1", true } |
| 128 }; |
| 129 static const VersionRangeDefinition kDivXVersionRange[] = { |
| 130 { "", "", "", true } |
| 117 }; | 131 }; |
| 118 // Note: The Adobe Reader browser plug-in is not supported in Chrome. | 132 // Note: The Adobe Reader browser plug-in is not supported in Chrome. |
| 119 // Note: The Real Player plugin for mac doesn't expose a version at all. | 133 // Note: The Real Player plugin for mac doesn't expose a version at all. |
| 120 static const PluginGroupDefinition kGroupDefinitions[] = { | 134 static const PluginGroupDefinition kGroupDefinitions[] = { |
| 121 kFlashDefinition, | 135 kFlashDefinition, |
| 122 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in", | 136 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in", |
| 123 kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange) }, | 137 kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange), |
| 138 "http://www.apple.com/quicktime/download/" }, |
| 124 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", | 139 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", |
| 125 kJavaVersionRange, arraysize(kJavaVersionRange) }, | 140 kJavaVersionRange, arraysize(kJavaVersionRange), |
| 141 "http://support.apple.com/kb/HT1338" }, |
| 126 kSilverlightDefinition, | 142 kSilverlightDefinition, |
| 127 { "flip4mac", "Flip4Mac", "Flip4Mac", kFlip4MacVersionRange, | 143 { "flip4mac", "Flip4Mac", "Flip4Mac", kFlip4MacVersionRange, |
| 128 arraysize(kFlip4MacVersionRange) }, | 144 arraysize(kFlip4MacVersionRange), |
| 145 "http://www.telestream.net/flip4mac-wmv/overview.htm" }, |
| 129 { "divx-player", "DivX Plus Web Player", "DivX Plus Web Player", | 146 { "divx-player", "DivX Plus Web Player", "DivX Plus Web Player", |
| 130 NULL, 0 }, | 147 kDivXVersionRange, arraysize(kDivXVersionRange), |
| 148 "http://www.divx.com/en/software/divx-plus/web-player" }, |
| 131 kShockwaveDefinition, | 149 kShockwaveDefinition, |
| 132 kChromePdfDefinition, | 150 kChromePdfDefinition, |
| 133 kGoogleTalkDefinition, | 151 kGoogleTalkDefinition, |
| 134 }; | 152 }; |
| 135 | 153 |
| 136 #elif defined(OS_WIN) | 154 #elif defined(OS_WIN) |
| 137 // TODO(panayiotis): We should group "RealJukebox NS Plugin" with the rest of | 155 // TODO(panayiotis): We should group "RealJukebox NS Plugin" with the rest of |
| 138 // the RealPlayer files. | 156 // the RealPlayer files. |
| 139 static const VersionRangeDefinition kQuicktimeVersionRange[] = { | 157 static const VersionRangeDefinition kQuicktimeVersionRange[] = { |
| 140 { "", "", "7.6.9" } | 158 { "", "", "7.6.9", true } |
| 141 }; | 159 }; |
| 142 static const VersionRangeDefinition kJavaVersionRange[] = { | 160 static const VersionRangeDefinition kJavaVersionRange[] = { |
| 143 { "0", "7", "6.0.310" }, // "310" is not a typo. | 161 { "0", "7", "6.0.310", true }, // "310" is not a typo. |
| 144 { "7", "", "10.3" } // JDK7u3 identifies itself as 10.3 | 162 { "7", "", "10.3", true } // JDK7u3 identifies itself as 10.3 |
| 145 }; | 163 }; |
| 146 // This is up to date with | 164 // This is up to date with |
| 147 // http://www.adobe.com/support/security/bulletins/apsb12-01.html | 165 // http://www.adobe.com/support/security/bulletins/apsb12-01.html |
| 148 static const VersionRangeDefinition kAdobeReaderVersionRange[] = { | 166 static const VersionRangeDefinition kAdobeReaderVersionRange[] = { |
| 149 { "10", "11", "10.1.2" }, | 167 { "10", "11", "10.1.2", false }, |
| 150 { "0", "10", "9.5" } | 168 { "0", "10", "9.5", false } |
| 151 }; | 169 }; |
| 152 static const VersionRangeDefinition kDivXVersionRange[] = { | 170 static const VersionRangeDefinition kDivXVersionRange[] = { |
| 153 { "", "", "1.4.3.4" } | 171 { "", "", "1.4.3.4", true } |
| 154 }; | 172 }; |
| 155 // This is up to date with | 173 // This is up to date with |
| 156 // http://service.real.com/realplayer/security/02062012_player/en/ | 174 // http://service.real.com/realplayer/security/02062012_player/en/ |
| 157 static const VersionRangeDefinition kRealPlayerVersionRange[] = { | 175 static const VersionRangeDefinition kRealPlayerVersionRange[] = { |
| 158 { "", "", "15.0.2.71" } | 176 { "", "", "15.0.2.71", true } |
| 159 }; | 177 }; |
| 160 static const PluginGroupDefinition kGroupDefinitions[] = { | 178 static const PluginGroupDefinition kGroupDefinitions[] = { |
| 161 kFlashDefinition, | 179 kFlashDefinition, |
| 162 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in", | 180 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in", |
| 163 kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange) }, | 181 kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange), |
| 182 "http://www.apple.com/quicktime/download/" }, |
| 164 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", | 183 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", |
| 165 kJavaVersionRange, arraysize(kJavaVersionRange) }, | 184 kJavaVersionRange, arraysize(kJavaVersionRange), |
| 185 "http://www.java.com/download" }, |
| 166 { "adobe-reader", PluginGroup::kAdobeReaderGroupName, "Adobe Acrobat", | 186 { "adobe-reader", PluginGroup::kAdobeReaderGroupName, "Adobe Acrobat", |
| 167 kAdobeReaderVersionRange, arraysize(kAdobeReaderVersionRange) }, | 187 kAdobeReaderVersionRange, arraysize(kAdobeReaderVersionRange), |
| 188 "http://get.adobe.com/reader/" }, |
| 168 kSilverlightDefinition, | 189 kSilverlightDefinition, |
| 169 kShockwaveDefinition, | 190 kShockwaveDefinition, |
| 170 { "divx-player", "DivX Player", "DivX Web Player", kDivXVersionRange, | 191 { "divx-player", "DivX Player", "DivX Web Player", kDivXVersionRange, |
| 171 arraysize(kDivXVersionRange) }, | 192 arraysize(kDivXVersionRange), |
| 193 "http://download.divx.com/divx/autoupdate/player/" |
| 194 "DivXWebPlayerInstaller.exe" }, |
| 172 { "realplayer", PluginGroup::kRealPlayerGroupName, "RealPlayer", | 195 { "realplayer", PluginGroup::kRealPlayerGroupName, "RealPlayer", |
| 173 kRealPlayerVersionRange, arraysize(kRealPlayerVersionRange) }, | 196 kRealPlayerVersionRange, arraysize(kRealPlayerVersionRange), |
| 197 "http://www.real.com/realplayer/download" }, |
| 174 // These are here for grouping, no vulnerabilities known. | 198 // These are here for grouping, no vulnerabilities known. |
| 175 { "windows-media-player", PluginGroup::kWindowsMediaPlayerGroupName, | 199 { "windows-media-player", PluginGroup::kWindowsMediaPlayerGroupName, |
| 176 "Windows Media Player", NULL, 0 }, | 200 "Windows Media Player", kAllVersionsInfobarVersionRange, |
| 201 arraysize(kAllVersionsInfobarVersionRange), "" }, |
| 177 { "microsoft-office", "Microsoft Office", "Microsoft Office", | 202 { "microsoft-office", "Microsoft Office", "Microsoft Office", |
| 178 NULL, 0 }, | 203 NULL, 0, "" }, |
| 179 { "nvidia-3d", "NVIDIA 3D", "NVIDIA 3D", NULL, 0 }, | 204 { "nvidia-3d", "NVIDIA 3D", "NVIDIA 3D", kAllVersionsInfobarVersionRange, |
| 205 arraysize(kAllVersionsInfobarVersionRange), "" }, |
| 180 kChromePdfDefinition, | 206 kChromePdfDefinition, |
| 181 kGoogleTalkDefinition, | 207 kGoogleTalkDefinition, |
| 182 }; | 208 }; |
| 183 | 209 |
| 184 #elif defined(OS_CHROMEOS) | 210 #elif defined(OS_CHROMEOS) |
| 185 // ChromeOS generally has (autoupdated) system plug-ins and no user-installable | 211 // ChromeOS generally has (autoupdated) system plug-ins and no user-installable |
| 186 // plug-ins, so we just use these definitions for grouping. | 212 // plug-ins, so we just use these definitions for grouping. |
| 187 static const PluginGroupDefinition kGroupDefinitions[] = { | 213 static const PluginGroupDefinition kGroupDefinitions[] = { |
| 188 kFlashDefinition, | 214 kFlashDefinition, |
| 189 kChromePdfDefinition, | 215 kChromePdfDefinition, |
| 190 }; | 216 }; |
| 191 | 217 |
| 192 #else // Most importantly, covers desktop Linux. | 218 #else // Most importantly, covers desktop Linux. |
| 193 static const VersionRangeDefinition kJavaVersionRange[] = { | 219 static const VersionRangeDefinition kJavaVersionRange[] = { |
| 194 { "0", "1.7", "1.6.0.31" }, | 220 { "0", "1.7", "1.6.0.31", true }, |
| 195 { "1.7", "", "1.7.0.3" } | 221 { "1.7", "", "1.7.0.3", true } |
| 196 }; | 222 }; |
| 197 | 223 |
| 198 // Up to date with: | 224 // Up to date with: |
| 199 // http://blog.fuseyism.com/index.php/2012/02/15/ | 225 // http://blog.fuseyism.com/index.php/2012/02/15/ |
| 200 // security-icedtea6-1-8-13-1-9-13-1-10-6-and-icedtea-2-0-1-released/ | 226 // security-icedtea6-1-8-13-1-9-13-1-10-6-and-icedtea-2-0-1-released/ |
| 201 static const VersionRangeDefinition kRedhatIcedTeaVersionRange[] = { | 227 static const VersionRangeDefinition kRedhatIcedTeaVersionRange[] = { |
| 202 { "0", "1.9", "1.8.13" }, | 228 { "0", "1.9", "1.8.13", true }, |
| 203 { "1.9", "1.10", "1.9.13" }, | 229 { "1.9", "1.10", "1.9.13", true }, |
| 204 { "1.10", "2", "1.10.6" }, | 230 { "1.10", "2", "1.10.6", true }, |
| 205 { "2", "", "2.0.1" } | 231 { "2", "", "2.0.1", true } |
| 206 }; | 232 }; |
| 207 | 233 |
| 208 static const PluginGroupDefinition kGroupDefinitions[] = { | 234 static const PluginGroupDefinition kGroupDefinitions[] = { |
| 209 // Flash on Linux is significant because there isn't yet a built-in Flash | 235 // Flash on Linux is significant because there isn't yet a built-in Flash |
| 210 // plug-in on the Linux 64-bit version of Chrome. | 236 // plug-in on the Linux 64-bit version of Chrome. |
| 211 kFlashDefinition, | 237 kFlashDefinition, |
| 212 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", | 238 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", |
| 213 kJavaVersionRange, arraysize(kJavaVersionRange) }, | 239 kJavaVersionRange, arraysize(kJavaVersionRange), |
| 240 "http://www.java.com/en/download/manual.jsp" }, |
| 214 { "redhat-icetea-java", "IcedTea", "IcedTea", | 241 { "redhat-icetea-java", "IcedTea", "IcedTea", |
| 215 kRedhatIcedTeaVersionRange, arraysize(kRedhatIcedTeaVersionRange) }, | 242 kRedhatIcedTeaVersionRange, arraysize(kRedhatIcedTeaVersionRange), |
| 243 "http://www.linuxsecurity.com/content/section/3/170/" }, |
| 216 kChromePdfDefinition, | 244 kChromePdfDefinition, |
| 217 kGoogleTalkDefinition, | 245 kGoogleTalkDefinition, |
| 218 }; | 246 }; |
| 219 #endif | 247 #endif |
| 220 | 248 |
| 221 // static | 249 // static |
| 222 PluginList* PluginList::Singleton() { | 250 PluginList* PluginList::Singleton() { |
| 223 return g_singleton.Pointer(); | 251 return g_singleton.Pointer(); |
| 224 } | 252 } |
| 225 | 253 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 | 433 |
| 406 if (!will_load_callback.is_null()) | 434 if (!will_load_callback.is_null()) |
| 407 will_load_callback.Run(); | 435 will_load_callback.Run(); |
| 408 | 436 |
| 409 std::vector<FilePath> plugin_paths; | 437 std::vector<FilePath> plugin_paths; |
| 410 GetPluginPathsToLoad(&plugin_paths); | 438 GetPluginPathsToLoad(&plugin_paths); |
| 411 | 439 |
| 412 for (std::vector<FilePath>::const_iterator it = plugin_paths.begin(); | 440 for (std::vector<FilePath>::const_iterator it = plugin_paths.begin(); |
| 413 it != plugin_paths.end(); | 441 it != plugin_paths.end(); |
| 414 ++it) { | 442 ++it) { |
| 415 WebPluginInfo plugin_info; | 443 LoadPlugin(*it, plugin_groups); |
| 416 LoadPlugin(*it, plugin_groups, &plugin_info); | |
| 417 } | 444 } |
| 418 } | 445 } |
| 419 | 446 |
| 420 void PluginList::LoadPlugins() { | 447 void PluginList::LoadPlugins() { |
| 421 { | 448 { |
| 422 base::AutoLock lock(lock_); | 449 base::AutoLock lock(lock_); |
| 423 if (!plugins_need_refresh_) | 450 if (!plugins_need_refresh_) |
| 424 return; | 451 return; |
| 425 } | 452 } |
| 426 | 453 |
| 427 ScopedVector<PluginGroup> new_plugin_groups; | 454 ScopedVector<PluginGroup> new_plugin_groups; |
| 428 // Do the actual loading of the plugins. | 455 // Do the actual loading of the plugins. |
| 429 LoadPluginsInternal(&new_plugin_groups); | 456 LoadPluginsInternal(&new_plugin_groups); |
| 430 | 457 |
| 431 base::AutoLock lock(lock_); | 458 base::AutoLock lock(lock_); |
| 432 plugin_groups_.swap(new_plugin_groups); | 459 plugin_groups_.swap(new_plugin_groups); |
| 433 } | 460 } |
| 434 | 461 |
| 435 bool PluginList::LoadPlugin(const FilePath& path, | 462 void PluginList::LoadPlugin(const FilePath& path, |
| 436 ScopedVector<PluginGroup>* plugin_groups, | 463 ScopedVector<PluginGroup>* plugin_groups) { |
| 437 WebPluginInfo* plugin_info) { | |
| 438 LOG_IF(ERROR, PluginList::DebugPluginLoading()) | 464 LOG_IF(ERROR, PluginList::DebugPluginLoading()) |
| 439 << "Loading plugin " << path.value(); | 465 << "Loading plugin " << path.value(); |
| 466 WebPluginInfo plugin_info; |
| 440 const PluginEntryPoints* entry_points; | 467 const PluginEntryPoints* entry_points; |
| 441 | 468 |
| 442 if (!ReadPluginInfo(path, plugin_info, &entry_points)) | 469 if (!ReadPluginInfo(path, &plugin_info, &entry_points)) |
| 443 return false; | 470 return; |
| 444 | 471 |
| 445 if (!ShouldLoadPlugin(*plugin_info, plugin_groups)) | 472 if (!ShouldLoadPlugin(plugin_info, plugin_groups)) |
| 446 return false; | 473 return; |
| 447 | 474 |
| 448 #if defined(OS_WIN) && !defined(NDEBUG) | 475 #if defined(OS_WIN) && !defined(NDEBUG) |
| 449 if (path.BaseName().value() != L"npspy.dll") // Make an exception for NPSPY | 476 if (path.BaseName().value() != L"npspy.dll") // Make an exception for NPSPY |
| 450 #endif | 477 #endif |
| 451 { | 478 { |
| 452 for (size_t i = 0; i < plugin_info->mime_types.size(); ++i) { | 479 for (size_t i = 0; i < plugin_info.mime_types.size(); ++i) { |
| 453 // TODO: don't load global handlers for now. | 480 // TODO: don't load global handlers for now. |
| 454 // WebKit hands to the Plugin before it tries | 481 // WebKit hands to the Plugin before it tries |
| 455 // to handle mimeTypes on its own. | 482 // to handle mimeTypes on its own. |
| 456 const std::string &mime_type = plugin_info->mime_types[i].mime_type; | 483 const std::string &mime_type = plugin_info.mime_types[i].mime_type; |
| 457 if (mime_type == "*") | 484 if (mime_type == "*") |
| 458 return false; | 485 return; |
| 459 } | 486 } |
| 460 } | 487 } |
| 461 AddToPluginGroups(*plugin_info, plugin_groups); | 488 |
| 462 return true; | 489 base::AutoLock lock(lock_); |
| 490 AddToPluginGroups(plugin_info, plugin_groups); |
| 463 } | 491 } |
| 464 | 492 |
| 465 void PluginList::GetPluginPathsToLoad(std::vector<FilePath>* plugin_paths) { | 493 void PluginList::GetPluginPathsToLoad(std::vector<FilePath>* plugin_paths) { |
| 466 // Don't want to hold the lock while loading new plugins, so we don't block | 494 // Don't want to hold the lock while loading new plugins, so we don't block |
| 467 // other methods if they're called on other threads. | 495 // other methods if they're called on other threads. |
| 468 std::vector<FilePath> extra_plugin_paths; | 496 std::vector<FilePath> extra_plugin_paths; |
| 469 std::vector<FilePath> extra_plugin_dirs; | 497 std::vector<FilePath> extra_plugin_dirs; |
| 470 { | 498 { |
| 471 base::AutoLock lock(lock_); | 499 base::AutoLock lock(lock_); |
| 472 extra_plugin_paths = extra_plugin_paths_; | 500 extra_plugin_paths = extra_plugin_paths_; |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 } | 740 } |
| 713 return false; | 741 return false; |
| 714 } | 742 } |
| 715 | 743 |
| 716 PluginList::~PluginList() { | 744 PluginList::~PluginList() { |
| 717 } | 745 } |
| 718 | 746 |
| 719 | 747 |
| 720 } // namespace npapi | 748 } // namespace npapi |
| 721 } // namespace webkit | 749 } // namespace webkit |
| OLD | NEW |