nsresult rv = NS_ERROR_FAILURE;
nsresult status = NS_ERROR_FAILURE;
nsLayoutDLF::CreateInstance(nsIURI* aURL,                             const char* aContentType,                             const char *aCommand,                            nsIContentViewerContainer* aContainer,                            nsISupports* aExtraInfo,                            nsIStreamListener** aDocListener,                            nsIContentViewer** aDocViewer){  nsresult rv = NS_ERROR_FAILURE;  // XXX vile hack  if(0==PL_strcmp(aCommand,"view-source")) {    if((0==PL_strcmp(gXMLTypes[0],aContentType)) ||       (0==PL_strcmp(gRDFTypes[0],aContentType)) ||       (0==PL_strcmp(gRDFTypes[1],aContentType))) {      aContentType=gHTMLTypes[0];    }  }  // Try html  int typeIndex=0;  while(gHTMLTypes[typeIndex]) {    if (0== PL_strcmp(gHTMLTypes[typeIndex++], aContentType)) {      return CreateDocument(aURL, aCommand, aContainer, kHTMLDocumentCID,                            aDocListener, aDocViewer);    }  }  // Try XML  typeIndex = 0;  while(gXMLTypes[typeIndex]) {    if (0== PL_strcmp(gXMLTypes[typeIndex++], aContentType)) {      return CreateDocument(aURL, aCommand, aContainer, kXMLDocumentCID,                            aDocListener, aDocViewer);    }  }  // Try RDF  typeIndex = 0;  while (gRDFTypes[typeIndex]) {    if (0 == PL_strcmp(gRDFTypes[typeIndex++], aContentType)) {      return CreateRDFDocument(aContentType, aURL, aCommand, aContainer,                               aExtraInfo, aDocListener, aDocViewer);    }  }  // Try image types  typeIndex = 0;  while(gImageTypes[typeIndex]) {    if (0== PL_strcmp(gImageTypes[typeIndex++], aContentType)) {      return CreateDocument(aURL, aCommand, aContainer, kImageDocumentCID,                            aDocListener, aDocViewer);    }  }  // Try plugin types  typeIndex = 0;  while(gPluginTypes[typeIndex]) {    if (0== PL_strcmp(gPluginTypes[typeIndex++], aContentType)) {      return NS_NewPluginContentViewer(aCommand, aDocListener, aDocViewer);    }  }  return rv;}