diff options
author | Ben Murdoch <benm@google.com> | 2009-08-11 17:01:47 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2009-08-11 18:21:02 +0100 |
commit | 0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5 (patch) | |
tree | 2943df35f62d885c89d01063cc528dd73b480fea /WebCore/plugins/PluginDatabase.h | |
parent | 7e7a70bfa49a1122b2597a1e6367d89eb4035eca (diff) | |
download | external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.zip external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.gz external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.bz2 |
Merge in WebKit r47029.
Diffstat (limited to 'WebCore/plugins/PluginDatabase.h')
-rw-r--r-- | WebCore/plugins/PluginDatabase.h | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/WebCore/plugins/PluginDatabase.h b/WebCore/plugins/PluginDatabase.h index b05d334..55aaec8 100644 --- a/WebCore/plugins/PluginDatabase.h +++ b/WebCore/plugins/PluginDatabase.h @@ -1,6 +1,7 @@ /* * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. * Copyright (C) 2008 Collabora, Ltd. All rights reserved. + * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -21,7 +22,7 @@ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef PluginDatabase_H @@ -31,8 +32,8 @@ #include "PluginPackage.h" #include "StringHash.h" -#include <wtf/Vector.h> #include <wtf/HashSet.h> +#include <wtf/Vector.h> #if defined(ANDROID_PLUGINS) namespace android { @@ -48,12 +49,18 @@ namespace WebCore { class PluginPackage; typedef HashSet<RefPtr<PluginPackage>, PluginPackageHash> PluginSet; - + class PluginDatabase { public: - static PluginDatabase* installedPlugins(); + // The first call to installedPlugins creates the plugin database + // and by default populates it with the plugins installed on the system. + // For testing purposes, it is possible to not populate the database + // automatically, as the plugins might affect the DRT results by + // writing to a.o. stderr. + static PluginDatabase* installedPlugins(bool populate = true); bool refresh(); + void clear(); Vector<PluginPackage*> plugins() const; bool isMIMETypeRegistered(const String& mimeType); void addExtraPluginDirectory(const String&); @@ -62,15 +69,29 @@ namespace WebCore { static int preferredPluginCompare(const void*, const void*); PluginPackage* findPlugin(const KURL&, String& mimeType); + PluginPackage* pluginForMIMEType(const String& mimeType); + void setPreferredPluginForMIMEType(const String& mimeType, PluginPackage* plugin); + + void setPluginDirectories(const Vector<String>& directories) + { + clear(); + m_pluginDirectories = directories; + } + + static Vector<String> defaultPluginDirectories(); + Vector<String> pluginDirectories() const { return m_pluginDirectories; } #ifdef ANDROID_PLUGINS void setPluginDirectories(const Vector<String>& directories) { m_pluginDirectories = directories; } #endif private: +#ifdef MANUAL_MERGE_REQUIRED #ifndef ANDROID_PLUGINS void setPluginDirectories(const Vector<String>& directories) { m_pluginDirectories = directories; } #endif +#else // MANUAL_MERGE_REQUIRED +#endif // MANUAL_MERGE_REQUIRED void getPluginPathsInDirectories(HashSet<String>&) const; void getDeletedPlugins(PluginSet&) const; @@ -78,22 +99,23 @@ namespace WebCore { bool add(PassRefPtr<PluginPackage>); void remove(PluginPackage*); - PluginPackage* pluginForMIMEType(const String& mimeType); String MIMETypeForExtension(const String& extension) const; - static Vector<String> defaultPluginDirectories(); - Vector<String> m_pluginDirectories; HashSet<String> m_registeredMIMETypes; PluginSet m_plugins; HashMap<String, RefPtr<PluginPackage> > m_pluginsByPath; HashMap<String, time_t> m_pluginPathsWithTimes; +#ifdef MANUAL_MERGE_REQUIRED #if defined(ANDROID_PLUGINS) // Need access to setPluginDirectories() to change the default // path after startup. friend class ::android::WebSettings; #endif +#else // MANUAL_MERGE_REQUIRED + HashMap<String, RefPtr<PluginPackage> > m_preferredPlugins; +#endif // MANUAL_MERGE_REQUIRED }; } // namespace WebCore |