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

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: 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..253f9c5b8407ce01ce607fa77a915370e5640e3a 100644
--- a/content/utility/utility_thread_impl.cc
+++ b/content/utility/utility_thread_impl.cc
@@ -6,6 +6,10 @@
#include <stddef.h>
+#if defined(TOOLKIT_USES_GTK)
+#include <gtk/gtk.h>
+#endif
+
#include "base/file_path.h"
#include "base/memory/scoped_vector.h"
#include "content/common/child_process.h"
@@ -127,6 +131,12 @@ void UtilityThreadImpl::OnLoadPlugins(
webkit::npapi::PluginList* plugin_list =
webkit::npapi::PluginList::Singleton();
+ // 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);
piman 2011/12/02 18:13:39 It seems that we should do that once and for all i
Robert Sesek 2011/12/02 18:37:44 Why? The only IPC message that requires this is Lo
piman 2011/12/02 18:45:21 Today. If you want to leave things here, then plea
Robert Sesek 2011/12/02 19:19:42 Moving to ctor > adding an assert. Done.
+#endif
+
for (size_t i = 0; i < plugin_paths.size(); ++i) {
ScopedVector<webkit::npapi::PluginGroup> plugin_groups;
plugin_list->LoadPlugin(plugin_paths[i], &plugin_groups);
« 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