diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-04 16:01:09 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-04 16:01:09 +0000 |
commit | 96dcc176c46003af0176f0f4772affc741aa772a (patch) | |
tree | b2f46757dc96b8503d4dae36b050c0af30db28a6 /content/renderer/pepper_plugin_delegate_impl.cc | |
parent | f66a0ff593d3d4a54c02792e277b70c097fbc0af (diff) | |
download | chromium_src-96dcc176c46003af0176f0f4772affc741aa772a.zip chromium_src-96dcc176c46003af0176f0f4772affc741aa772a.tar.gz chromium_src-96dcc176c46003af0176f0f4772affc741aa772a.tar.bz2 |
When out-of-process PPAPI plugins fail to initialize, don't fall back on trying
to load them as NPAPI.
BUG=78115
Review URL: http://codereview.chromium.org/6771057
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80317 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/pepper_plugin_delegate_impl.cc')
-rw-r--r-- | content/renderer/pepper_plugin_delegate_impl.cc | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/content/renderer/pepper_plugin_delegate_impl.cc b/content/renderer/pepper_plugin_delegate_impl.cc index 7c94c1e..72fb46d 100644 --- a/content/renderer/pepper_plugin_delegate_impl.cc +++ b/content/renderer/pepper_plugin_delegate_impl.cc @@ -337,7 +337,11 @@ PepperPluginDelegateImpl::~PepperPluginDelegateImpl() { } scoped_refptr<webkit::ppapi::PluginModule> -PepperPluginDelegateImpl::CreatePepperPlugin(const FilePath& path) { +PepperPluginDelegateImpl::CreatePepperPlugin( + const FilePath& path, + bool* pepper_plugin_was_registered) { + *pepper_plugin_was_registered = true; + // See if a module has already been loaded for this plugin. scoped_refptr<webkit::ppapi::PluginModule> module = PepperPluginRegistry::GetInstance()->GetLiveModule(path); @@ -345,12 +349,17 @@ PepperPluginDelegateImpl::CreatePepperPlugin(const FilePath& path) { return module; // In-process plugins will have always been created up-front to avoid the - // sandbox restrictions. So gettin here implies it doesn't exist or should + // sandbox restrictions. So getting here implies it doesn't exist or should // be out of process. const PepperPluginInfo* info = PepperPluginRegistry::GetInstance()->GetInfoForPlugin(path); - if (!info || !info->is_out_of_process) - return module; // Return the NULL module. + if (!info) { + *pepper_plugin_was_registered = false; + return scoped_refptr<webkit::ppapi::PluginModule>(); + } else if (!info->is_out_of_process) { + // In-process plugin not preloaded, it probably couldn't be initialized. + return scoped_refptr<webkit::ppapi::PluginModule>(); + } // Out of process: have the browser start the plugin process for us. base::ProcessHandle plugin_process_handle = base::kNullProcessHandle; |