summaryrefslogtreecommitdiffstats
path: root/chrome/plugin/chrome_plugin_host.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-17 00:08:17 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-17 00:08:17 +0000
commitda5bc57c5f9e7357056a49b37b5a4ed7a3a8657d (patch)
treebf51b203bfb73302c1df347554f464f2e4b8c985 /chrome/plugin/chrome_plugin_host.cc
parentfc744d78ea7fedccd43335c87a485e5c4a771b04 (diff)
downloadchromium_src-da5bc57c5f9e7357056a49b37b5a4ed7a3a8657d.zip
chromium_src-da5bc57c5f9e7357056a49b37b5a4ed7a3a8657d.tar.gz
chromium_src-da5bc57c5f9e7357056a49b37b5a4ed7a3a8657d.tar.bz2
Fix Gears crash after making PluginThread::current() only work on that thread.
Review URL: http://codereview.chromium.org/126244 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18563 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin/chrome_plugin_host.cc')
-rw-r--r--chrome/plugin/chrome_plugin_host.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/chrome/plugin/chrome_plugin_host.cc b/chrome/plugin/chrome_plugin_host.cc
index 0a9c85b..a81d7d3 100644
--- a/chrome/plugin/chrome_plugin_host.cc
+++ b/chrome/plugin/chrome_plugin_host.cc
@@ -31,6 +31,8 @@ namespace {
using webkit_glue::ResourceLoaderBridge;
+static MessageLoop* g_plugin_thread_message_loop;
+
// This class manages a network request made by the plugin, handling the
// data as it comes in from the ResourceLoaderBridge and is requested by the
// plugin.
@@ -581,11 +583,8 @@ CPError STDCALL CPB_SendSyncMessage(CPID id, const void *data, uint32 data_len,
CPError STDCALL CPB_PluginThreadAsyncCall(CPID id,
void (*func)(void *),
void *user_data) {
- MessageLoop *message_loop = PluginThread::current()->message_loop();
- if (!message_loop) {
- return CPERR_FAILURE;
- }
- message_loop->PostTask(FROM_HERE, NewRunnableFunction(func, user_data));
+ g_plugin_thread_message_loop->PostTask(
+ FROM_HERE, NewRunnableFunction(func, user_data));
return CPERR_SUCCESS;
}
@@ -612,6 +611,8 @@ CPBrowserFuncs* GetCPBrowserFuncsForPlugin() {
if (!initialized) {
initialized = true;
+ g_plugin_thread_message_loop = PluginThread::current()->message_loop();
+
browser_funcs.size = sizeof(browser_funcs);
browser_funcs.version = CP_VERSION;
browser_funcs.enable_request_intercept = CPB_EnableRequestIntercept;