Fixes 51759. If we ship without a plugin manager as we can do for embedding, we crash loading most pages with plugins. This change basically returns an error from Reflow if we cant get the plugin manager component. r=valeski

git-svn-id: svn://10.0.0.236/trunk@78754 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dougt%netscape.com
2000-09-11 20:27:25 +00:00
parent 42340b3f15
commit f6edad2f99
2 changed files with 20 additions and 2 deletions

View File

@@ -616,6 +616,9 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext,
// get the nsIPluginHost interface
pluginHost = do_GetService(kCPluginManagerCID);
if (!pluginHost)
return NS_ERROR_MODULE_PLUGINS;
mInstanceOwner->SetPluginHost(pluginHost);
rv = InstantiatePlugin(aPresContext, aMetrics, aReflowState, pluginHost, mimeType, fullURL);
}
@@ -653,6 +656,9 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext,
// get the nsIPluginHost interface
pluginHost = do_GetService(kCPluginManagerCID);
if (!pluginHost)
return NS_ERROR_MODULE_PLUGINS;
mInstanceOwner->SetPluginHost(pluginHost);
if(pluginHost->IsPluginEnabledForType("application/x-oleobject") == NS_OK)
rv = InstantiatePlugin(aPresContext, aMetrics, aReflowState, pluginHost, "application/x-oleobject", fullURL);
@@ -692,6 +698,9 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext,
// get the nsIPluginHost interface
pluginHost = do_GetService(kCPluginManagerCID);
if (!pluginHost)
return NS_ERROR_MODULE_PLUGINS;
mInstanceOwner->SetPluginHost(pluginHost);
mContent->GetTag(atom);
@@ -2489,5 +2498,5 @@ void nsPluginInstanceOwner::SetPluginHost(nsIPluginHost* aHost)
NS_RELEASE(mPluginHost);
mPluginHost = aHost;
NS_ADDREF(mPluginHost);
NS_IF_ADDREF(mPluginHost);
}