Skip to content

Commit

Permalink
Allow plugins from extra plugin locations to be loaded multiple times.
Browse files Browse the repository at this point in the history
This solves the issue where plugins are bundled with extensions and
might need to be loaded from more than one profile at the same time

BUG=289725
TEST=As described on the bug.

Review URL: https://codereview.chromium.org/40363002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231049 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
pastarmovj@chromium.org committed Oct 25, 2013
1 parent 012c287 commit 342cb9c
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions content/common/plugin_list_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -372,19 +372,28 @@ void PluginList::GetPluginPathsFromRegistry(
bool PluginList::ShouldLoadPluginUsingPluginList(
const WebPluginInfo& info,
std::vector<WebPluginInfo>* plugins) {
// Version check
for (size_t j = 0; j < plugins->size(); ++j) {
base::FilePath::StringType plugin1 =
StringToLowerASCII((*plugins)[j].path.BaseName().value());
base::FilePath::StringType plugin2 =
StringToLowerASCII(info.path.BaseName().value());
if ((plugin1 == plugin2 && HaveSharedMimeType((*plugins)[j], info)) ||
(plugin1 == kJavaDeploy1 && plugin2 == kJavaDeploy2) ||
(plugin1 == kJavaDeploy2 && plugin2 == kJavaDeploy1)) {
if (IsNewerVersion(info.version, (*plugins)[j].version))
return false; // We have loaded a plugin whose version is newer.
plugins->erase(plugins->begin() + j);
break;
bool should_check_version = true;
{
base::AutoLock lock(lock_);
should_check_version =
std::find(extra_plugin_paths_.begin(), extra_plugin_paths_.end(),
info.path) == extra_plugin_paths_.end();
}
// Version check for plugins that are not coming from |extra_plugin_paths_|.
if (should_check_version) {
for (size_t j = 0; j < plugins->size(); ++j) {
base::FilePath::StringType plugin1 =
StringToLowerASCII((*plugins)[j].path.BaseName().value());
base::FilePath::StringType plugin2 =
StringToLowerASCII(info.path.BaseName().value());
if ((plugin1 == plugin2 && HaveSharedMimeType((*plugins)[j], info)) ||
(plugin1 == kJavaDeploy1 && plugin2 == kJavaDeploy2) ||
(plugin1 == kJavaDeploy2 && plugin2 == kJavaDeploy1)) {
if (IsNewerVersion(info.version, (*plugins)[j].version))
return false; // We have loaded a plugin whose version is newer.
plugins->erase(plugins->begin() + j);
break;
}
}
}

Expand Down

0 comments on commit 342cb9c

Please sign in to comment.