Title: [121467] trunk/Source/WebCore
- Revision
- 121467
- Author
- [email protected]
- Date
- 2012-06-28 13:56:29 -0700 (Thu, 28 Jun 2012)
Log Message
[EFL] Use Eina_Module API instead of dlopen in PluginPackageEfl
https://bugs.webkit.org/show_bug.cgi?id=89972
Patch by Christophe Dumez <[email protected]> on 2012-06-28
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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (121466 => 121467)
--- trunk/Source/WebCore/ChangeLog 2012-06-28 20:54:06 UTC (rev 121466)
+++ trunk/Source/WebCore/ChangeLog 2012-06-28 20:56:29 UTC (rev 121467)
@@ -1,3 +1,22 @@
+2012-06-28 Christophe Dumez <[email protected]>
+
+ [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 <[email protected]>
[Qt] Fix TextureMapper rendering of GraphicsSurface on Mac
Modified: trunk/Source/WebCore/platform/FileSystem.h (121466 => 121467)
--- trunk/Source/WebCore/platform/FileSystem.h 2012-06-28 20:54:06 UTC (rev 121466)
+++ trunk/Source/WebCore/platform/FileSystem.h 2012-06-28 20:56:29 UTC (rev 121467)
@@ -71,6 +71,10 @@
typedef struct _GModule GModule;
#endif
+#if PLATFORM(EFL)
+typedef struct _Eina_Module Eina_Module;
+#endif
+
namespace WebCore {
// PlatformModule
@@ -78,6 +82,8 @@
typedef HMODULE PlatformModule;
#elif PLATFORM(GTK)
typedef GModule* PlatformModule;
+#elif PLATFORM(EFL)
+typedef Eina_Module* PlatformModule;
#elif PLATFORM(QT)
#if defined(Q_WS_MAC)
typedef CFBundleRef PlatformModule;
Modified: trunk/Source/WebCore/platform/efl/FileSystemEfl.cpp (121466 => 121467)
--- trunk/Source/WebCore/platform/efl/FileSystemEfl.cpp 2012-06-28 20:54:06 UTC (rev 121466)
+++ trunk/Source/WebCore/platform/efl/FileSystemEfl.cpp 2012-06-28 20:56:29 UTC (rev 121467)
@@ -70,7 +70,7 @@
// 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()
Modified: trunk/Source/WebCore/plugins/efl/PluginPackageEfl.cpp (121466 => 121467)
--- trunk/Source/WebCore/plugins/efl/PluginPackageEfl.cpp 2012-06-28 20:54:06 UTC (rev 121466)
+++ trunk/Source/WebCore/plugins/efl/PluginPackageEfl.cpp 2012-06-28 20:56:29 UTC (rev 121467)
@@ -111,33 +111,33 @@
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;
}
@@ -147,14 +147,14 @@
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:
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes