diff options
author | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-05 21:05:13 +0000 |
---|---|---|
committer | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-05 21:05:13 +0000 |
commit | 5c2d03f68a5f42ac565a353e9fe478248f41c4b2 (patch) | |
tree | 6540ff18f379d7775cadd1d723f292ee517e5c5c /content/utility | |
parent | 89bcad35378b82b05b5c57d5897e8a502a6bc8e1 (diff) | |
download | chromium_src-5c2d03f68a5f42ac565a353e9fe478248f41c4b2.zip chromium_src-5c2d03f68a5f42ac565a353e9fe478248f41c4b2.tar.gz chromium_src-5c2d03f68a5f42ac565a353e9fe478248f41c4b2.tar.bz2 |
[Linux] Call g_thread_init() in UtilityThreadImpl::OnLoadPlugins().
This allows plugins that call into glib for NP_GetMIMEDescription to load
without crashing.
BUG=71661,105252
TEST=Have libTotem plugins installed, go to about:plugins and they are present.
Review URL: http://codereview.chromium.org/8774048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113021 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/utility')
-rw-r--r-- | content/utility/utility_thread_impl.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/content/utility/utility_thread_impl.cc b/content/utility/utility_thread_impl.cc index 2ccb774..c979c91 100644 --- a/content/utility/utility_thread_impl.cc +++ b/content/utility/utility_thread_impl.cc @@ -6,6 +6,7 @@ #include <stddef.h> +#include "base/command_line.h" #include "base/file_path.h" #include "base/memory/scoped_vector.h" #include "content/common/child_process.h" @@ -20,6 +21,12 @@ #include "webkit/glue/idb_bindings.h" #include "webkit/plugins/npapi/plugin_list.h" +#if defined(TOOLKIT_USES_GTK) +#include <gtk/gtk.h> + +#include "ui/gfx/gtk_util.h" +#endif + namespace { template<typename SRC, typename DEST> @@ -37,6 +44,13 @@ UtilityThreadImpl::UtilityThreadImpl() webkit_platform_support_.reset(new content::WebKitPlatformSupportImpl); WebKit::initialize(webkit_platform_support_.get()); content::GetContentClient()->utility()->UtilityThreadStarted(); + + // On Linux, some plugins expect the browser to have loaded glib/gtk. Do that + // before attempting to call into the plugin. +#if defined(TOOLKIT_USES_GTK) + g_thread_init(NULL); + gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); +#endif } UtilityThreadImpl::~UtilityThreadImpl() { |