+2012-06-28 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL] Use Eina_Module API instead of dlopen in PluginPackageEfl
+ https://bugs.webkit.org/show_bug.cgi?id=89972
+
+ Reviewed by Antonio Gomes.
+
+ Use convenience helpers in Eina_Module to load plugins instead
+ of POSIX dlopen().
+
+ No new tests, behavior has not changed.
+
+ * platform/FileSystem.h:
+ (WebCore):
+ * platform/efl/FileSystemEfl.cpp:
+ (WebCore::unloadModule):
+ * plugins/efl/PluginPackageEfl.cpp:
+ (WebCore::PluginPackage::load):
+
2012-06-28 Jocelyn Turcotte <turcotte.j@gmail.com>
[Qt] Fix TextureMapper rendering of GraphicsSurface on Mac
// caution, closing handle will make memory vanish and any remaining
// timer, idler, threads or any other left-over will crash,
// maybe just ignore this is a safer solution?
- return !dlclose(module);
+ return eina_module_free(module);
}
String homeDirectoryPath()
bool PluginPackage::load()
{
- char* errmsg;
-
if (m_isLoaded) {
- m_loadCount++;
+ ++m_loadCount;
return true;
}
- m_module = dlopen(m_path.utf8().data(), RTLD_LAZY | RTLD_LOCAL);
- if ((errmsg = dlerror())) {
- EINA_LOG_WARN("%s not loaded: %s", m_path.utf8().data(), errmsg);
+ m_module = eina_module_new(m_path.utf8().data());
+ if (!m_module) {
+ EINA_LOG_WARN("%s not loaded: eina_module_new() failed", m_path.utf8().data());
+ return false;
+ }
+ if (!eina_module_load(m_module)) {
+ const char* errorMessage = eina_error_msg_get(eina_error_get());
+ EINA_LOG_WARN("%s not loaded: %s", m_path.utf8().data(), errorMessage ? errorMessage : "None");
return false;
}
m_isLoaded = true;
- NP_InitializeFuncPtr initialize;
- NPError err;
-
- initialize = reinterpret_cast<NP_InitializeFuncPtr>(dlsym(m_module, "NP_Initialize"));
- if ((errmsg = dlerror())) {
- EINA_LOG_ERR("Could not get symbol NP_Initialize: %s", errmsg);
+ NP_InitializeFuncPtr initialize = reinterpret_cast<NP_InitializeFuncPtr>(eina_module_symbol_get(m_module, "NP_Initialize"));
+ if (!initialize) {
+ EINA_LOG_ERR("Could not get symbol NP_Initialize");
goto abort;
}
- m_NPP_Shutdown = reinterpret_cast<NPP_ShutdownProcPtr>(dlsym(m_module, "NP_Shutdown"));
- if ((errmsg = dlerror())) {
- EINA_LOG_ERR("Could not get symbol NP_Shutdown: %s", errmsg);
+ m_NPP_Shutdown = reinterpret_cast<NPP_ShutdownProcPtr>(eina_module_symbol_get(m_module, "NP_Shutdown"));
+ if (!m_NPP_Shutdown) {
+ EINA_LOG_ERR("Could not get symbol NP_Shutdown");
goto abort;
}
initializeBrowserFuncs();
#if defined(XP_UNIX)
- err = initialize(&m_browserFuncs, &m_pluginFuncs);
+ NPError err = initialize(&m_browserFuncs, &m_pluginFuncs);
#else
- err = initialize(&m_browserFuncs);
+ NPError err = initialize(&m_browserFuncs);
#endif
if (err != NPERR_NO_ERROR)
goto abort;
- m_loadCount++;
+ ++m_loadCount;
return true;
abort: