Bug 1127374 - Make ContentParent::RecvLoadPlugin less failure prone. r=billm
This commit is contained in:
@@ -94,13 +94,14 @@ struct RunnableMethodTraits<mozilla::plugins::PluginModuleParent>
|
||||
bool
|
||||
mozilla::plugins::SetupBridge(uint32_t aPluginId,
|
||||
dom::ContentParent* aContentParent,
|
||||
bool aForceBridgeNow)
|
||||
bool aForceBridgeNow,
|
||||
nsresult* rv)
|
||||
{
|
||||
nsRefPtr<nsPluginHost> host = nsPluginHost::GetInst();
|
||||
nsRefPtr<nsNPAPIPlugin> plugin;
|
||||
nsresult rv = host->GetPluginForContentProcess(aPluginId, getter_AddRefs(plugin));
|
||||
if (NS_FAILED(rv)) {
|
||||
return false;
|
||||
*rv = host->GetPluginForContentProcess(aPluginId, getter_AddRefs(plugin));
|
||||
if (NS_FAILED(*rv)) {
|
||||
return true;
|
||||
}
|
||||
PluginModuleChromeParent* chromeParent = static_cast<PluginModuleChromeParent*>(plugin->GetLibrary());
|
||||
chromeParent->SetContentParent(aContentParent);
|
||||
@@ -293,7 +294,9 @@ PluginModuleContentParent::LoadModule(uint32_t aPluginId)
|
||||
* its module mapping. We fetch it from there after LoadPlugin finishes.
|
||||
*/
|
||||
dom::ContentChild* cp = dom::ContentChild::GetSingleton();
|
||||
if (!cp->SendLoadPlugin(aPluginId)) {
|
||||
nsresult rv;
|
||||
if (!cp->SendLoadPlugin(aPluginId, &rv) ||
|
||||
NS_FAILED(rv)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user