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

Unified Diff: content/utility/utility_thread_impl.cc

Issue 8870005: Utility process: move GTK initialization to the plugin loading code path. (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 c979c91a2e756ca4b7b778457271aaee199aa018..d43e531e080c4822636361ec79240ae6fff855c6 100644
--- a/content/utility/utility_thread_impl.cc
+++ b/content/utility/utility_thread_impl.cc
@@ -44,13 +44,6 @@ 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() {
@@ -141,6 +134,14 @@ 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)
+ CHECK(!g_thread_get_initialized());
+ g_thread_init(NULL);
+ gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess());
+#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