mshtml: Use stored nsINetUtil interface.
This commit is contained in:
parent
297716e01c
commit
d356d15225
|
@ -500,6 +500,7 @@ BOOL load_gecko(BOOL);
|
||||||
void close_gecko(void);
|
void close_gecko(void);
|
||||||
void register_nsservice(nsIComponentRegistrar*,nsIServiceManager*);
|
void register_nsservice(nsIComponentRegistrar*,nsIServiceManager*);
|
||||||
void init_nsio(nsIComponentManager*,nsIComponentRegistrar*);
|
void init_nsio(nsIComponentManager*,nsIComponentRegistrar*);
|
||||||
|
void release_nsio(void);
|
||||||
BOOL install_wine_gecko(BOOL);
|
BOOL install_wine_gecko(BOOL);
|
||||||
|
|
||||||
HRESULT nsuri_to_url(LPCWSTR,BSTR*);
|
HRESULT nsuri_to_url(LPCWSTR,BSTR*);
|
||||||
|
|
|
@ -865,6 +865,8 @@ void close_gecko(void)
|
||||||
{
|
{
|
||||||
TRACE("()\n");
|
TRACE("()\n");
|
||||||
|
|
||||||
|
release_nsio();
|
||||||
|
|
||||||
if(pCompMgr)
|
if(pCompMgr)
|
||||||
nsIComponentManager_Release(pCompMgr);
|
nsIComponentManager_Release(pCompMgr);
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ static const IID NS_IOSERVICE_CID =
|
||||||
{0x9ac9e770, 0x18bc, 0x11d3, {0x93, 0x37, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40}};
|
{0x9ac9e770, 0x18bc, 0x11d3, {0x93, 0x37, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40}};
|
||||||
|
|
||||||
static nsIIOService *nsio = NULL;
|
static nsIIOService *nsio = NULL;
|
||||||
|
static nsINetUtil *net_util;
|
||||||
|
|
||||||
static const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
|
static const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
|
||||||
|
|
||||||
|
@ -2260,21 +2261,9 @@ static nsrefcnt NSAPI nsNetUtil_Release(nsINetUtil *iface)
|
||||||
static nsresult NSAPI nsNetUtil_ParseContentType(nsINetUtil *iface, const nsACString *aTypeHeader,
|
static nsresult NSAPI nsNetUtil_ParseContentType(nsINetUtil *iface, const nsACString *aTypeHeader,
|
||||||
nsACString *aCharset, PRBool *aHadCharset, nsACString *aContentType)
|
nsACString *aCharset, PRBool *aHadCharset, nsACString *aContentType)
|
||||||
{
|
{
|
||||||
nsINetUtil *net_util;
|
|
||||||
nsresult nsres;
|
|
||||||
|
|
||||||
TRACE("(%p %p %p %p)\n", aTypeHeader, aCharset, aHadCharset, aContentType);
|
TRACE("(%p %p %p %p)\n", aTypeHeader, aCharset, aHadCharset, aContentType);
|
||||||
|
|
||||||
nsres = nsIIOService_QueryInterface(nsio, &IID_nsINetUtil, (void**)&net_util);
|
return nsINetUtil_ParseContentType(net_util, aTypeHeader, aCharset, aHadCharset, aContentType);
|
||||||
if(NS_FAILED(nsres)) {
|
|
||||||
WARN("Could not get nsINetUtil interface: %08x\n", nsres);
|
|
||||||
return nsres;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsres = nsINetUtil_ParseContentType(net_util, aTypeHeader, aCharset, aHadCharset, aContentType);
|
|
||||||
|
|
||||||
nsINetUtil_Release(net_util);
|
|
||||||
return nsres;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const nsINetUtilVtbl nsNetUtilVtbl = {
|
static const nsINetUtilVtbl nsNetUtilVtbl = {
|
||||||
|
@ -2380,6 +2369,13 @@ void init_nsio(nsIComponentManager *component_manager, nsIComponentRegistrar *re
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsres = nsIIOService_QueryInterface(nsio, &IID_nsINetUtil, (void**)&net_util);
|
||||||
|
if(NS_FAILED(nsres)) {
|
||||||
|
WARN("Could not get nsINetUtil interface: %08x\n", nsres);
|
||||||
|
nsIIOService_Release(nsio);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
nsres = nsIComponentRegistrar_UnregisterFactory(registrar, &NS_IOSERVICE_CID, old_factory);
|
nsres = nsIComponentRegistrar_UnregisterFactory(registrar, &NS_IOSERVICE_CID, old_factory);
|
||||||
nsIFactory_Release(old_factory);
|
nsIFactory_Release(old_factory);
|
||||||
if(NS_FAILED(nsres))
|
if(NS_FAILED(nsres))
|
||||||
|
@ -2390,3 +2386,16 @@ void init_nsio(nsIComponentManager *component_manager, nsIComponentRegistrar *re
|
||||||
if(NS_FAILED(nsres))
|
if(NS_FAILED(nsres))
|
||||||
ERR("RegisterFactory failed: %08x\n", nsres);
|
ERR("RegisterFactory failed: %08x\n", nsres);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void release_nsio(void)
|
||||||
|
{
|
||||||
|
if(net_util) {
|
||||||
|
nsINetUtil_Release(net_util);
|
||||||
|
net_util = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(nsio) {
|
||||||
|
nsIIOService_Release(nsio);
|
||||||
|
nsio = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue