diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-16 11:35:44 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-16 11:35:44 +0000 |
commit | df51faef2439747f2d7616ca73eff8db5ae20c11 (patch) | |
tree | 4241c135616b00d803ac28ec9c08e2586719dbc9 /webkit/plugins/npapi/plugin_list.h | |
parent | e9c5d5d43ceb19a46f8a76d1bd7ae5aaa669c1c5 (diff) | |
download | chromium_src-df51faef2439747f2d7616ca73eff8db5ae20c11.zip chromium_src-df51faef2439747f2d7616ca73eff8db5ae20c11.tar.gz chromium_src-df51faef2439747f2d7616ca73eff8db5ae20c11.tar.bz2 |
Sequentialize calls to PluginList::GetPlugins from PluginService.
BUG=105987
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10381087
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137396 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/npapi/plugin_list.h')
-rw-r--r-- | webkit/plugins/npapi/plugin_list.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/webkit/plugins/npapi/plugin_list.h b/webkit/plugins/npapi/plugin_list.h index d01b38f..a948782 100644 --- a/webkit/plugins/npapi/plugin_list.h +++ b/webkit/plugins/npapi/plugin_list.h @@ -121,7 +121,7 @@ class WEBKIT_PLUGINS_EXPORT PluginList { const string16& mime_type_descriptions, std::vector<webkit::WebPluginMimeType>* parsed_mime_types); - // Get all the plugins synchronously. + // Get all the plugins synchronously, loading them if necessary. void GetPlugins(std::vector<webkit::WebPluginInfo>* plugins); // Returns true if the list of plugins is cached and is copied into the out @@ -195,6 +195,17 @@ class WEBKIT_PLUGINS_EXPORT PluginList { ScopedVector<PluginGroup>* plugin_groups); private: + enum LoadingState { + LOADING_STATE_NEEDS_REFRESH, + LOADING_STATE_REFRESHING, + LOADING_STATE_UP_TO_DATE, + }; + + struct InternalPlugin { + webkit::WebPluginInfo info; + PluginEntryPoints entry_points; + }; + friend class PluginListTest; friend struct base::DefaultLazyInstanceTraits<PluginList>; FRIEND_TEST_ALL_PREFIXES(PluginGroupTest, PluginGroupDefinition); @@ -268,8 +279,10 @@ class WEBKIT_PLUGINS_EXPORT PluginList { // Internals // - // If true, we reload plugins even if they've been loaded already. - bool plugins_need_refresh_; + // States whether we will load the plug-in list the next time we try to access + // it, whether we are currently in the process of loading it, or whether we + // consider it up-to-date. + LoadingState loading_state_; // Extra plugin paths that we want to search when loading. std::vector<FilePath> extra_plugin_paths_; @@ -277,10 +290,6 @@ class WEBKIT_PLUGINS_EXPORT PluginList { // Extra plugin directories that we want to search when loading. std::vector<FilePath> extra_plugin_dirs_; - struct InternalPlugin { - webkit::WebPluginInfo info; - PluginEntryPoints entry_points; - }; // Holds information about internal plugins. std::vector<InternalPlugin> internal_plugins_; |