diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-18 18:26:07 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-18 18:26:07 +0000 |
commit | 0d683c611a18dc6ea0e99f38c73b4fb96611041f (patch) | |
tree | e4860fb70bb75139dab8d7a20cac05a0ed7d195a /webkit | |
parent | bf5b205429537f0a2e70ca1f83929b52e263018b (diff) | |
download | chromium_src-0d683c611a18dc6ea0e99f38c73b4fb96611041f.zip chromium_src-0d683c611a18dc6ea0e99f38c73b4fb96611041f.tar.gz chromium_src-0d683c611a18dc6ea0e99f38c73b4fb96611041f.tar.bz2 |
Fix registration of internal plugins broken by rev 23501
Due to the plugin_list changes in rev 23501 internal plugins registered via a call to PluginList::RegisterInternalPlugin() are no longer being added to the plugin list when LoadPlugins() is called. Fix the problem by adding the internal plugins in LoadPlugins().
Original change by Marshall Greenblatt <magreenblatt@gmail.com> at http://codereview.chromium.org/173107.
Review URL: http://codereview.chromium.org/208026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26595 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/plugins/plugin_list.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/webkit/glue/plugins/plugin_list.cc b/webkit/glue/plugins/plugin_list.cc index 69315b2..467f68e 100644 --- a/webkit/glue/plugins/plugin_list.cc +++ b/webkit/glue/plugins/plugin_list.cc @@ -141,6 +141,7 @@ void PluginList::LoadPlugins(bool refresh) { // other methods if they're called on other threads. std::vector<FilePath> extra_plugin_paths; std::vector<FilePath> extra_plugin_dirs; + std::vector<PluginVersionInfo> internal_plugins; { AutoLock lock(lock_); if (plugins_loaded_ && !refresh) @@ -148,6 +149,7 @@ void PluginList::LoadPlugins(bool refresh) { extra_plugin_paths = extra_plugin_paths_; extra_plugin_dirs = extra_plugin_dirs_; + internal_plugins = internal_plugins_; } base::TimeTicks start_time = base::TimeTicks::Now(); @@ -157,6 +159,15 @@ void PluginList::LoadPlugins(bool refresh) { std::vector<FilePath> directories_to_scan; GetPluginDirectories(&directories_to_scan); + // Load internal plugins first so that, if both an internal plugin and a + // "discovered" plugin want to handle the same type, the internal plugin + // will have precedence. + for (size_t i = 0; i < internal_plugins.size(); ++i) { + if (internal_plugins[i].path.value() == kDefaultPluginLibraryName) + continue; + LoadPlugin(internal_plugins[i].path, &new_plugins); + } + for (size_t i = 0; i < extra_plugin_paths.size(); ++i) LoadPlugin(extra_plugin_paths[i], &new_plugins); @@ -168,6 +179,7 @@ void PluginList::LoadPlugins(bool refresh) { LoadPluginsFromDir(directories_to_scan[i], &new_plugins); } + // Load the default plugin last. if (webkit_glue::IsDefaultPluginEnabled()) LoadPlugin(FilePath(kDefaultPluginLibraryName), &new_plugins); |