|
Lines 118-152
void NetscapePluginModule::setMIMEDescription(const String& mimeDescription, Plu
a/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp_sec1
|
| 118 |
} |
118 |
} |
| 119 |
} |
119 |
} |
| 120 |
|
120 |
|
| 121 |
bool NetscapePluginModule::getPluginInfo(const String& pluginPath, PluginModuleInfo& plugin) |
121 |
bool NetscapePluginModule::pluginInfo(PluginModuleInfo& plugin) |
| 122 |
{ |
122 |
{ |
| 123 |
// Tempararily suppress stdout in this function as plugins will be loaded and shutdown and debug info |
123 |
ASSERT(m_isInitialized); |
| 124 |
// is leaked to layout test output. |
|
|
| 125 |
StdoutDevNullRedirector stdoutDevNullRedirector; |
| 126 |
|
| 127 |
// We are loading the plugin here since it does not seem to be a standardized way to |
| 128 |
// get the needed informations from a UNIX plugin without loading it. |
| 129 |
RefPtr<NetscapePluginModule> pluginModule = NetscapePluginModule::getOrCreate(pluginPath); |
| 130 |
if (!pluginModule) |
| 131 |
return false; |
| 132 |
|
| 133 |
pluginModule->incrementLoadCount(); |
| 134 |
|
124 |
|
| 135 |
plugin.path = pluginPath; |
125 |
plugin.path = m_pluginPath; |
| 136 |
plugin.info.file = pathGetFileName(pluginPath); |
126 |
plugin.info.file = pathGetFileName(m_pluginPath); |
| 137 |
|
127 |
|
| 138 |
Module* module = pluginModule->module(); |
128 |
Module* module = m_module.get(); |
| 139 |
NPP_GetValueProcPtr NPP_GetValue = module->functionPointer<NPP_GetValueProcPtr>("NP_GetValue"); |
129 |
NPP_GetValueProcPtr NPP_GetValue = module->functionPointer<NPP_GetValueProcPtr>("NP_GetValue"); |
| 140 |
if (!NPP_GetValue) { |
130 |
if (!NPP_GetValue) |
| 141 |
pluginModule->decrementLoadCount(); |
|
|
| 142 |
return false; |
131 |
return false; |
| 143 |
} |
|
|
| 144 |
|
132 |
|
| 145 |
NP_GetMIMEDescriptionFuncPtr NP_GetMIMEDescription = module->functionPointer<NP_GetMIMEDescriptionFuncPtr>("NP_GetMIMEDescription"); |
133 |
NP_GetMIMEDescriptionFuncPtr NP_GetMIMEDescription = module->functionPointer<NP_GetMIMEDescriptionFuncPtr>("NP_GetMIMEDescription"); |
| 146 |
if (!NP_GetMIMEDescription) { |
134 |
if (!NP_GetMIMEDescription) |
| 147 |
pluginModule->decrementLoadCount(); |
|
|
| 148 |
return false; |
135 |
return false; |
| 149 |
} |
|
|
| 150 |
|
136 |
|
| 151 |
char* buffer; |
137 |
char* buffer; |
| 152 |
NPError error = NPP_GetValue(0, NPPVpluginNameString, &buffer); |
138 |
NPError error = NPP_GetValue(0, NPPVpluginNameString, &buffer); |
|
Lines 158-173
bool NetscapePluginModule::getPluginInfo(const String& pluginPath, PluginModuleI
a/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp_sec2
|
| 158 |
plugin.info.desc = buffer; |
144 |
plugin.info.desc = buffer; |
| 159 |
|
145 |
|
| 160 |
const char* mimeDescription = NP_GetMIMEDescription(); |
146 |
const char* mimeDescription = NP_GetMIMEDescription(); |
| 161 |
if (!mimeDescription) { |
147 |
if (!mimeDescription) |
| 162 |
pluginModule->decrementLoadCount(); |
|
|
| 163 |
return false; |
148 |
return false; |
| 164 |
} |
|
|
| 165 |
|
149 |
|
| 166 |
setMIMEDescription(mimeDescription, plugin); |
150 |
setMIMEDescription(mimeDescription, plugin); |
| 167 |
|
151 |
|
|
|
152 |
return true; |
| 153 |
} |
| 154 |
bool NetscapePluginModule::getPluginInfo(const String& pluginPath, PluginModuleInfo& plugin) |
| 155 |
{ |
| 156 |
// Tempararily suppress stdout in this function as plugins will be loaded and shutdown and debug info |
| 157 |
// is leaked to layout test output. |
| 158 |
StdoutDevNullRedirector stdoutDevNullRedirector; |
| 159 |
|
| 160 |
// We are loading the plugin here since it does not seem to be a standardized way to |
| 161 |
// get the needed informations from a UNIX plugin without loading it. |
| 162 |
RefPtr<NetscapePluginModule> pluginModule = NetscapePluginModule::getOrCreate(pluginPath); |
| 163 |
if (!pluginModule) |
| 164 |
return false; |
| 165 |
|
| 166 |
pluginModule->incrementLoadCount(); |
| 167 |
bool returnValue = pluginModule->pluginInfo(plugin); |
| 168 |
pluginModule->decrementLoadCount(); |
168 |
pluginModule->decrementLoadCount(); |
| 169 |
|
169 |
|
| 170 |
return true; |
170 |
return returnValue; |
| 171 |
} |
171 |
} |
| 172 |
|
172 |
|
| 173 |
void NetscapePluginModule::determineQuirks() |
173 |
void NetscapePluginModule::determineQuirks() |