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

Unified Diff: content/utility/utility_thread_impl.cc

Issue 8318028: Gracefully handle child process death in out-of-process plugin loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Do not send the index Created 9 years, 2 months 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 | « content/utility/utility_thread_impl.h ('k') | webkit/plugins/npapi/plugin_list.h » ('j') | 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 ca1a7e3b68676d9991c3e0e80006a8e4d1c90646..393dc3bf53a9e8e5810e2e2c3ac5937f80e353ec 100644
--- a/content/utility/utility_thread_impl.cc
+++ b/content/utility/utility_thread_impl.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include "base/file_path.h"
+#include "base/memory/scoped_vector.h"
#include "content/common/child_process.h"
#include "content/common/indexed_db_key.h"
#include "content/common/utility_messages.h"
@@ -107,34 +108,27 @@ void UtilityThreadImpl::OnBatchModeFinished() {
#if defined(OS_POSIX)
void UtilityThreadImpl::OnLoadPlugins(
- const std::vector<FilePath>& extra_plugin_paths,
- const std::vector<FilePath>& extra_plugin_dirs,
- const std::vector<webkit::WebPluginInfo>& internal_plugins) {
+ const std::vector<FilePath>& plugin_paths) {
webkit::npapi::PluginList* plugin_list =
webkit::npapi::PluginList::Singleton();
- // Create the PluginList and set the paths from which to load plugins. Iterate
- // in reverse to preserve the order when pushing back.
- std::vector<FilePath>::const_reverse_iterator it;
- for (it = extra_plugin_paths.rbegin();
- it != extra_plugin_paths.rend();
+ for (std::vector<FilePath>::const_iterator it = plugin_paths.begin();
+ it != plugin_paths.end();
++it) {
- plugin_list->AddExtraPluginPath(*it);
- }
- for (it = extra_plugin_dirs.rbegin(); it != extra_plugin_dirs.rend(); ++it) {
- plugin_list->AddExtraPluginDir(*it);
- }
- for (std::vector<webkit::WebPluginInfo>::const_reverse_iterator it =
- internal_plugins.rbegin();
- it != internal_plugins.rend();
- ++it) {
- plugin_list->RegisterInternalPlugin(*it);
- }
+ ScopedVector<webkit::npapi::PluginGroup> plugin_groups;
+ plugin_list->LoadPlugin(*it, &plugin_groups);
- std::vector<webkit::WebPluginInfo> plugins;
- plugin_list->GetPlugins(&plugins);
+ if (plugin_groups.empty()) {
+ Send(new UtilityHostMsg_LoadPluginFailed(*it));
+ continue;
+ }
+
+ const webkit::npapi::PluginGroup* group = plugin_groups[0];
+ DCHECK_EQ(group->web_plugin_infos().size(), 1u);
+
+ Send(new UtilityHostMsg_LoadedPlugin(group->web_plugin_infos().front()));
+ }
- Send(new UtilityHostMsg_LoadedPlugins(plugins));
ReleaseProcessIfNeeded();
}
#endif
« no previous file with comments | « content/utility/utility_thread_impl.h ('k') | webkit/plugins/npapi/plugin_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698