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

Unified Diff: content/browser/renderer_host/buffered_resource_handler.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 | « content/browser/plugin_service.cc ('k') | content/browser/renderer_host/render_message_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/buffered_resource_handler.cc
diff --git a/content/browser/renderer_host/buffered_resource_handler.cc b/content/browser/renderer_host/buffered_resource_handler.cc
index 5c79d7be25aeac98f58641541de86a09c31e4235..8626682130365910e95ff966f7a87c74ac9f180c 100644
--- a/content/browser/renderer_host/buffered_resource_handler.cc
+++ b/content/browser/renderer_host/buffered_resource_handler.cc
@@ -386,21 +386,26 @@ bool BufferedResourceHandler::ShouldDownload(bool* need_plugin_list) {
if (net::IsSupportedMimeType(type))
return false;
+ // Finally, check the plugin list.
+ bool allow_wildcard = false;
+ bool stale = false;
+ std::vector<webkit::npapi::WebPluginInfo> plugins;
+ webkit::npapi::PluginList::Singleton()->GetPluginInfoArray(
+ request_->url(), type, allow_wildcard, &stale, &plugins, NULL);
if (need_plugin_list) {
- if (webkit::npapi::PluginList::Singleton()->stale()) {
+ if (stale) {
*need_plugin_list = true;
return true;
}
} else {
- DCHECK(!webkit::npapi::PluginList::Singleton()->stale());
+ DCHECK(!stale);
}
- // Finally, check the plugin list.
- webkit::npapi::WebPluginInfo info;
- bool allow_wildcard = false;
- return !webkit::npapi::PluginList::Singleton()->GetPluginInfo(
- GURL(), type, allow_wildcard, &info, NULL) ||
- !webkit::npapi::IsPluginEnabled(info);
+ for (size_t i = 0; i < plugins.size(); ++i) {
+ if (webkit::npapi::IsPluginEnabled(plugins[i]))
+ return false;
+ }
+ return true;
}
void BufferedResourceHandler::UseAlternateResourceHandler(
@@ -436,7 +441,7 @@ void BufferedResourceHandler::UseAlternateResourceHandler(
void BufferedResourceHandler::LoadPlugins() {
std::vector<webkit::npapi::WebPluginInfo> plugins;
- webkit::npapi::PluginList::Singleton()->GetPlugins(false, &plugins);
+ webkit::npapi::PluginList::Singleton()->GetPlugins(&plugins);
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
« no previous file with comments | « content/browser/plugin_service.cc ('k') | content/browser/renderer_host/render_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698