Changeset 80007 in webkit
- Timestamp:
- Mar 1, 2011 9:47:11 AM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r80001 r80007 1 2011-03-01 Balazs Kelemen <kbalazs@webkit.org> 2 3 Reviewed by Anders Carlsson. 4 5 [Qt][WK2] Plugin initialization 6 https://bugs.webkit.org/show_bug.cgi?id=48127 7 8 Apply the quirks that are necessary for the flash plugin 9 to not crash on X11. 10 11 * Platform/qt/ModuleQt.cpp: 12 (WebKit::Module::load): Use the ResolveAllSymbols hint as we do in WebCore. 13 * Shared/Plugins/Netscape/NetscapePluginModule.cpp: 14 (WebKit::NetscapePluginModule::tryLoad): Call applyX11QuirksBeforeLoad 15 if PLUGIN_ARCHITECTURE is X11. 16 * Shared/Plugins/Netscape/NetscapePluginModule.h: 17 * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp: 18 (WebKit::initializeGTK): The same hack that we do in WebCore. 19 Call gtk_init because flash don't do it for itself. 20 (WebKit::NetscapePluginModule::applyX11QuirksBeforeLoad): Added for X11. 21 Do the hacks that we need to do before calling NP_Initialize on the 22 flash plugin to save it form crashing. 23 * Shared/Plugins/PluginQuirks.h: Use PLUGIN_ARCHITECTURE macros. 24 Added RequiresGTKToolKit quirk for X11. 25 * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: 26 (WebKit::NPN_GetValue): Handle the RequiresGTKToolKit quirk on X11. 27 * WebProcess/Plugins/Netscape/NetscapePlugin.h: 28 (WebKit::NetscapePlugin::quirks): Added getter for the PluginModule's 29 quirks to be available in NPN_GetValue. 30 1 31 2011-03-01 Adam Roben <aroben@apple.com> 2 32 -
trunk/Source/WebKit2/Platform/qt/ModuleQt.cpp
r76916 r80007 33 33 { 34 34 m_lib.setFileName(static_cast<QString>(m_path)); 35 m_lib.setLoadHints(QLibrary::ResolveAllSymbolsHint); 35 36 return m_lib.load(); 36 37 } -
trunk/Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.cpp
r79925 r80007 211 211 bool NetscapePluginModule::tryLoad() 212 212 { 213 #if PLUGIN_ARCHITECTURE(X11) 214 applyX11QuirksBeforeLoad(); 215 #endif 216 213 217 m_module = adoptPtr(new Module(m_pluginPath)); 214 218 if (!m_module->load()) -
trunk/Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.h
r78800 r80007 65 65 void determineQuirks(); 66 66 67 #if PLUGIN_ARCHITECTURE(X11) 68 void applyX11QuirksBeforeLoad(); 69 #endif 70 67 71 void incrementLoadCount(); 68 72 void decrementLoadCount(); -
trunk/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
r76916 r80007 30 30 #include "PluginPackage.h" 31 31 32 #if PLATFORM(QT) 33 #include <QLibrary> 34 #endif 35 32 36 using namespace WebCore; 33 37 34 38 namespace WebKit { 39 40 #if PLATFORM(QT) 41 static void initializeGTK() 42 { 43 QLibrary library("libgtk-x11-2.0.so.0"); 44 if (library.load()) { 45 typedef void *(*gtk_init_check_ptr)(int*, char***); 46 gtk_init_check_ptr gtkInitCheck = reinterpret_cast<gtk_init_check_ptr>(library.resolve("gtk_init_check")); 47 // NOTE: We're using gtk_init_check() since gtk_init() calls exit() on failure. 48 if (gtkInitCheck) 49 (void) gtkInitCheck(0, 0); 50 } 51 } 52 #endif 53 54 void NetscapePluginModule::applyX11QuirksBeforeLoad() 55 { 56 #if PLATFORM(QT) 57 if (m_pluginPath.contains("npwrapper") || m_pluginPath.contains("flashplayer")) { 58 initializeGTK(); 59 m_pluginQuirks.add(PluginQuirks::RequiresGTKToolKit); 60 } 61 #endif 62 } 35 63 36 64 bool NetscapePluginModule::getPluginInfo(const String& pluginPath, PluginInfoStore::Plugin& plugin) -
trunk/Source/WebKit2/Shared/Plugins/PluginQuirks.h
r78956 r80007 33 33 enum PluginQuirk { 34 34 // Mac specific quirks: 35 #if PL ATFORM(MAC)35 #if PLUGIN_ARCHITECTURE(MAC) 36 36 // The plug-in wants the call to getprogame() to return "WebKitPluginHost". 37 37 // Adobe Flash Will not handle key down events otherwise. … … 39 39 // Supports receiving a paint event, even when using CoreAnimation rendering. 40 40 SupportsSnapshotting, 41 #elif PLUGIN_ARCHITECTURE(X11) 42 // Flash and npwrapper ask the browser about which GTK version does it use 43 // and refuse to load and work if it is not GTK 2 so we need to fake it in 44 // NPN_GetValue even when it is a lie. 45 RequiresGTKToolKit, 41 46 #endif 42 47 NumPluginQuirks -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
r79335 r80007 484 484 *(NPBool*)value = true; 485 485 break; 486 #elif PLUGIN_ARCHITECTURE(X11) 487 case NPNVToolkit: { 488 const uint32_t expectedGTKToolKitVersion = 2; 489 490 RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp); 491 if (plugin->quirks().contains(PluginQuirks::RequiresGTKToolKit)) { 492 *reinterpret_cast<uint32_t*>(value) = expectedGTKToolKitVersion; 493 break; 494 } 495 496 return NPERR_GENERIC_ERROR; 497 } 486 498 #endif 487 499 default: -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
r78956 r80007 71 71 #endif 72 72 73 PluginQuirks quirks() const { return m_pluginModule->pluginQuirks(); } 74 73 75 void invalidate(const NPRect*); 74 76 static const char* userAgent(NPP);
Note: See TracChangeset
for help on using the changeset viewer.