diff options
Diffstat (limited to 'WebCore/plugins/PluginPackage.cpp')
-rw-r--r-- | WebCore/plugins/PluginPackage.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/WebCore/plugins/PluginPackage.cpp b/WebCore/plugins/PluginPackage.cpp index 48c44f0..168d45a 100644 --- a/WebCore/plugins/PluginPackage.cpp +++ b/WebCore/plugins/PluginPackage.cpp @@ -114,6 +114,9 @@ PluginPackage::PluginPackage(const String& path, const time_t& lastModified) , m_module(0) , m_lastModified(lastModified) , m_freeLibraryTimer(this, &PluginPackage::freeLibraryTimerFired) +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + , m_infoIsFromCache(true) +#endif { m_fileName = pathGetFileName(m_path); m_parentDirectory = m_path.left(m_path.length() - m_fileName.length() - 1); @@ -168,6 +171,19 @@ PassRefPtr<PluginPackage> PluginPackage::createPackage(const String& path, const return package.release(); } +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) +PassRefPtr<PluginPackage> PluginPackage::createPackageFromCache(const String& path, const time_t& lastModified, const String& name, const String& description, const String& mimeDescription) +{ + RefPtr<PluginPackage> package = adoptRef(new PluginPackage(path, lastModified)); + package->m_name = name; + package->m_description = description; + package->determineModuleVersionFromDescription(); + package->setMIMEDescription(mimeDescription); + package->m_infoIsFromCache = true; + return package.release(); +} +#endif + #if defined(XP_UNIX) void PluginPackage::determineQuirks(const String& mimeType) { @@ -349,4 +365,20 @@ int PluginPackage::compareFileVersion(const PlatformModuleVersion& compareVersio return 0; } +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) +bool PluginPackage::ensurePluginLoaded() +{ + if (!m_infoIsFromCache) + return m_isLoaded; + + m_quirks = PluginQuirkSet(); + m_name = String(); + m_description = String(); + m_fullMIMEDescription = String(); + m_moduleVersion = 0; + + return fetchInfo(); +} +#endif + } |