summaryrefslogtreecommitdiffstats
path: root/content/utility
diff options
context:
space:
mode:
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-21 17:45:43 +0000
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-21 17:45:43 +0000
commitd4af1e727ce10d9f4eda8424e63cbb82b16f22b9 (patch)
tree9b7db4554d5e7ad414e1f1564ca083f3abb5ee5c /content/utility
parent3cb34b797fe70cec168c0e5824014dcf856ee8e3 (diff)
downloadchromium_src-d4af1e727ce10d9f4eda8424e63cbb82b16f22b9.zip
chromium_src-d4af1e727ce10d9f4eda8424e63cbb82b16f22b9.tar.gz
chromium_src-d4af1e727ce10d9f4eda8424e63cbb82b16f22b9.tar.bz2
Gracefully handle child process death in out-of-process plugin loading.
This also queues requests to load plugins, based on http://codereview.chromium.org/8243010/. BUG=100053 TEST=Install Sonix webcam driver on OS X Lion and try to load a Flash video. It plays. Review URL: http://codereview.chromium.org/8318028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106738 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/utility')
-rw-r--r--content/utility/utility_thread_impl.cc38
-rw-r--r--content/utility/utility_thread_impl.h5
2 files changed, 17 insertions, 26 deletions
diff --git a/content/utility/utility_thread_impl.cc b/content/utility/utility_thread_impl.cc
index ca1a7e3..393dc3b 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
diff --git a/content/utility/utility_thread_impl.h b/content/utility/utility_thread_impl.h
index 3af6c32..d7352d2 100644
--- a/content/utility/utility_thread_impl.h
+++ b/content/utility/utility_thread_impl.h
@@ -55,10 +55,7 @@ class UtilityThreadImpl : public content::UtilityThread,
void OnBatchModeFinished();
#if defined(OS_POSIX)
- void OnLoadPlugins(
- const std::vector<FilePath>& extra_plugin_paths,
- const std::vector<FilePath>& extra_plugin_dirs,
- const std::vector<webkit::WebPluginInfo>& internal_plugins);
+ void OnLoadPlugins(const std::vector<FilePath>& plugin_paths);
#endif // OS_POSIX
// True when we're running in batch mode.