Changeset 88735 in webkit
- Timestamp:
- Jun 13, 2011 5:10:23 PM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r88722 r88735 1 2011-06-13 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Crash when trying to use Netflix Watch Instantly with Silverlight 3 6 https://bugs.webkit.org/show_bug.cgi?id=62611 7 <rdar://problem/9058370> 8 9 * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: 10 (WebKit::NetscapePluginModule::getPluginInfo): 11 Get the plug-in version string instead of the version number. 12 13 (WebKit::PluginVersion::isValid): 14 (WebKit::PluginVersion::PluginVersion): 15 (WebKit::PluginVersion::parse): 16 (WebKit::PluginVersion::isLessThan): 17 Add a new PluginVersion class that represents a plug-in version. The idea is 18 that this class be made cross platform. 19 20 (WebKit::NetscapePluginModule::determineQuirks): 21 Add the ReturnsNonRetainedScriptableNPObject quirk for versions of Silverlight less than 4. 22 23 * Shared/Plugins/PluginQuirks.h: 24 Add the ReturnsNonRetainedScriptableNPObject quirk. 25 26 * UIProcess/Plugins/PluginInfoStore.h: 27 Use a version string. Eventually this should hold the PluginVersion class we added. 28 29 * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: 30 (WebKit::NetscapePlugin::pluginScriptableNPObject): 31 If the plug-in has the ReturnsNonRetainedScriptableNPObject quirk, do an extra retain. 32 1 33 2011-06-13 Ryuan Choi <ryuan.choi@samsung.com> 2 34 -
trunk/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm
r88677 r88735 365 365 plugin.path = pluginPath; 366 366 plugin.bundleIdentifier = CFBundleGetIdentifier(bundle.get()); 367 plugin.versionNumber = CFBundleGetVersionNumber(bundle.get()); 367 if (CFTypeRef versionTypeRef = CFBundleGetValueForInfoDictionaryKey(bundle.get(), kCFBundleVersionKey)) { 368 if (CFGetTypeID(versionTypeRef) == CFStringGetTypeID()) 369 plugin.versionString = static_cast<CFStringRef>(versionTypeRef); 370 } 368 371 369 372 // Check that there's valid info for this plug-in. … … 399 402 if (!createPluginMIMETypesPreferences) 400 403 return false; 401 404 402 405 createPluginMIMETypesPreferences(); 403 406 return true; 407 } 408 409 // FIXME: This doesn't need to be platform-specific. 410 class PluginVersion { 411 public: 412 static PluginVersion parse(const String& versionString); 413 414 bool isLessThan(unsigned componentA) const; 415 bool isValid() const { return !m_versionComponents.isEmpty(); } 416 417 private: 418 PluginVersion() 419 { 420 } 421 422 Vector<unsigned, 4> m_versionComponents; 423 }; 424 425 PluginVersion PluginVersion::parse(const String& versionString) 426 { 427 PluginVersion version; 428 429 Vector<String> versionStringComponents; 430 versionString.split(".", versionStringComponents); 431 for (size_t i = 0; i < versionStringComponents.size(); ++i) { 432 bool successfullyParsed = false; 433 unsigned versionComponent = versionStringComponents[i].toUInt(&successfullyParsed); 434 if (!successfullyParsed) 435 return PluginVersion(); 436 437 version.m_versionComponents.append(versionComponent); 438 } 439 440 return version; 441 } 442 443 bool PluginVersion::isLessThan(unsigned componentA) const 444 { 445 ASSERT(isValid()); 446 447 return m_versionComponents[0] < componentA; 404 448 } 405 449 … … 428 472 // there's a 'background' attribute. 429 473 m_pluginQuirks.add(PluginQuirks::MakeTransparentIfBackgroundAttributeExists); 474 475 PluginVersion pluginVersion = PluginVersion::parse(plugin.versionString); 476 if (pluginVersion.isValid()) { 477 if (pluginVersion.isLessThan(4)) { 478 // Versions of Silverlight prior to 4 don't retain the scriptable NPObject. 479 m_pluginQuirks.add(PluginQuirks::ReturnsNonRetainedScriptableNPObject); 480 } 481 } 430 482 } 431 483 -
trunk/Source/WebKit2/Shared/Plugins/PluginQuirks.h
r87945 r88735 60 60 ReturnsRetainedCoreAnimationLayer, 61 61 62 // Whether NPP_GetValue with NPPVpluginScriptableNPObject returns a non-retained NPObject or not. 63 // Versions of Silverlight prior to 4 never retained the returned NPObject. 64 ReturnsNonRetainedScriptableNPObject, 65 62 66 #ifndef NP_NO_QUICKDRAW 63 67 // Allow the plug-in to use the QuickDraw drawing model, since we know that the plug-in -
trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h
r85983 r88735 48 48 cpu_type_t pluginArchitecture; 49 49 String bundleIdentifier; 50 unsigned versionNumber;50 String versionString; 51 51 #elif PLATFORM(WIN) 52 52 uint64_t fileVersion; -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
r88171 r88735 28 28 29 29 #include "NPRuntimeObjectMap.h" 30 #include "NPRuntimeUtilities.h" 30 31 #include "NetscapePluginStream.h" 31 32 #include "PluginController.h" … … 738 739 if (NPP_GetValue(NPPVpluginScriptableNPObject, &scriptableNPObject) != NPERR_NO_ERROR) 739 740 return 0; 740 741 742 #if PLUGIN_ARCHITECTURE(MAC) 743 if (m_pluginModule->pluginQuirks().contains(PluginQuirks::ReturnsNonRetainedScriptableNPObject)) 744 retainNPObject(scriptableNPObject); 745 #endif 746 741 747 return scriptableNPObject; 742 748 }
Note: See TracChangeset
for help on using the changeset viewer.