added stream converter functionality to the doc loader. also initialize/register the multipartmixedreplace stream converter in the webshell

git-svn-id: svn://10.0.0.236/trunk@45046 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
valeski%netscape.com
1999-08-29 14:31:08 +00:00
parent 6ebdbfafb5
commit 09be5128d6
4 changed files with 170 additions and 0 deletions

View File

@@ -68,6 +68,13 @@
#include "prmem.h"
#include "nsXPIDLString.h"
#ifndef XP_MAC
#include "nsMultiMixedConv.h" // for
#include "nsIRegistry.h"
static NS_DEFINE_CID(kRegistryCID, NS_REGISTRY_CID);
#endif // XP_MAC
#ifdef XP_PC
#include <windows.h>
#endif
@@ -1172,6 +1179,39 @@ nsWebShell::Init(nsNativeWidget aNativeParent,
widgetInit.mWindowType = eWindowType_child;
}
// STREAM CONVERTER REGISTRATION
// multipart mixed converter registration
#ifndef XP_MAC
nsIFactory *multiMixedFactSup;
rv = nsComponentManager::FindFactory(kMultiMixedConverterCID, &multiMixedFactSup);
if (SUCCEEDED(rv)) {
rv = nsComponentManager::RegisterFactory(kMultiMixedConverterCID,
"MultiMixedConverter",
NS_ISTREAMCONVERTER_KEY "?from=multipart/x-mixed-replace?to=text/html",
multiMixedFactSup,
PR_TRUE);
if (NS_FAILED(rv)) goto done;
nsIRegistry *registry;
rv = nsServiceManager::GetService(kRegistryCID, NS_GET_IID(nsIRegistry), (nsISupports**) &registry);
if (NS_FAILED(rv)) goto done;
// open the registry
rv = registry->OpenWellKnownRegistry(nsIRegistry::ApplicationComponentRegistry);
if (NS_FAILED(rv)) goto done;
// set the key
nsIRegistry::Key key, key1;
rv = registry->AddSubtree(nsIRegistry::Common, NS_ISTREAMCONVERTER_KEY, &key);
if (NS_FAILED(rv)) goto done;
rv = registry->AddSubtreeRaw(key, "?from=multipart/x-mixed-replace?to=text/html", &key1);
if (NS_FAILED(rv)) goto done;
}
#endif // XP_MAC
// END STREAM CONVERTER REGISTRATION
done:
return rv;
}