rv = obsoleteManager->RegisterComponentWithType(kDocumentFactoryImplCID, "Layout", contractid, aPath, aLocation, PR_TRUE, PR_TRUE, aType);
rv = registrar->RegisterFactoryLocation(kDocumentFactoryImplCID, "Layout", contractid, aPath, aLocation, aType);
RegisterTypes(nsIComponentManager* aCompMgr,              nsICategoryManager* aCatMgr,              const char* aCommand,              nsIFile* aPath,              const char *aLocation,              const char *aType,              const char* const* aTypes){  nsresult rv = NS_OK;  while (*aTypes) {    char contractid[500];    const char* contentType = *aTypes++;    PR_snprintf(contractid, sizeof(contractid),                NS_DOCUMENT_LOADER_FACTORY_CONTRACTID_PREFIX "%s;1?type=%s",                aCommand, contentType);#ifdef NOISY_REGISTRY    printf("Register %s => %s\n", contractid, aPath);#endif    // what I want to do here is QI for a Component Registration Manager.  Since this     // has not been invented yet, QI to the obsolete manager.  Kids, don't do this at home.    nsCOMPtr<nsIComponentManagerObsolete> obsoleteManager = do_QueryInterface(aCompMgr, &rv);    if (NS_FAILED(rv))      return rv;    rv = obsoleteManager->RegisterComponentWithType(kDocumentFactoryImplCID, "Layout",                                                    contractid, aPath, aLocation,                                                    PR_TRUE, PR_TRUE, aType);    if (NS_FAILED(rv)) break;    // add the MIME types layotu can handle to the handlers category.    // this allows users of layout's viewers (the docshell for example)    // to query the types of viewers layout can create.    nsXPIDLCString previous;    rv = aCatMgr->AddCategoryEntry("Gecko-Content-Viewers", contentType,			                    contractid,                                PR_TRUE, PR_TRUE, getter_Copies(previous));    if (NS_FAILED(rv)) break;  }  return rv;}