Ejemplo n.º 1
0
void PluginInfoStore::loadPluginsIfNecessary()
{
    if (m_pluginListIsUpToDate)
        return;

    PathHashSet uniquePluginPaths;

    // First, load plug-ins from the additional plug-ins directories specified.
    for (size_t i = 0; i < m_additionalPluginsDirectories.size(); ++i)
        addFromVector(uniquePluginPaths, pluginPathsInDirectory(m_additionalPluginsDirectories[i]));

    // Then load plug-ins from the standard plug-ins directories.
    Vector<String> directories = pluginsDirectories();
    for (size_t i = 0; i < directories.size(); ++i)
        addFromVector(uniquePluginPaths, pluginPathsInDirectory(directories[i]));

    // Then load plug-ins that are not in the standard plug-ins directories.
    addFromVector(uniquePluginPaths, individualPluginPaths());

    m_plugins.clear();

    PathHashSet::const_iterator end = uniquePluginPaths.end();
    for (PathHashSet::const_iterator it = uniquePluginPaths.begin(); it != end; ++it)
        loadPlugin(m_plugins, *it);

    m_pluginListIsUpToDate = true;

    if (m_client)
        m_client->pluginInfoStoreDidLoadPlugins(this);
}
Ejemplo n.º 2
0
void PluginInfoStore::loadPluginsIfNecessary()
{
    if (m_pluginListIsUpToDate)
        return;

    PathHashSet uniquePluginPaths;

    // First, load plug-ins from the additional plug-ins directories specified.
    for (size_t i = 0; i < m_additionalPluginsDirectories.size(); ++i)
        addFromVector(uniquePluginPaths, pluginPathsInDirectory(m_additionalPluginsDirectories[i]));

    // Then load plug-ins from the standard plug-ins directories.
    Vector<String> directories = pluginsDirectories();
    for (size_t i = 0; i < directories.size(); ++i)
        addFromVector(uniquePluginPaths, pluginPathsInDirectory(directories[i]));

    // Then load plug-ins that are not in the standard plug-ins directories.
    addFromVector(uniquePluginPaths, individualPluginPaths());

    Vector<PluginModuleInfo> plugins;

    PathHashSet::const_iterator end = uniquePluginPaths.end();
    for (PathHashSet::const_iterator it = uniquePluginPaths.begin(); it != end; ++it)
        loadPlugin(plugins, *it);

#if ENABLE(PEPPER_PLUGIN_API)
    std::vector<PluginModuleInfo> pepperPlugins;
    content::PepperPluginRegistry::GetInstance()->ComputeList(pepperPlugins);
    std::vector<PluginModuleInfo>::iterator endPlugins = pepperPlugins.end();
    for (std::vector<PluginModuleInfo>::iterator it = pepperPlugins.begin(); it != endPlugins; ++it)
        plugins.append(*it);
#endif

    m_plugins = deepIsolatedCopyPluginInfoVector(plugins);

    m_pluginListIsUpToDate = true;
}