summaryrefslogtreecommitdiffstats
path: root/webkit/support
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-29 08:21:28 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-29 08:21:28 +0000
commit685980787980c7be0dd1f8b83900718c8e2634f2 (patch)
tree8d5e3d52426658543f7ac025f9cb44afd0b9c531 /webkit/support
parent02601778c9535f4b23c084794204d6ee2bd0fa86 (diff)
downloadchromium_src-685980787980c7be0dd1f8b83900718c8e2634f2.zip
chromium_src-685980787980c7be0dd1f8b83900718c8e2634f2.tar.gz
chromium_src-685980787980c7be0dd1f8b83900718c8e2634f2.tar.bz2
PluginList cleanup to fix a race condition and decrease the API surface for future refactorings:
* Remove "webkit/glue/plugins/plugin_list.h" includes in favor of "webkit/npapi/plugins/plugin_list.h" * Remove |refresh| parameter from |GetPlugins| in favor of calling |RefreshPlugins| beforehand. * Remove |GetPluginInfo| in favor of calling |GetPluginInfoArray| and looking for the first enabled plug-in. * Remove |GetEnabledPlugins| in favor of calling |GetPlugins| and filtering out disabled plugins. * Remove |stale| in favor of an outparameter to |GetPluginInfoArray|, to remove the race condition. BUG=69516,80794 TEST=none Review URL: http://codereview.chromium.org/7497030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94641 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/support')
-rw-r--r--webkit/support/webkit_support.cc14
-rw-r--r--webkit/support/webkit_support_glue.cc6
2 files changed, 11 insertions, 9 deletions
diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc
index 87381b8..139c4b4 100644
--- a/webkit/support/webkit_support.cc
+++ b/webkit/support/webkit_support.cc
@@ -281,16 +281,16 @@ WebKit::WebKitClient* GetWebKitClient() {
WebPlugin* CreateWebPlugin(WebFrame* frame,
const WebPluginParams& params) {
const bool kAllowWildcard = true;
- webkit::npapi::WebPluginInfo info;
- std::string actual_mime_type;
- if (!webkit::npapi::PluginList::Singleton()->GetPluginInfo(
- params.url, params.mimeType.utf8(), kAllowWildcard, &info,
- &actual_mime_type) || !webkit::npapi::IsPluginEnabled(info)) {
+ std::vector<webkit::npapi::WebPluginInfo> plugins;
+ std::vector<std::string> mime_types;
+ webkit::npapi::PluginList::Singleton()->GetPluginInfoArray(
+ params.url, params.mimeType.utf8(), kAllowWildcard,
+ NULL, &plugins, &mime_types);
+ if (plugins.empty())
return NULL;
- }
return new WebPluginImplWithPageDelegate(
- frame, params, info.path, actual_mime_type);
+ frame, params, plugins.front().path, mime_types.front());
}
WebKit::WebMediaPlayer* CreateMediaPlayer(WebFrame* frame,
diff --git a/webkit/support/webkit_support_glue.cc b/webkit/support/webkit_support_glue.cc
index 02a2233..ef67877 100644
--- a/webkit/support/webkit_support_glue.cc
+++ b/webkit/support/webkit_support_glue.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -16,7 +16,9 @@ namespace webkit_glue {
void GetPlugins(bool refresh,
std::vector<webkit::npapi::WebPluginInfo>* plugins) {
- webkit::npapi::PluginList::Singleton()->GetPlugins(refresh, plugins);
+ if (refresh)
+ webkit::npapi::PluginList::Singleton()->RefreshPlugins();
+ webkit::npapi::PluginList::Singleton()->GetPlugins(plugins);
// Don't load the forked npapi_layout_test_plugin in DRT, we only want to
// use the upstream version TestNetscapePlugIn.
const FilePath::StringType kPluginBlackList[] = {