diff options
author | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-23 22:51:46 +0000 |
---|---|---|
committer | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-23 22:51:46 +0000 |
commit | 020f5bad1085d21d6ad912241ae3669ef1a9375f (patch) | |
tree | b20ad4173a6117abe3c5c6b54a550fda49338d90 /chrome/common/chrome_plugin_lib.cc | |
parent | d4f7e76644f684d0e9395fa8225e0d1c607de241 (diff) | |
download | chromium_src-020f5bad1085d21d6ad912241ae3669ef1a9375f.zip chromium_src-020f5bad1085d21d6ad912241ae3669ef1a9375f.tar.gz chromium_src-020f5bad1085d21d6ad912241ae3669ef1a9375f.tar.bz2 |
Add an accessor to get the CPAPI main plugin thread's MessageLoop. Use that
to fix a crash in renderer/chrome_plugin_host.cc.
Review URL: http://codereview.chromium.org/4050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2528 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/chrome_plugin_lib.cc')
-rw-r--r-- | chrome/common/chrome_plugin_lib.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/common/chrome_plugin_lib.cc b/chrome/common/chrome_plugin_lib.cc index 402075f..ae8964d 100644 --- a/chrome/common/chrome_plugin_lib.cc +++ b/chrome/common/chrome_plugin_lib.cc @@ -7,6 +7,7 @@ #include "base/command_line.h" #include "base/hash_tables.h" #include "base/histogram.h" +#include "base/message_loop.h" #include "base/path_service.h" #include "base/perftimer.h" #include "base/registry.h" @@ -31,6 +32,7 @@ static PluginMap* g_loaded_libs; // The thread plugins are loaded and used in, lazily initialized upon // the first creation call. static DWORD g_plugin_thread_id = 0; +static MessageLoop* g_plugin_thread_loop = NULL; static bool IsSingleProcessMode() { // We don't support ChromePlugins in single-process mode. @@ -45,6 +47,7 @@ ChromePluginLib* ChromePluginLib::Create(const std::wstring& filename, if (!g_loaded_libs) { g_loaded_libs = new PluginMap(); g_plugin_thread_id = ::GetCurrentThreadId(); + g_plugin_thread_loop = MessageLoop::current(); } DCHECK(IsPluginThread()); @@ -89,6 +92,11 @@ bool ChromePluginLib::IsPluginThread() { } // static +MessageLoop* ChromePluginLib::GetPluginThreadLoop() { + return g_plugin_thread_loop; +} + +// static void ChromePluginLib::RegisterPluginsWithNPAPI() { // We don't support ChromePlugins in single-process mode. if (IsSingleProcessMode()) |