Changeset 74077 in webkit
- Timestamp:
- Dec 14, 2010 5:06:05 PM (13 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 8 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r74075 r74077 1 2010-12-14 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Cannot type into plugin edit field 6 https://bugs.webkit.org/show_bug.cgi?id=51074 7 <rdar://problem/8483741> 8 9 Add a PrognameShouldBeWebKitPluginHost quirk, since it turns out Flash Player calls getprogname() and checks 10 if the return value is "WebKitPluginHost" in order to determine when to handle NPCocoaEventKeyDown events. 11 12 * PluginProcess/PluginProcess.cpp: 13 (WebKit::PluginProcess::netscapePluginModule): 14 If the plug-in module has the PrognameShouldBeWebKitPluginHost quirk, call setprocname("WebKitPluginHost"). 15 16 * Shared/Plugins/Netscape/NetscapePluginModule.cpp: 17 (WebKit::NetscapePluginModule::load): 18 Call determineQuirks() 19 20 * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: 21 (WebKit::NetscapePluginModule::determineQuirks): 22 Add the PrognameShouldBeWebKitPluginHost quirk for Flash. 23 24 * Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp: 25 (WebKit::NetscapePluginModule::determineQuirks): 26 * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp: 27 (WebKit::NetscapePluginModule::determineQuirks): 28 Add stubs. 29 30 * Shared/Plugins/PluginQuirks.h: 31 Add new PluginQuirks file. 32 33 * WebKit2.xcodeproj/project.pbxproj: 34 Add PluginQuirks.h 35 1 36 2010-12-14 Anders Carlsson <andersca@apple.com> 2 37 -
trunk/WebKit2/PluginProcess/PluginProcess.cpp
r73419 r74077 82 82 ASSERT(!m_pluginPath.isNull()); 83 83 m_pluginModule = NetscapePluginModule::getOrCreate(m_pluginPath); 84 85 #if PLATFORM(MAC) 86 if (m_pluginModule) { 87 if (m_pluginModule->pluginQuirks().contains(PluginQuirks::PrognameShouldBeWebKitPluginHost)) 88 setprogname("WebKitPluginHost"); 89 } 90 #endif 84 91 } 85 92 -
trunk/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.cpp
r74058 r74077 123 123 initializedNetscapePluginModules().append(this); 124 124 125 determineQuirks(); 126 125 127 return true; 126 128 } -
trunk/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.h
r74061 r74077 28 28 29 29 #include "Module.h" 30 #include "PluginQuirks.h" 30 31 #include <WebCore/npfunctions.h> 31 32 #include <wtf/RefCounted.h> … … 51 52 static bool getPluginInfo(const String& pluginPath, PluginInfoStore::Plugin&); 52 53 54 const PluginQuirks& pluginQuirks() const { return m_pluginQuirks; } 55 53 56 private: 54 57 explicit NetscapePluginModule(const String& pluginPath); 58 59 void determineQuirks(); 55 60 56 61 bool tryLoad(); … … 64 69 unsigned m_pluginCount; 65 70 71 PluginQuirks m_pluginQuirks; 72 66 73 NPP_ShutdownProcPtr m_shutdownProcPtr; 67 74 NPPluginFuncs m_pluginFuncs; -
trunk/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm
r74061 r74077 324 324 } 325 325 326 void NetscapePluginModule::determineQuirks() 327 { 328 PluginInfoStore::Plugin plugin; 329 if (!getPluginInfo(m_pluginPath, plugin)) 330 return; 331 332 if (plugin.bundleIdentifier == "com.macromedia.Flash Player.plugin") { 333 // Flash requires that the return value of getprocname() be "WebKitPluginHost". 334 m_pluginQuirks.add(PluginQuirks::PrognameShouldBeWebKitPluginHost); 335 } 336 } 337 326 338 } // namespace WebKit -
trunk/WebKit2/Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp
r74073 r74077 114 114 } 115 115 116 void NetscapePluginModule::determineQuirks() 117 { 118 } 119 116 120 } // namespace WebKit 117 121 -
trunk/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
r74075 r74077 65 65 } 66 66 67 void NetscapePluginModule::determineQuirks() 68 { 69 } 70 67 71 } // namespace WebKit -
trunk/WebKit2/Shared/Plugins/PluginQuirks.h
r74075 r74077 24 24 */ 25 25 26 #ifndef NetscapePluginModule_h 27 #define NetscapePluginModule_h 28 29 #include "Module.h" 30 #include <WebCore/npfunctions.h> 31 #include <wtf/RefCounted.h> 32 #include <wtf/text/WTFString.h> 33 34 // FIXME: We should not include PluginInfoStore.h here. Instead, 35 // PluginInfoStore::Plugin should be moved out into its own header which we can 36 // put in Shared/Plugins. 37 #include "PluginInfoStore.h" 26 #ifndef PluginQuirks_h 27 #define PluginQuirks_h 38 28 39 29 namespace WebKit { 40 30 41 class NetscapePluginModule : public RefCounted<NetscapePluginModule>{31 class PluginQuirks { 42 32 public: 43 static PassRefPtr<NetscapePluginModule> getOrCreate(const String& pluginPath); 44 ~NetscapePluginModule(); 33 enum PluginQuirk { 34 // Mac specific quirks: 35 #if PLATFORM(MAC) 36 // The plug-in wants the call to getprogame() to return "WebKitPluginHost". 37 // Adobe Flash Will not handle key down events otherwise. 38 PrognameShouldBeWebKitPluginHost, 39 #endif 45 40 46 const NPPluginFuncs& pluginFuncs() const { return m_pluginFuncs; } 47 48 void pluginCreated(); 49 void pluginDestroyed(); 50 51 static bool getPluginInfo(const String& pluginPath, PluginInfoStore::Plugin&); 41 NumPluginQuirks 42 }; 43 44 PluginQuirks() 45 : m_quirks(0) 46 { 47 COMPILE_ASSERT(sizeof(m_quirks) * 8 >= NumPluginQuirks, not_enough_room_for_quirks); 48 } 49 50 void add(PluginQuirk quirk) 51 { 52 ASSERT(quirk >= 0); 53 ASSERT(quirk < NumPluginQuirks); 54 55 m_quirks |= (1 << quirk); 56 } 57 58 bool contains(PluginQuirk quirk) const 59 { 60 return m_quirks & (1 << quirk); 61 } 52 62 53 63 private: 54 explicit NetscapePluginModule(const String& pluginPath); 64 uint32_t m_quirks; 65 }; 55 66 56 bool tryLoad();57 bool load();58 void unload();59 60 void shutdown();61 62 String m_pluginPath;63 bool m_isInitialized;64 unsigned m_pluginCount;65 66 NPP_ShutdownProcPtr m_shutdownProcPtr;67 NPPluginFuncs m_pluginFuncs;68 69 OwnPtr<Module> m_module;70 };71 72 67 } // namespace WebKit 73 68 74 #endif // NetscapePluginModule_h69 #endif // PluginQuirkSet_h -
trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj
r74061 r74077 114 114 1A4A9C5612B816CF008FE984 /* NetscapePluginModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4A9C5412B816CF008FE984 /* NetscapePluginModule.h */; }; 115 115 1A4A9C9A12B821CD008FE984 /* NetscapePluginModuleMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A4A9C9912B821CD008FE984 /* NetscapePluginModuleMac.mm */; }; 116 1A4A9F3312B844E2008FE984 /* PluginQuirks.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4A9F3112B844E2008FE984 /* PluginQuirks.h */; }; 116 117 1A50DB66110A3D57000D3FE5 /* WebProcess.app in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1A50DB1E110A3BDC000D3FE5 /* WebProcess.app */; }; 117 118 1A594ABA112A1FB6009DE7C7 /* WebUIClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A594AB8112A1FB6009DE7C7 /* WebUIClient.cpp */; }; … … 747 748 1A4A9C5412B816CF008FE984 /* NetscapePluginModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetscapePluginModule.h; sourceTree = "<group>"; }; 748 749 1A4A9C9912B821CD008FE984 /* NetscapePluginModuleMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetscapePluginModuleMac.mm; sourceTree = "<group>"; }; 750 1A4A9F3112B844E2008FE984 /* PluginQuirks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginQuirks.h; sourceTree = "<group>"; }; 749 751 1A4F976A100E7B6600637A18 /* Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; }; 750 752 1A4F976B100E7B6600637A18 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; }; … … 1630 1632 1A2D90D11281C966001EB962 /* PluginProcessCreationParameters.cpp */, 1631 1633 1A2D90D01281C966001EB962 /* PluginProcessCreationParameters.h */, 1634 1A4A9F3112B844E2008FE984 /* PluginQuirks.h */, 1632 1635 1A2D848A127F6A49001EB962 /* NPIdentifierData.cpp */, 1633 1636 1A2D8489127F6A49001EB962 /* NPIdentifierData.h */, … … 2718 2721 1A4A9AA812B7E796008FE984 /* WKTextInputWindowController.h in Headers */, 2719 2722 1A4A9C5612B816CF008FE984 /* NetscapePluginModule.h in Headers */, 2723 1A4A9F3312B844E2008FE984 /* PluginQuirks.h in Headers */, 2720 2724 ); 2721 2725 runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset
for help on using the changeset viewer.