summaryrefslogtreecommitdiffstats
path: root/chrome/browser/plugin_service.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-11 19:25:38 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-11 19:25:38 +0000
commit1de6f2bf3cf4324737eeb5d4d67f3c76bfa1a60a (patch)
treec5b017af643fa263fc6b97148a78139dee27d0b7 /chrome/browser/plugin_service.cc
parentd3ff52b38ae7096cf95b9cce4308f4081a38a662 (diff)
downloadchromium_src-1de6f2bf3cf4324737eeb5d4d67f3c76bfa1a60a.zip
chromium_src-1de6f2bf3cf4324737eeb5d4d67f3c76bfa1a60a.tar.gz
chromium_src-1de6f2bf3cf4324737eeb5d4d67f3c76bfa1a60a.tar.bz2
Ensure we don't load plugins on the IO thread
BUG=17938 TEST=added asserts which crash if plugins loaded on IO thread, current UI tests exercise them Review URL: http://codereview.chromium.org/164305 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23064 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_service.cc')
-rw-r--r--chrome/browser/plugin_service.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/plugin_service.cc b/chrome/browser/plugin_service.cc
index d9d3e65..1360e6f 100644
--- a/chrome/browser/plugin_service.cc
+++ b/chrome/browser/plugin_service.cc
@@ -75,8 +75,14 @@ PluginService::~PluginService() {
#endif
}
+bool PluginService::PluginsLoaded() {
+ AutoLock lock(lock_);
+ return NPAPI::PluginList::PluginsLoaded();
+}
+
void PluginService::GetPlugins(bool refresh,
std::vector<WebPluginInfo>* plugins) {
+ DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
AutoLock lock(lock_);
NPAPI::PluginList::Singleton()->GetPlugins(refresh, plugins);
}
@@ -180,6 +186,8 @@ FilePath PluginService::GetPluginPath(const GURL& url,
const std::string& clsid,
std::string* actual_mime_type) {
AutoLock lock(lock_);
+ DCHECK(NPAPI::PluginList::PluginsLoaded() ||
+ ChromeThread::CurrentlyOn(ChromeThread::FILE));
bool allow_wildcard = true;
WebPluginInfo info;
if (NPAPI::PluginList::Singleton()->GetPluginInfo(url, mime_type, clsid,
@@ -195,12 +203,16 @@ FilePath PluginService::GetPluginPath(const GURL& url,
bool PluginService::GetPluginInfoByPath(const FilePath& plugin_path,
WebPluginInfo* info) {
AutoLock lock(lock_);
+ DCHECK(NPAPI::PluginList::PluginsLoaded() ||
+ ChromeThread::CurrentlyOn(ChromeThread::FILE));
return NPAPI::PluginList::Singleton()->GetPluginInfoByPath(plugin_path, info);
}
bool PluginService::HavePluginFor(const std::string& mime_type,
bool allow_wildcard) {
AutoLock lock(lock_);
+ DCHECK(NPAPI::PluginList::PluginsLoaded() ||
+ ChromeThread::CurrentlyOn(ChromeThread::FILE));
GURL url;
WebPluginInfo info;