Chromium Code Reviews| Index: webkit/glue/plugins/plugin_list.h |
| diff --git a/webkit/glue/plugins/plugin_list.h b/webkit/glue/plugins/plugin_list.h |
| index 101e6b7a4674a1ad235be6a814f23c02c5b2cf3b..5621eeb26820857056b7b60061b98df76006195b 100644 |
| --- a/webkit/glue/plugins/plugin_list.h |
| +++ b/webkit/glue/plugins/plugin_list.h |
| @@ -5,11 +5,9 @@ |
| #ifndef WEBKIT_GLUE_PLUGINS_PLUGIN_LIST_H_ |
| #define WEBKIT_GLUE_PLUGINS_PLUGIN_LIST_H_ |
| -#include <map> |
| #include <set> |
| #include <string> |
| #include <vector> |
| -#include <set> |
| #include "base/basictypes.h" |
| #include "base/file_path.h" |
| @@ -157,13 +155,24 @@ class PluginList { |
| bool GetPluginInfoByPath(const FilePath& plugin_path, |
| WebPluginInfo* info); |
| - typedef std::map<std::string, linked_ptr<PluginGroup> > PluginMap; |
| + // Populates the given vector with all available plugin groups. |
| + void GetPluginGroups(bool load_if_necessary, |
| + std::vector<PluginGroup>* plugin_groups); |
| + |
| + // Returns the PluginGroup corresponding to the given WebPluginInfo. If no |
| + // such group exists, it is created and added to the cache. |
| + // Beware: when calling this from the Browser prrocess, the group that the |
|
Bernhard Bauer
2010/12/07 10:32:05
Nit: process
Jakob Kummerow
2010/12/07 11:43:08
Done.
|
| + // returned pointer points to might disappear suddenly. |
|
Bernhard Bauer
2010/12/07 10:32:05
Also, please elaborate on under what circumstances
Jakob Kummerow
2010/12/07 11:43:08
Done.
|
| + const PluginGroup* GetPluginGroup(const WebPluginInfo& web_plugin_info); |
| - // Fill the map from identifier to plugin group for all plugin groups. If |
| - // |load_if_necessary| is set, the plugins will be loaded if they haven't |
| - // already been loaded, or if Refresh() has been called in the meantime; |
| - // otherwise a possibly empty or stale list may be returned. |
| - void GetPluginGroups(bool load_if_necessary, PluginMap* plugin_groups); |
| + // Returns the name of the PluginGroup with the given identifier. |
| + // If no such group exists, an empty string is returned. |
| + string16 GetPluginGroupName(std::string identifier); |
| + |
| + // Returns the identifier string of the PluginGroup corresponding to the given |
| + // WebPluginInfo. If no such group exists, it is created and added to the |
| + // cache. |
| + std::string GetPluginGroupIdentifier(const WebPluginInfo& web_plugin_info); |
| // Load a specific plugin with full path. |
| void LoadPlugin(const FilePath& filename, |
| @@ -201,6 +210,14 @@ class PluginList { |
| // Constructors are private for singletons |
| PluginList(); |
| + // Creates PluginGroups for the group definitions in PluginGroup.cc, and adds |
|
Bernhard Bauer
2010/12/07 10:32:05
Nit: The file is called plugin_group.cc.
Jakob Kummerow
2010/12/07 11:43:08
Done.
|
| + // them to the PluginGroup cache of this PluginList. |
| + void AddHardcodedPluginGroups(); |
| + |
| + // Adds the given WebPluginInfo to its corresponding group, creating it if |
| + // necessary, and returns the group. |
| + PluginGroup* AddToPluginGroups(const WebPluginInfo& web_plugin_info); |
| + |
| // Load all plugins from the default plugins directory |
| void LoadPlugins(bool refresh); |
| @@ -224,10 +241,6 @@ class PluginList { |
| // list of disabled groups as well. |
| bool ShouldDisableGroup(const string16& group_name); |
| - // Like GetPluginGroups above, but works on a given vector of plugins. |
| - static void GetPluginGroups(const std::vector<WebPluginInfo>* plugins, |
| - PluginMap* plugin_groups); |
| - |
| // Returns true if the given WebPluginInfo supports "mime-type". |
| // mime_type should be all lower case. |
| static bool SupportsType(const WebPluginInfo& info, |
| @@ -291,11 +304,16 @@ class PluginList { |
| // Path names of plugins to disable (the default is to enable them all). |
| std::set<FilePath> disabled_plugins_; |
| - // Group names disable (the default is to enable them all). |
| + // Group names to disable (the default is to enable them all). |
| std::set<string16> disabled_groups_; |
| bool disable_outdated_plugins_; |
| + // Holds the currently available plugin groups. |
| + PluginGroup::PluginMap plugin_groups_; |
| + |
| + int next_priority_; |
| + |
| // Need synchronization for the above members since this object can be |
| // accessed on multiple threads. |
| Lock lock_; |