Commit 56bb0286 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Use mime type reported by moniker if possible.

parent 42f96fce
......@@ -129,6 +129,7 @@ typedef struct {
nsIInterfaceRequestor *notif_callback;
nsLoadFlags load_flags;
nsIURI *original_uri;
char *content;
} nsChannel;
typedef struct {
......
......@@ -268,8 +268,24 @@ static HRESULT WINAPI BindStatusCallback_OnProgress(IBindStatusCallback *iface,
ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
{
BSCallback *This = STATUSCLB_THIS(iface);
TRACE("%p)->(%lu %lu %lu %s)\n", This, ulProgress, ulProgressMax, ulStatusCode,
debugstr_w(szStatusText));
switch(ulStatusCode) {
case BINDSTATUS_MIMETYPEAVAILABLE: {
int len;
if(!This->nschannel)
return S_OK;
HeapFree(GetProcessHeap(), 0, This->nschannel->content);
len = WideCharToMultiByte(CP_ACP, 0, szStatusText, -1, NULL, 0, NULL, NULL);
This->nschannel->content = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
WideCharToMultiByte(CP_ACP, 0, szStatusText, -1, This->nschannel->content, -1, NULL, NULL);
}
}
return S_OK;
}
......
......@@ -213,6 +213,7 @@ static nsrefcnt NSAPI nsChannel_Release(nsIHttpChannel *iface)
nsIInterfaceRequestor_Release(This->notif_callback);
if(This->original_uri)
nsIURI_Release(This->original_uri);
HeapFree(GetProcessHeap(), 0, This->content);
HeapFree(GetProcessHeap(), 0, This);
}
......@@ -465,6 +466,11 @@ static nsresult NSAPI nsChannel_GetContentType(nsIHttpChannel *iface, nsACString
TRACE("(%p)->(%p)\n", This, aContentType);
if(This->content) {
nsACString_Init(aContentType, This->content);
return S_OK;
}
if(This->channel)
return nsIChannel_GetContentType(This->channel, aContentType);
......@@ -1450,6 +1456,7 @@ static nsresult NSAPI nsIOService_NewChannelFromURI(nsIIOService *iface, nsIURI
ret->load_group = NULL;
ret->notif_callback = NULL;
ret->load_flags = 0;
ret->content = NULL;
nsIURI_AddRef(aURI);
ret->original_uri = aURI;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment