Commit f1d2e376 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Set binding channel, listener and context in AsyncOpen.

parent e0157ba2
......@@ -115,6 +115,22 @@ struct NSContainer {
BSCallback *bscallback; /* hack */
};
typedef struct {
const nsIHttpChannelVtbl *lpHttpChannelVtbl;
const nsIUploadChannelVtbl *lpUploadChannelVtbl;
LONG ref;
nsIChannel *channel;
nsIHttpChannel *http_channel;
nsIWineURI *uri;
nsIInputStream *post_data_stream;
nsILoadGroup *load_group;
nsIInterfaceRequestor *notif_callback;
nsLoadFlags load_flags;
nsIURI *original_uri;
} nsChannel;
struct BSCallback {
const IBindStatusCallbackVtbl *lpBindStatusCallbackVtbl;
const IServiceProviderVtbl *lpServiceProviderVtbl;
......@@ -126,6 +142,10 @@ struct BSCallback {
LPWSTR headers;
HGLOBAL post_data;
ULONG post_data_len;
nsChannel *nschannel;
nsIStreamListener *nslistener;
nsISupports *nscontext;
};
struct HTMLDOMNode {
......@@ -185,7 +205,6 @@ typedef struct {
#define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
#define CMDTARGET(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
#define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
#define STATUSCLB(x) ((IBindStatusCallback*) &(x)->lpBindStatusCallbackVtbl)
#define HLNKTARGET(x) ((IHlinkTarget*) &(x)->lpHlinkTargetVtbl)
#define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
#define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
......@@ -199,10 +218,14 @@ typedef struct {
#define NSWEAKREF(x) ((nsIWeakReference*) &(x)->lpWeakReferenceVtbl)
#define NSSUPWEAKREF(x) ((nsISupportsWeakReference*) &(x)->lpSupportsWeakReferenceVtbl)
#define NSCHANNEL(x) ((nsIChannel*) &(x)->lpHttpChannelVtbl)
#define NSHTTPCHANNEL(x) ((nsIHttpChannel*) &(x)->lpHttpChannelVtbl)
#define NSUPCHANNEL(x) ((nsIUploadChannel*) &(x)->lpUploadChannelVtbl)
#define HTTPNEG(x) ((IHttpNegotiate2*) &(x)->lpHttpNegotiate2Vtbl)
#define STATUSCLB(x) ((IBindStatusCallback*) &(x)->lpBindStatusCallbackVtbl)
#define BINDINFO(x) ((IInternetBindInfo*) &(x)->lpInternetBindInfoVtbl);
#define HTMLELEM(x) ((IHTMLElement*) &(x)->lpHTMLElementVtbl)
#define HTMLELEM2(x) ((IHTMLElement2*) &(x)->lpHTMLElement2Vtbl)
#define HTMLDOMNODE(x) ((IHTMLDOMNode*) &(x)->lpHTMLDOMNodeVtbl)
......@@ -253,7 +276,9 @@ PRUint32 nsAString_GetData(const nsAString*,const PRUnichar**,PRBool*);
void nsAString_Finish(nsAString*);
nsIInputStream *create_nsstream(const char*,PRInt32);
BSCallback *create_bscallback(HTMLDocument*,LPCOLESTR);
HRESULT start_binding(BSCallback*,IMoniker*);
IHlink *Hlink_Create(void);
......
......@@ -96,6 +96,12 @@ static ULONG WINAPI BindStatusCallback_Release(IBindStatusCallback *iface)
if(!ref) {
if(This->post_data)
GlobalFree(This->post_data);
if(This->nschannel)
nsIChannel_Release(NSCHANNEL(This->nschannel));
if(This->nslistener)
nsIStreamListener_Release(This->nslistener);
if(This->nscontext)
nsISupports_Release(This->nscontext);
HeapFree(GetProcessHeap(), 0, This->headers);
HeapFree(GetProcessHeap(), 0, This);
}
......@@ -371,6 +377,9 @@ BSCallback *create_bscallback(HTMLDocument *doc, LPCOLESTR url)
ret->post_data = NULL;
ret->headers = NULL;
ret->post_data_len = 0;
ret->nschannel = NULL;
ret->nslistener = NULL;
ret->nscontext = NULL;
return ret;
}
......
......@@ -87,9 +87,7 @@ typedef nsISupports nsIWidget;
typedef nsISupports nsIProtocolHandler;
typedef nsISupports nsIDOMEventTarget;
typedef nsISupports nsIDOMAbstractView;
typedef nsISupports nsIStreamListener;
typedef nsISupports nsIHttpHeaderVisitor;
typedef nsISupports nsIRequestObserver;
typedef nsISupports nsIDOMBarProp;
typedef nsISupports nsIDOMWindowCollection;
typedef nsISupports nsISelection;
......@@ -275,6 +273,26 @@ interface nsIRequest : nsISupports
[
object,
uuid(fd91e2e0-1481-11d3-9333-00104ba0fd40)
]
interface nsIRequestObserver : nsISupports
{
nsresult OnStartRequest(nsIRequest *aRequest, nsISupports *aContext);
nsresult OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode);
}
[
object,
uuid(1a637020-1482-11d3-9333-00104ba0fd40)
]
interface nsIStreamListener : nsIRequestObserver
{
nsresult OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext,
nsIInputStream *aInputStream, PRUint32 aOffset, PRUint32 aCount);
}
[
object,
uuid(3de0a31c-feaf-400f-9f1e-4ef71f8b20cc)
]
interface nsILoadGroup : nsIRequest
......
......@@ -46,22 +46,6 @@ static const IID NS_IOSERVICE_CID =
static nsIIOService *nsio = NULL;
typedef struct {
const nsIHttpChannelVtbl *lpHttpChannelVtbl;
const nsIUploadChannelVtbl *lpUploadChannelVtbl;
LONG ref;
nsIChannel *channel;
nsIHttpChannel *http_channel;
nsIWineURI *uri;
nsIInputStream *post_data_stream;
nsILoadGroup *load_group;
nsIInterfaceRequestor *notif_callback;
nsLoadFlags load_flags;
nsIURI *original_uri;
} nsChannel;
typedef struct {
const nsIWineURIVtbl *lpWineURIVtbl;
LONG ref;
......@@ -70,9 +54,6 @@ typedef struct {
NSContainer *container;
} nsURI;
#define NSCHANNEL(x) ((nsIChannel*) &(x)->lpHttpChannelVtbl)
#define NSHTTPCHANNEL(x) ((nsIHttpChannel*) &(x)->lpHttpChannelVtbl)
#define NSUPCHANNEL(x) ((nsIUploadChannel*) &(x)->lpUploadChannelVtbl)
#define NSURI(x) ((nsIURI*) &(x)->lpWineURIVtbl)
static nsresult create_uri(nsIURI*,NSContainer*,nsIURI**);
......@@ -590,6 +571,17 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
}
if(container->bscallback) {
nsIChannel_AddRef(NSCHANNEL(This));
container->bscallback->nschannel = This;
nsIStreamListener_AddRef(aListener);
container->bscallback->nslistener = aListener;
if(aContext) {
nsISupports_AddRef(aContext);
container->bscallback->nscontext = aContext;
}
nsIWebBrowserChrome_Release(NSWBCHROME(container));
}else {
BOOL cont = before_async_open(This, container);
......
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