mshtml: Added nsINetUtil interface to nsIOService.
This commit is contained in:
parent
aac079a87d
commit
7ea9c7d3e1
|
@ -1701,6 +1701,18 @@ interface nsIIOService : nsISupports
|
|||
nsresult ExtractScheme(const nsACString *urlString, nsACString * _retval);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(f0c5dddb-4713-4603-af2d-bf671838996b),
|
||||
local,
|
||||
/* NOT_FROZEN */
|
||||
]
|
||||
interface nsINetUtil : nsISupports
|
||||
{
|
||||
nsresult ParseContentType(const nsACString *aTypeHeader, nsACString *aCharset,
|
||||
PRBool *aHadCharset, nsACString *aContentType);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(9c5d3c58-1dd1-11b2-a1c9-f3699284657a),
|
||||
|
|
|
@ -1926,21 +1926,7 @@ static nsIProtocolHandler *create_protocol_handler(nsIProtocolHandler *nshandler
|
|||
return NSPROTHANDLER(ret);
|
||||
}
|
||||
|
||||
static nsresult NSAPI nsIOService_QueryInterface(nsIIOService *iface, nsIIDRef riid,
|
||||
nsQIResult result)
|
||||
{
|
||||
*result = NULL;
|
||||
|
||||
if(IsEqualGUID(&IID_nsISupports, riid)
|
||||
|| IsEqualGUID(&IID_nsIIOService, riid)) {
|
||||
*result = iface;
|
||||
nsIIOService_AddRef(iface);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
WARN("(%s %p)\n", debugstr_guid(riid), result);
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
static nsresult NSAPI nsIOService_QueryInterface(nsIIOService*,nsIIDRef,nsQIResult);
|
||||
|
||||
static nsrefcnt NSAPI nsIOService_AddRef(nsIIOService *iface)
|
||||
{
|
||||
|
@ -2198,6 +2184,72 @@ static const nsIIOServiceVtbl nsIOServiceVtbl = {
|
|||
|
||||
static nsIIOService nsIOService = { &nsIOServiceVtbl };
|
||||
|
||||
static nsresult NSAPI nsNetUtil_QueryInterface(nsINetUtil *iface, nsIIDRef riid,
|
||||
nsQIResult result)
|
||||
{
|
||||
return nsIIOService_QueryInterface(&nsIOService, riid, result);
|
||||
}
|
||||
|
||||
static nsrefcnt NSAPI nsNetUtil_AddRef(nsINetUtil *iface)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
static nsrefcnt NSAPI nsNetUtil_Release(nsINetUtil *iface)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static nsresult NSAPI nsNetUtil_ParseContentType(nsINetUtil *iface, const nsACString *aTypeHeader,
|
||||
nsACString *aCharset, PRBool *aHadCharset, nsACString *aContentType)
|
||||
{
|
||||
nsINetUtil *net_util;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p %p %p %p)\n", aTypeHeader, aCharset, aHadCharset, aContentType);
|
||||
|
||||
nsres = nsIIOService_QueryInterface(nsio, &IID_nsINetUtil, (void**)&net_util);
|
||||
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 = {
|
||||
nsNetUtil_QueryInterface,
|
||||
nsNetUtil_AddRef,
|
||||
nsNetUtil_Release,
|
||||
nsNetUtil_ParseContentType
|
||||
};
|
||||
|
||||
static nsINetUtil nsNetUtil = { &nsNetUtilVtbl };
|
||||
|
||||
static nsresult NSAPI nsIOService_QueryInterface(nsIIOService *iface, nsIIDRef riid,
|
||||
nsQIResult result)
|
||||
{
|
||||
*result = NULL;
|
||||
|
||||
if(IsEqualGUID(&IID_nsISupports, riid))
|
||||
*result = &nsIOService;
|
||||
else if(IsEqualGUID(&IID_nsIIOService, riid))
|
||||
*result = &nsIOService;
|
||||
else if(IsEqualGUID(&IID_nsINetUtil, riid))
|
||||
*result = &nsNetUtil;
|
||||
|
||||
if(*result) {
|
||||
nsISupports_AddRef((nsISupports*)*result);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
FIXME("(%s %p)\n", debugstr_guid(riid), result);
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
static nsresult NSAPI nsIOServiceFactory_QueryInterface(nsIFactory *iface, nsIIDRef riid,
|
||||
nsQIResult result)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue