Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(549)

Unified Diff: content/browser/plugin_service.cc

Issue 7497030: PluginList cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix crash Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/flash_ui.cc ('k') | content/browser/renderer_host/buffered_resource_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/plugin_service.cc
diff --git a/content/browser/plugin_service.cc b/content/browser/plugin_service.cc
index d090917f5bfdf218dd8c6f2035859b47fe01632a..154d0629103c353424865c234c686c9d6053cb4a 100644
--- a/content/browser/plugin_service.cc
+++ b/content/browser/plugin_service.cc
@@ -323,7 +323,7 @@ void PluginService::GetAllowedPluginForOpenChannelToPlugin(
bool found = GetPluginInfo(
render_process_id, render_view_id, url, mime_type, &info, NULL);
FilePath plugin_path;
- if (found && webkit::npapi::IsPluginEnabled(info))
+ if (found)
plugin_path = FilePath(info.path);
// Now we jump back to the IO thread to finish opening the channel.
@@ -355,7 +355,6 @@ bool PluginService::GetPluginInfo(int render_process_id,
// GetPluginInfoArray may need to load the plugins, so we need to be
// on the FILE thread.
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
- bool allow_wildcard = true;
{
base::AutoLock auto_lock(overridden_plugins_lock_);
for (size_t i = 0; i < overridden_plugins_.size(); ++i) {
@@ -369,8 +368,20 @@ bool PluginService::GetPluginInfo(int render_process_id,
}
}
}
- return webkit::npapi::PluginList::Singleton()->GetPluginInfo(
- url, mime_type, allow_wildcard, info, actual_mime_type);
+ bool allow_wildcard = true;
+ std::vector<webkit::npapi::WebPluginInfo> plugins;
+ std::vector<std::string> mime_types;
+ webkit::npapi::PluginList::Singleton()->GetPluginInfoArray(
+ url, mime_type, allow_wildcard, NULL, &plugins, &mime_types);
+ for (size_t i = 0; i < plugins.size(); ++i) {
+ if (webkit::npapi::IsPluginEnabled(plugins[i])) {
+ *info = plugins[i];
+ if (actual_mime_type)
+ *actual_mime_type = mime_types[i];
+ return true;
+ }
+ }
+ return false;
}
void PluginService::OnWaitableEventSignaled(
« no previous file with comments | « chrome/browser/ui/webui/flash_ui.cc ('k') | content/browser/renderer_host/buffered_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698