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

Unified Diff: chrome/browser/ui/cocoa/drag_util.mm

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
Index: chrome/browser/ui/cocoa/drag_util.mm
diff --git a/chrome/browser/ui/cocoa/drag_util.mm b/chrome/browser/ui/cocoa/drag_util.mm
index 3a0d580fdbfa1138d4c3c2cd3e22bd2744c6bc9d..88c746be11ed94eba437c5d91ec0579bcd4b0f82 100644
--- a/chrome/browser/ui/cocoa/drag_util.mm
+++ b/chrome/browser/ui/cocoa/drag_util.mm
@@ -79,11 +79,15 @@ static BOOL IsSupportedFileURL(const GURL& url) {
return YES;
// Check whether there is a plugin that supports the mime type. (e.g. PDF)
- webkit::npapi::PluginList* list = webkit::npapi::PluginList::Singleton();
- webkit::npapi::WebPluginInfo info;
- if (!list->stale() &&
- list->GetPluginInfo(GURL(), mime_type, false, &info, NULL)) {
- return webkit::npapi::IsPluginEnabled(info);
+ // TODO(bauerb): This possibly uses stale information, but it's guaranteed not
+ // to do disk access.
+ bool stale = false;
+ std::vector<webkit::npapi::WebPluginInfo> info_array;
+ webkit::npapi::PluginList::Singleton()->GetPluginInfoArray(
+ url, mime_type, false, &stale, &info_array, NULL);
+ for (size_t i = 0; i < info_array.size(); ++i) {
+ if (webkit::npapi::IsPluginEnabled(info_array[i]))
+ return true;
}
return NO;

Powered by Google App Engine
This is Rietveld 408576698