Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1953)

Unified Diff: content/utility/utility_thread_impl.cc

Issue 8774048: [Linux] Call g_thread_init() in UtilityThreadImpl::OnLoadPlugins(). (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Move to ctor Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/utility/utility_thread_impl.cc
diff --git a/content/utility/utility_thread_impl.cc b/content/utility/utility_thread_impl.cc
index e909224df8652a440cc1bf2e16fd7db3d492c392..f4c4b35c9b25ec414b388fe97a3e4c837054bbfb 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() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698