Title: [141240] trunk/Source/WebCore
Revision
141240
Author
commit-qu...@webkit.org
Date
2013-01-30 02:34:24 -0800 (Wed, 30 Jan 2013)

Log Message

[Qt] Major performance improvement in Qt's PluginDatabase implementation
https://bugs.webkit.org/show_bug.cgi?id=106140

Patch by David Faure <fa...@kde.org> on 2013-01-30
Reviewed by Simon Hausmann.

No new tests, only a performance improvement.

* plugins/qt/PluginPackageQt.cpp:
(WebCore::PluginPackage::fetchInfo): Don't do a full-fledged load(), load the module directly.
Keep the refcounting as it was before (broken, but otherwise flash crashes).
(WebCore::PluginPackage::load): Use existing module if fetchInfo created it.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (141239 => 141240)


--- trunk/Source/WebCore/ChangeLog	2013-01-30 10:31:14 UTC (rev 141239)
+++ trunk/Source/WebCore/ChangeLog	2013-01-30 10:34:24 UTC (rev 141240)
@@ -1,3 +1,17 @@
+2013-01-30  David Faure  <fa...@kde.org>
+
+        [Qt] Major performance improvement in Qt's PluginDatabase implementation
+        https://bugs.webkit.org/show_bug.cgi?id=106140
+
+        Reviewed by Simon Hausmann.
+
+        No new tests, only a performance improvement.
+
+        * plugins/qt/PluginPackageQt.cpp:
+        (WebCore::PluginPackage::fetchInfo): Don't do a full-fledged load(), load the module directly.
+        Keep the refcounting as it was before (broken, but otherwise flash crashes).
+        (WebCore::PluginPackage::load): Use existing module if fetchInfo created it.
+
 2013-01-30  Huang Dongsung  <luxte...@company100.net>
 
         [TexMap] Remove GraphicsLayer in TextureMapperLayer.

Modified: trunk/Source/WebCore/plugins/qt/PluginPackageQt.cpp (141239 => 141240)


--- trunk/Source/WebCore/plugins/qt/PluginPackageQt.cpp	2013-01-30 10:31:14 UTC (rev 141239)
+++ trunk/Source/WebCore/plugins/qt/PluginPackageQt.cpp	2013-01-30 10:34:24 UTC (rev 141240)
@@ -38,8 +38,19 @@
 
 bool PluginPackage::fetchInfo()
 {
-    if (!load())
-        return false;
+    if (!m_module) {
+        m_module = new QLibrary((QString)m_path);
+        m_module->setLoadHints(QLibrary::ResolveAllSymbolsHint);
+        if (!m_module->load()) {
+            LOG(Plugins, "%s not loaded (%s)", m_path.utf8().data(),
+                m_module->errorString().toLatin1().constData());
+            return false;
+        }
+        // This is technically wrong (not matched by a decrement), but
+        // it matches the previous behavior (fetchInfo calling load) and
+        // prevents crashes in flash due to unload+load.
+        m_loadCount++;
+    }
 
     NPP_GetValueProcPtr gv = (NPP_GetValueProcPtr)m_module->resolve("NP_GetValue");
     NP_GetMIMEDescriptionFuncPtr gm =
@@ -61,7 +72,6 @@
     determineModuleVersionFromDescription();
 
     setMIMEDescription(String::fromUTF8(gm()));
-    m_infoIsFromCache = false;
 
     return true;
 }
@@ -155,12 +165,14 @@
     if (isPluginBlacklisted())
         return false;
 
-    m_module = new QLibrary((QString)m_path);
-    m_module->setLoadHints(QLibrary::ResolveAllSymbolsHint);
-    if (!m_module->load()) {
-        LOG(Plugins, "%s not loaded (%s)", m_path.utf8().data(),
+    if (!m_module) {
+        m_module = new QLibrary((QString)m_path);
+        m_module->setLoadHints(QLibrary::ResolveAllSymbolsHint);
+        if (!m_module->load()) {
+            LOG(Plugins, "%s not loaded (%s)", m_path.utf8().data(),
                 m_module->errorString().toLatin1().constData());
-        return false;
+            return false;
+        }
     }
 
     m_isLoaded = true;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to