OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // http://mail.gnome.org/archives/gnome-announce-list/2011-October/msg00041.ht
ml | 140 // http://mail.gnome.org/archives/gnome-announce-list/2011-October/msg00041.ht
ml |
141 #if defined(TOOLKIT_USES_GTK) | 141 #if defined(TOOLKIT_USES_GTK) |
142 #if !(GLIB_CHECK_VERSION(2, 31, 0)) | 142 #if !(GLIB_CHECK_VERSION(2, 31, 0)) |
143 if (!g_thread_get_initialized()) { | 143 if (!g_thread_get_initialized()) { |
144 g_thread_init(NULL); | 144 g_thread_init(NULL); |
145 } | 145 } |
146 #endif | 146 #endif |
147 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); | 147 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); |
148 #endif | 148 #endif |
149 | 149 |
| 150 ScopedVector<webkit::npapi::PluginGroup> plugin_groups; |
| 151 // TODO(bauerb): If we restart loading plug-ins, we might mess up the logic in |
| 152 // PluginList::ShouldLoadPlugin due to missing the previously loaded plug-ins |
| 153 // in |plugin_groups|. |
150 for (size_t i = 0; i < plugin_paths.size(); ++i) { | 154 for (size_t i = 0; i < plugin_paths.size(); ++i) { |
151 ScopedVector<webkit::npapi::PluginGroup> plugin_groups; | 155 webkit::WebPluginInfo plugin; |
152 plugin_list->LoadPlugin(plugin_paths[i], &plugin_groups); | 156 if (!plugin_list->LoadPlugin(plugin_paths[i], &plugin_groups, &plugin)) |
153 | |
154 if (plugin_groups.empty()) { | |
155 Send(new UtilityHostMsg_LoadPluginFailed(i, plugin_paths[i])); | 157 Send(new UtilityHostMsg_LoadPluginFailed(i, plugin_paths[i])); |
156 continue; | 158 else |
157 } | 159 Send(new UtilityHostMsg_LoadedPlugin(i, plugin)); |
158 | |
159 const webkit::npapi::PluginGroup* group = plugin_groups[0]; | |
160 DCHECK_EQ(group->web_plugin_infos().size(), 1u); | |
161 | |
162 Send(new UtilityHostMsg_LoadedPlugin(i, group->web_plugin_infos().front())); | |
163 } | 160 } |
164 | 161 |
165 ReleaseProcessIfNeeded(); | 162 ReleaseProcessIfNeeded(); |
166 } | 163 } |
167 #endif | 164 #endif |
OLD | NEW |