nsCAutoString type; rv = GetMIMEType(type);  if (NS_FAILED(rv)) return NS_OK;
PRBool bImage = PR_FALSE;
nsObjectFrame::Init(nsPresContext*   aPresContext,                    nsIContent*      aContent,                    nsIFrame*        aParent,                    nsStyleContext*  aContext,                    nsIFrame*        aPrevInFlow){  mIsBrokenPlugin = PR_FALSE;  if (sDefaultPluginDisabled == (PRBool)0xffffffff) {    sDefaultPluginDisabled =      nsContentUtils::GetBoolPref("plugin.default_plugin_disabled");  }  nsresult rv = nsObjectFrameSuper::Init(aPresContext, aContent, aParent,                                         aContext, aPrevInFlow);  if (NS_FAILED(rv))    return rv;  // Find our content type  nsCAutoString type;  rv = GetMIMEType(type);  // If that fails, just return and render nothing.  if (NS_FAILED(rv))    return NS_OK;  // Ideally this should move to Reflow when the stream starts to come  if (IsSupportedImage(type)) {    // kick off the image load in the content node    // XXX once this moves to somewhere where we have the data stream,    // we should have a way to load images with a channel....    nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(aContent);    if (!imageLoader) {      NS_ERROR("Not an image loading content?");      return NS_ERROR_UNEXPECTED;    }    nsAutoString data;    // If this is an OBJECT tag, we should look for a DATA attribute.    // If not, it's an EMBED tag, and so we should look for a SRC attribute.    if (aContent->Tag() == nsHTMLAtoms::object)      rv = aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::data, data);    else      rv = aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::src, data);    imageLoader->ImageURIChanged(data);    nsIFrame * aNewFrame = nsnull;    rv = NS_NewImageFrame(aPresContext->PresShell(), &aNewFrame);    if (NS_FAILED(rv))      return rv;    // XXX we're using the same style context for ourselves and the    // image frame.  If this ever changes, please fix HandleChild() to deal.    rv = aNewFrame->Init(aPresContext, aContent, this, aContext, aPrevInFlow);    if (NS_SUCCEEDED(rv)) {      nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, nsnull, PR_FALSE);      mFrames.AppendFrame(this, aNewFrame);    }    else      aNewFrame->Destroy(aPresContext);    return rv; // bail at this point  }  // for now, we should try to do the same for "document" types and  // create an iframe-like sub-frame  if (IsSupportedDocument(aContent, type)) {    nsIFrame * aNewFrame = nsnull;    rv = NS_NewSubDocumentFrame(aPresContext->PresShell(), &aNewFrame);    if (NS_FAILED(rv))      return rv;        // XXX we're using the same style context for ourselves and the    // iframe.  If this ever changes, please fix HandleChild() to deal.    rv = aNewFrame->Init(aPresContext, aContent, this, aContext, aPrevInFlow);    if (NS_SUCCEEDED(rv)) {      nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, nsnull, PR_FALSE);      mFrames.AppendFrame(this, aNewFrame);    } else {      aNewFrame->Destroy(aPresContext);    }  }  return rv;}