Chromium Code Reviews| 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/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 void UtilityThreadImpl::OnBatchModeFinished() { | 120 void UtilityThreadImpl::OnBatchModeFinished() { |
| 121 ChildProcess::current()->ReleaseProcess(); | 121 ChildProcess::current()->ReleaseProcess(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 #if defined(OS_POSIX) | 124 #if defined(OS_POSIX) |
| 125 void UtilityThreadImpl::OnLoadPlugins( | 125 void UtilityThreadImpl::OnLoadPlugins( |
| 126 const std::vector<FilePath>& plugin_paths) { | 126 const std::vector<FilePath>& plugin_paths) { |
| 127 webkit::npapi::PluginList* plugin_list = | 127 webkit::npapi::PluginList* plugin_list = |
| 128 webkit::npapi::PluginList::Singleton(); | 128 webkit::npapi::PluginList::Singleton(); |
| 129 | 129 |
| 130 for (std::vector<FilePath>::const_iterator it = plugin_paths.begin(); | 130 for (size_t i = 0; i < plugin_paths.size(); ++i) { |
| 131 it != plugin_paths.end(); | |
| 132 ++it) { | |
| 133 ScopedVector<webkit::npapi::PluginGroup> plugin_groups; | 131 ScopedVector<webkit::npapi::PluginGroup> plugin_groups; |
| 134 plugin_list->LoadPlugin(*it, &plugin_groups); | 132 plugin_list->LoadPlugin(plugin_paths[i], &plugin_groups); |
| 135 | 133 |
| 136 if (plugin_groups.empty()) { | 134 if (plugin_groups.empty()) { |
| 137 Send(new UtilityHostMsg_LoadPluginFailed(*it)); | 135 Send(new UtilityHostMsg_LoadPluginFailed(i, plugin_paths[i])); |
| 138 continue; | 136 continue; |
| 139 } | 137 } |
| 140 | 138 |
| 141 const webkit::npapi::PluginGroup* group = plugin_groups[0]; | 139 const webkit::npapi::PluginGroup* group = plugin_groups[0]; |
| 142 DCHECK_EQ(group->web_plugin_infos().size(), 1u); | 140 DCHECK_EQ(group->web_plugin_infos().size(), 1u); |
| 143 | 141 |
| 144 Send(new UtilityHostMsg_LoadedPlugin(group->web_plugin_infos().front())); | 142 Send(new UtilityHostMsg_LoadedPlugin(i, group->web_plugin_infos().front())); |
|
Bernhard Bauer
2011/11/02 16:03:52
I still feel a little bit silly just sending an in
Robert Sesek
2011/11/02 16:26:28
I think the index is fine to send. Sending the ori
| |
| 145 } | 143 } |
| 146 | 144 |
| 147 ReleaseProcessIfNeeded(); | 145 ReleaseProcessIfNeeded(); |
| 148 } | 146 } |
| 149 #endif | 147 #endif |
| 150 | 148 |
| OLD | NEW |