Commit a29101b0 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

mshtml: COM cleanup for the nsIHttpChannel iface.

parent 6c075b6d
...@@ -483,7 +483,7 @@ typedef enum { ...@@ -483,7 +483,7 @@ typedef enum {
} REQUEST_METHOD; } REQUEST_METHOD;
typedef struct { typedef struct {
const nsIHttpChannelVtbl *lpHttpChannelVtbl; nsIHttpChannel nsIHttpChannel_iface;
const nsIUploadChannelVtbl *lpUploadChannelVtbl; const nsIUploadChannelVtbl *lpUploadChannelVtbl;
const nsIHttpChannelInternalVtbl *lpIHttpChannelInternalVtbl; const nsIHttpChannelInternalVtbl *lpIHttpChannelInternalVtbl;
...@@ -633,8 +633,6 @@ struct HTMLDocumentNode { ...@@ -633,8 +633,6 @@ struct HTMLDocumentNode {
#define NSRUNNABLE(x) ((nsIRunnable*) &(x)->lpIRunnableVtbl) #define NSRUNNABLE(x) ((nsIRunnable*) &(x)->lpIRunnableVtbl)
#define NSCHANNEL(x) ((nsIChannel*) &(x)->lpHttpChannelVtbl)
#define NSHTTPCHANNEL(x) ((nsIHttpChannel*) &(x)->lpHttpChannelVtbl)
#define NSUPCHANNEL(x) ((nsIUploadChannel*) &(x)->lpUploadChannelVtbl) #define NSUPCHANNEL(x) ((nsIUploadChannel*) &(x)->lpUploadChannelVtbl)
#define NSHTTPINTERNAL(x) ((nsIHttpChannelInternal*) &(x)->lpIHttpChannelInternalVtbl) #define NSHTTPINTERNAL(x) ((nsIHttpChannelInternal*) &(x)->lpIHttpChannelInternalVtbl)
......
...@@ -903,7 +903,7 @@ static HRESULT on_start_nsrequest(nsChannelBSC *This) ...@@ -903,7 +903,7 @@ static HRESULT on_start_nsrequest(nsChannelBSC *This)
This->nschannel->response_status = 200; This->nschannel->response_status = 200;
nsres = nsIStreamListener_OnStartRequest(This->nslistener, nsres = nsIStreamListener_OnStartRequest(This->nslistener,
(nsIRequest*)NSCHANNEL(This->nschannel), This->nscontext); (nsIRequest*)&This->nschannel->nsIHttpChannel_iface, This->nscontext);
if(NS_FAILED(nsres)) { if(NS_FAILED(nsres)) {
FIXME("OnStartRequest failed: %08x\n", nsres); FIXME("OnStartRequest failed: %08x\n", nsres);
return E_FAIL; return E_FAIL;
...@@ -942,14 +942,15 @@ static void on_stop_nsrequest(nsChannelBSC *This, HRESULT result) ...@@ -942,14 +942,15 @@ static void on_stop_nsrequest(nsChannelBSC *This, HRESULT result)
if(This->nslistener) { if(This->nslistener) {
nsres = nsIStreamListener_OnStopRequest(This->nslistener, nsres = nsIStreamListener_OnStopRequest(This->nslistener,
(nsIRequest*)NSCHANNEL(This->nschannel), This->nscontext, request_result); (nsIRequest*)&This->nschannel->nsIHttpChannel_iface, This->nscontext,
request_result);
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
WARN("OnStopRequet failed: %08x\n", nsres); WARN("OnStopRequet failed: %08x\n", nsres);
} }
if(This->nschannel->load_group) { if(This->nschannel->load_group) {
nsres = nsILoadGroup_RemoveRequest(This->nschannel->load_group, nsres = nsILoadGroup_RemoveRequest(This->nschannel->load_group,
(nsIRequest*)NSCHANNEL(This->nschannel), NULL, request_result); (nsIRequest*)&This->nschannel->nsIHttpChannel_iface, NULL, request_result);
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
ERR("RemoveRequest failed: %08x\n", nsres); ERR("RemoveRequest failed: %08x\n", nsres);
} }
...@@ -1011,7 +1012,7 @@ static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream) ...@@ -1011,7 +1012,7 @@ static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
This->bsc.readed += This->nsstream->buf_size; This->bsc.readed += This->nsstream->buf_size;
nsres = nsIStreamListener_OnDataAvailable(This->nslistener, nsres = nsIStreamListener_OnDataAvailable(This->nslistener,
(nsIRequest*)NSCHANNEL(This->nschannel), This->nscontext, (nsIRequest*)&This->nschannel->nsIHttpChannel_iface, This->nscontext,
NSINSTREAM(This->nsstream), This->bsc.readed-This->nsstream->buf_size, NSINSTREAM(This->nsstream), This->bsc.readed-This->nsstream->buf_size,
This->nsstream->buf_size); This->nsstream->buf_size);
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
...@@ -1033,7 +1034,7 @@ static void nsChannelBSC_destroy(BSCallback *bsc) ...@@ -1033,7 +1034,7 @@ static void nsChannelBSC_destroy(BSCallback *bsc)
nsChannelBSC *This = NSCHANNELBSC_THIS(bsc); nsChannelBSC *This = NSCHANNELBSC_THIS(bsc);
if(This->nschannel) if(This->nschannel)
nsIChannel_Release(NSCHANNEL(This->nschannel)); nsIChannel_Release(&This->nschannel->nsIHttpChannel_iface);
if(This->nslistener) if(This->nslistener)
nsIStreamListener_Release(This->nslistener); nsIStreamListener_Release(This->nslistener);
if(This->nscontext) if(This->nscontext)
...@@ -1356,7 +1357,7 @@ HRESULT channelbsc_load_stream(nsChannelBSC *bscallback, IStream *stream) ...@@ -1356,7 +1357,7 @@ HRESULT channelbsc_load_stream(nsChannelBSC *bscallback, IStream *stream)
void channelbsc_set_channel(nsChannelBSC *This, nsChannel *channel, nsIStreamListener *listener, nsISupports *context) void channelbsc_set_channel(nsChannelBSC *This, nsChannel *channel, nsIStreamListener *listener, nsISupports *context)
{ {
nsIChannel_AddRef(NSCHANNEL(channel)); nsIChannel_AddRef(&channel->nsIHttpChannel_iface);
This->nschannel = channel; This->nschannel = channel;
nsIStreamListener_AddRef(listener); nsIStreamListener_AddRef(listener);
......
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