diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-14 05:24:21 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-14 05:24:21 +0000 |
commit | c2c901bf406a50085002f8f1d6d63288d6e28c05 (patch) | |
tree | 7eb876216d6c541404fb73c3eaa32f387c8b9e6b /chrome/common/chrome_plugin_lib.cc | |
parent | 684970b638fbfe1a2137fd162f630c86d2859828 (diff) | |
download | chromium_src-c2c901bf406a50085002f8f1d6d63288d6e28c05.zip chromium_src-c2c901bf406a50085002f8f1d6d63288d6e28c05.tar.gz chromium_src-c2c901bf406a50085002f8f1d6d63288d6e28c05.tar.bz2 |
Ensure we don't load plugins on the IO thread.
I had to move the locks from PluginService to PluginList, so that a lock (which can block other threads) isn't held while loading the plugins.
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@23420 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/chrome_plugin_lib.cc')
-rw-r--r-- | chrome/common/chrome_plugin_lib.cc | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/chrome/common/chrome_plugin_lib.cc b/chrome/common/chrome_plugin_lib.cc index 947527f..86789a4 100644 --- a/chrome/common/chrome_plugin_lib.cc +++ b/chrome/common/chrome_plugin_lib.cc @@ -42,12 +42,6 @@ static PluginMap* g_loaded_libs; static PlatformThreadId g_plugin_thread_id = 0; static MessageLoop* g_plugin_thread_loop = NULL; -#ifdef GEARS_STATIC_LIB -// defined in gears/base/chrome/module_cr.cc -CPError STDCALL Gears_CP_Initialize(CPID id, const CPBrowserFuncs *bfuncs, - CPPluginFuncs *pfuncs); -#endif - static bool IsSingleProcessMode() { // We don't support ChromePlugins in single-process mode. return CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess); @@ -120,9 +114,7 @@ void ChromePluginLib::RegisterPluginsWithNPAPI() { FilePath path; if (!PathService::Get(chrome::FILE_GEARS_PLUGIN, &path)) return; - // Note: we can only access the NPAPI list because the PluginService has done - // the locking for us. We should not touch it anywhere else. - NPAPI::PluginList::AddExtraPluginPath(path); + NPAPI::PluginList::Singleton()->AddExtraPluginPath(path); } static void LogPluginLoadTime(const TimeDelta &time) { @@ -253,13 +245,6 @@ bool ChromePluginLib::Load() { return false; #else DCHECK(module_ == 0); -#ifdef GEARS_STATIC_LIB - FilePath path; - if (filename_.BaseName().value().find(FILE_PATH_LITERAL("gears")) == 0) { - CP_Initialize_ = &Gears_CP_Initialize; - return true; - } -#endif module_ = LoadLibrary(filename_.value().c_str()); if (module_ == 0) |