Changeset 141240 in webkit


Ignore:
Timestamp:
Jan 30, 2013 2:34:24 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by David Faure <faure@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.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r141238 r141240  
     12013-01-30  David Faure  <faure@kde.org>
     2
     3        [Qt] Major performance improvement in Qt's PluginDatabase implementation
     4        https://bugs.webkit.org/show_bug.cgi?id=106140
     5
     6        Reviewed by Simon Hausmann.
     7
     8        No new tests, only a performance improvement.
     9
     10        * plugins/qt/PluginPackageQt.cpp:
     11        (WebCore::PluginPackage::fetchInfo): Don't do a full-fledged load(), load the module directly.
     12        Keep the refcounting as it was before (broken, but otherwise flash crashes).
     13        (WebCore::PluginPackage::load): Use existing module if fetchInfo created it.
     14
    1152013-01-30  Huang Dongsung  <luxtella@company100.net>
    216
  • trunk/Source/WebCore/plugins/qt/PluginPackageQt.cpp

    r138948 r141240  
    3939bool PluginPackage::fetchInfo()
    4040{
    41     if (!load())
    42         return false;
     41    if (!m_module) {
     42        m_module = new QLibrary((QString)m_path);
     43        m_module->setLoadHints(QLibrary::ResolveAllSymbolsHint);
     44        if (!m_module->load()) {
     45            LOG(Plugins, "%s not loaded (%s)", m_path.utf8().data(),
     46                m_module->errorString().toLatin1().constData());
     47            return false;
     48        }
     49        // This is technically wrong (not matched by a decrement), but
     50        // it matches the previous behavior (fetchInfo calling load) and
     51        // prevents crashes in flash due to unload+load.
     52        m_loadCount++;
     53    }
    4354
    4455    NPP_GetValueProcPtr gv = (NPP_GetValueProcPtr)m_module->resolve("NP_GetValue");
     
    6273
    6374    setMIMEDescription(String::fromUTF8(gm()));
    64     m_infoIsFromCache = false;
    6575
    6676    return true;
     
    156166        return false;
    157167
    158     m_module = new QLibrary((QString)m_path);
    159     m_module->setLoadHints(QLibrary::ResolveAllSymbolsHint);
    160     if (!m_module->load()) {
    161         LOG(Plugins, "%s not loaded (%s)", m_path.utf8().data(),
     168    if (!m_module) {
     169        m_module = new QLibrary((QString)m_path);
     170        m_module->setLoadHints(QLibrary::ResolveAllSymbolsHint);
     171        if (!m_module->load()) {
     172            LOG(Plugins, "%s not loaded (%s)", m_path.utf8().data(),
    162173                m_module->errorString().toLatin1().constData());
    163         return false;
     174            return false;
     175        }
    164176    }
    165177
Note: See TracChangeset for help on using the changeset viewer.