OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/utility/utility_thread_impl.h" | 5 #include "content/utility/utility_thread_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
130 | 130 |
131 #if defined(OS_POSIX) | 131 #if defined(OS_POSIX) |
132 void UtilityThreadImpl::OnLoadPlugins( | 132 void UtilityThreadImpl::OnLoadPlugins( |
133 const std::vector<FilePath>& plugin_paths) { | 133 const std::vector<FilePath>& plugin_paths) { |
134 webkit::npapi::PluginList* plugin_list = | 134 webkit::npapi::PluginList* plugin_list = |
135 webkit::npapi::PluginList::Singleton(); | 135 webkit::npapi::PluginList::Singleton(); |
136 | 136 |
137 // On Linux, some plugins expect the browser to have loaded glib/gtk. Do that | 137 // On Linux, some plugins expect the browser to have loaded glib/gtk. Do that |
138 // before attempting to call into the plugin. | 138 // before attempting to call into the plugin. |
139 #if defined(TOOLKIT_USES_GTK) | 139 #if defined(TOOLKIT_USES_GTK) |
140 if (!g_thread_get_initialized()) { | 140 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); |
141 /*if (!g_thread_get_initialized()) { | |
141 g_thread_init(NULL); | 142 g_thread_init(NULL); |
Elliot Glaysher
2012/03/28 17:49:00
Same thing here.
| |
142 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); | 143 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); |
143 } | 144 }*/ |
144 #endif | 145 #endif |
145 | 146 |
146 for (size_t i = 0; i < plugin_paths.size(); ++i) { | 147 for (size_t i = 0; i < plugin_paths.size(); ++i) { |
147 ScopedVector<webkit::npapi::PluginGroup> plugin_groups; | 148 ScopedVector<webkit::npapi::PluginGroup> plugin_groups; |
148 plugin_list->LoadPlugin(plugin_paths[i], &plugin_groups); | 149 plugin_list->LoadPlugin(plugin_paths[i], &plugin_groups); |
149 | 150 |
150 if (plugin_groups.empty()) { | 151 if (plugin_groups.empty()) { |
151 Send(new UtilityHostMsg_LoadPluginFailed(i, plugin_paths[i])); | 152 Send(new UtilityHostMsg_LoadPluginFailed(i, plugin_paths[i])); |
152 continue; | 153 continue; |
153 } | 154 } |
154 | 155 |
155 const webkit::npapi::PluginGroup* group = plugin_groups[0]; | 156 const webkit::npapi::PluginGroup* group = plugin_groups[0]; |
156 DCHECK_EQ(group->web_plugin_infos().size(), 1u); | 157 DCHECK_EQ(group->web_plugin_infos().size(), 1u); |
157 | 158 |
158 Send(new UtilityHostMsg_LoadedPlugin(i, group->web_plugin_infos().front())); | 159 Send(new UtilityHostMsg_LoadedPlugin(i, group->web_plugin_infos().front())); |
159 } | 160 } |
160 | 161 |
161 ReleaseProcessIfNeeded(); | 162 ReleaseProcessIfNeeded(); |
162 } | 163 } |
163 #endif | 164 #endif |
OLD | NEW |