Commit 5c2d03f6 authored by rsesek@chromium.org's avatar rsesek@chromium.org

[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
parent 89bcad35
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <stddef.h> #include <stddef.h>
#include "base/command_line.h"
#include "base/file_path.h" #include "base/file_path.h"
#include "base/memory/scoped_vector.h" #include "base/memory/scoped_vector.h"
#include "content/common/child_process.h" #include "content/common/child_process.h"
...@@ -20,6 +21,12 @@ ...@@ -20,6 +21,12 @@
#include "webkit/glue/idb_bindings.h" #include "webkit/glue/idb_bindings.h"
#include "webkit/plugins/npapi/plugin_list.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 { namespace {
template<typename SRC, typename DEST> template<typename SRC, typename DEST>
...@@ -37,6 +44,13 @@ UtilityThreadImpl::UtilityThreadImpl() ...@@ -37,6 +44,13 @@ UtilityThreadImpl::UtilityThreadImpl()
webkit_platform_support_.reset(new content::WebKitPlatformSupportImpl); webkit_platform_support_.reset(new content::WebKitPlatformSupportImpl);
WebKit::initialize(webkit_platform_support_.get()); WebKit::initialize(webkit_platform_support_.get());
content::GetContentClient()->utility()->UtilityThreadStarted(); 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() { UtilityThreadImpl::~UtilityThreadImpl() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment