2011-07-23 12:50:11 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2011 Jacek Caban for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct nsWineURI nsWineURI;
|
|
|
|
|
|
|
|
/* Keep sync with request_method_strings in nsio.c */
|
|
|
|
typedef enum {
|
|
|
|
METHOD_GET,
|
|
|
|
METHOD_PUT,
|
|
|
|
METHOD_POST
|
|
|
|
} REQUEST_METHOD;
|
|
|
|
|
2014-10-09 16:07:33 +02:00
|
|
|
typedef enum {
|
|
|
|
BOM_NONE,
|
|
|
|
BOM_UTF8,
|
|
|
|
BOM_UTF16
|
|
|
|
} binding_bom_t;
|
|
|
|
|
2011-07-23 12:50:11 +02:00
|
|
|
typedef struct {
|
|
|
|
nsIHttpChannel nsIHttpChannel_iface;
|
|
|
|
nsIUploadChannel nsIUploadChannel_iface;
|
|
|
|
nsIHttpChannelInternal nsIHttpChannelInternal_iface;
|
2021-02-17 14:31:17 +01:00
|
|
|
nsICacheInfoChannel nsICacheInfoChannel_iface;
|
2011-07-23 12:50:11 +02:00
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
nsWineURI *uri;
|
|
|
|
nsIInputStream *post_data_stream;
|
|
|
|
BOOL post_data_contains_headers;
|
|
|
|
nsILoadGroup *load_group;
|
|
|
|
nsIInterfaceRequestor *notif_callback;
|
|
|
|
nsISupports *owner;
|
2014-11-03 12:39:59 +01:00
|
|
|
nsILoadInfo *load_info;
|
2011-07-23 12:50:11 +02:00
|
|
|
nsLoadFlags load_flags;
|
|
|
|
nsIURI *original_uri;
|
|
|
|
nsIURI *referrer;
|
|
|
|
char *content_type;
|
|
|
|
char *charset;
|
2013-01-23 18:44:42 +01:00
|
|
|
UINT32 response_status;
|
2015-07-22 17:34:12 +02:00
|
|
|
char *response_status_text;
|
2011-07-23 12:50:11 +02:00
|
|
|
REQUEST_METHOD request_method;
|
|
|
|
struct list response_headers;
|
|
|
|
struct list request_headers;
|
2015-12-21 14:31:29 +01:00
|
|
|
|
|
|
|
nsChannelBSC *binding;
|
2011-07-23 12:50:11 +02:00
|
|
|
} nsChannel;
|
|
|
|
|
2013-09-26 17:34:49 +02:00
|
|
|
typedef struct {
|
2015-02-02 13:43:49 +01:00
|
|
|
nsIInputStream *post_stream;
|
2013-09-26 17:34:49 +02:00
|
|
|
WCHAR *headers;
|
|
|
|
HGLOBAL post_data;
|
|
|
|
ULONG post_data_len;
|
|
|
|
} request_data_t;
|
|
|
|
|
2011-07-23 12:50:11 +02:00
|
|
|
typedef struct BSCallbackVtbl BSCallbackVtbl;
|
|
|
|
|
|
|
|
struct BSCallback {
|
2017-06-07 16:10:49 +02:00
|
|
|
IBindStatusCallback IBindStatusCallback_iface;
|
|
|
|
IServiceProvider IServiceProvider_iface;
|
|
|
|
IHttpNegotiate2 IHttpNegotiate2_iface;
|
|
|
|
IInternetBindInfo IInternetBindInfo_iface;
|
|
|
|
IBindCallbackRedirect IBindCallbackRedirect_iface;
|
2011-07-23 12:50:11 +02:00
|
|
|
|
|
|
|
const BSCallbackVtbl *vtbl;
|
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
2013-09-26 17:34:49 +02:00
|
|
|
request_data_t request_data;
|
2019-10-21 06:22:36 +02:00
|
|
|
ULONG read;
|
2011-07-23 12:50:11 +02:00
|
|
|
DWORD bindf;
|
2017-06-07 16:10:51 +02:00
|
|
|
DWORD bindinfo_options;
|
2011-07-23 12:50:11 +02:00
|
|
|
BOOL bindinfo_ready;
|
2014-10-09 16:07:33 +02:00
|
|
|
binding_bom_t bom;
|
2011-07-23 12:50:11 +02:00
|
|
|
|
|
|
|
IMoniker *mon;
|
|
|
|
IBinding *binding;
|
|
|
|
|
2012-07-11 13:51:00 +02:00
|
|
|
HTMLInnerWindow *window;
|
2011-07-23 12:50:11 +02:00
|
|
|
|
|
|
|
struct list entry;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct nsProtocolStream nsProtocolStream;
|
|
|
|
|
|
|
|
struct nsChannelBSC {
|
|
|
|
BSCallback bsc;
|
|
|
|
|
|
|
|
nsChannel *nschannel;
|
|
|
|
nsIStreamListener *nslistener;
|
|
|
|
nsISupports *nscontext;
|
|
|
|
BOOL is_js;
|
2012-07-12 14:26:13 +02:00
|
|
|
BOOL is_doc_channel;
|
2012-09-13 12:29:30 +02:00
|
|
|
BOOL response_processed;
|
2011-07-23 12:50:11 +02:00
|
|
|
|
|
|
|
nsProtocolStream *nsstream;
|
|
|
|
};
|
|
|
|
|
2014-10-09 16:08:01 +02:00
|
|
|
struct BSCallbackVtbl {
|
|
|
|
void (*destroy)(BSCallback*);
|
|
|
|
HRESULT (*init_bindinfo)(BSCallback*);
|
|
|
|
HRESULT (*start_binding)(BSCallback*);
|
|
|
|
HRESULT (*stop_binding)(BSCallback*,HRESULT);
|
|
|
|
HRESULT (*read_data)(BSCallback*,IStream*);
|
|
|
|
HRESULT (*on_progress)(BSCallback*,ULONG,LPCWSTR);
|
|
|
|
HRESULT (*on_response)(BSCallback*,DWORD,LPCWSTR);
|
|
|
|
HRESULT (*beginning_transaction)(BSCallback*,WCHAR**);
|
|
|
|
};
|
|
|
|
|
2011-07-23 12:50:11 +02:00
|
|
|
typedef struct {
|
|
|
|
struct list entry;
|
|
|
|
WCHAR *header;
|
|
|
|
WCHAR *data;
|
|
|
|
} http_header_t;
|
|
|
|
|
2012-11-08 18:17:35 +01:00
|
|
|
#define BINDING_NAVIGATED 0x0001
|
|
|
|
#define BINDING_REPLACE 0x0002
|
2012-11-08 18:17:55 +01:00
|
|
|
#define BINDING_FROMHIST 0x0004
|
2012-11-12 12:58:41 +01:00
|
|
|
#define BINDING_REFRESH 0x0008
|
2013-09-27 15:22:30 +02:00
|
|
|
#define BINDING_SUBMIT 0x0010
|
2014-03-04 16:48:31 +01:00
|
|
|
#define BINDING_NOFRAG 0x0020
|
2012-11-08 18:17:35 +01:00
|
|
|
|
2011-07-23 12:50:11 +02:00
|
|
|
HRESULT set_http_header(struct list*,const WCHAR*,int,const WCHAR*,int) DECLSPEC_HIDDEN;
|
|
|
|
HRESULT create_redirect_nschannel(const WCHAR*,nsChannel*,nsChannel**) DECLSPEC_HIDDEN;
|
|
|
|
|
|
|
|
HRESULT hlink_frame_navigate(HTMLDocument*,LPCWSTR,nsChannel*,DWORD,BOOL*) DECLSPEC_HIDDEN;
|
2019-03-08 13:48:11 +01:00
|
|
|
HRESULT create_doc_uri(IUri*,nsWineURI**) DECLSPEC_HIDDEN;
|
2015-02-02 13:43:49 +01:00
|
|
|
HRESULT load_nsuri(HTMLOuterWindow*,nsWineURI*,nsIInputStream*,nsChannelBSC*,DWORD) DECLSPEC_HIDDEN;
|
2013-07-25 14:15:54 +02:00
|
|
|
HRESULT set_moniker(HTMLOuterWindow*,IMoniker*,IUri*,IBindCtx*,nsChannelBSC*,BOOL) DECLSPEC_HIDDEN;
|
2012-11-08 18:17:35 +01:00
|
|
|
void prepare_for_binding(HTMLDocument*,IMoniker*,DWORD) DECLSPEC_HIDDEN;
|
|
|
|
HRESULT super_navigate(HTMLOuterWindow*,IUri*,DWORD,const WCHAR*,BYTE*,DWORD) DECLSPEC_HIDDEN;
|
2012-11-08 18:17:55 +01:00
|
|
|
HRESULT load_uri(HTMLOuterWindow*,IUri*,DWORD) DECLSPEC_HIDDEN;
|
2014-12-16 16:13:05 +01:00
|
|
|
HRESULT navigate_new_window(HTMLOuterWindow*,IUri*,const WCHAR*,request_data_t*,IHTMLWindow2**) DECLSPEC_HIDDEN;
|
2012-11-12 12:57:48 +01:00
|
|
|
HRESULT navigate_url(HTMLOuterWindow*,const WCHAR*,IUri*,DWORD) DECLSPEC_HIDDEN;
|
2014-12-16 16:13:05 +01:00
|
|
|
HRESULT submit_form(HTMLOuterWindow*,const WCHAR*,IUri*,nsIInputStream*) DECLSPEC_HIDDEN;
|
2018-02-26 18:21:11 +01:00
|
|
|
void process_document_response_headers(HTMLDocumentNode*,IBinding*) DECLSPEC_HIDDEN;
|
2011-07-23 12:50:11 +02:00
|
|
|
|
2014-10-09 16:08:01 +02:00
|
|
|
void init_bscallback(BSCallback*,const BSCallbackVtbl*,IMoniker*,DWORD) DECLSPEC_HIDDEN;
|
2012-07-12 14:26:13 +02:00
|
|
|
HRESULT create_channelbsc(IMoniker*,const WCHAR*,BYTE*,DWORD,BOOL,nsChannelBSC**) DECLSPEC_HIDDEN;
|
2013-09-26 17:34:40 +02:00
|
|
|
HRESULT channelbsc_load_stream(HTMLInnerWindow*,IMoniker*,IStream*) DECLSPEC_HIDDEN;
|
2011-07-23 12:50:11 +02:00
|
|
|
void channelbsc_set_channel(nsChannelBSC*,nsChannel*,nsIStreamListener*,nsISupports*) DECLSPEC_HIDDEN;
|
2012-01-02 21:57:22 +01:00
|
|
|
IUri *nsuri_get_uri(nsWineURI*) DECLSPEC_HIDDEN;
|
2012-07-27 10:51:24 +02:00
|
|
|
|
2014-10-09 16:08:01 +02:00
|
|
|
HRESULT read_stream(BSCallback*,IStream*,void*,DWORD,DWORD*) DECLSPEC_HIDDEN;
|
|
|
|
|
2013-03-26 11:37:47 +01:00
|
|
|
HRESULT create_relative_uri(HTMLOuterWindow*,const WCHAR*,IUri**) DECLSPEC_HIDDEN;
|
|
|
|
HRESULT create_uri(const WCHAR*,DWORD,IUri**) DECLSPEC_HIDDEN;
|
2012-11-08 18:16:42 +01:00
|
|
|
IUri *get_uri_nofrag(IUri*) DECLSPEC_HIDDEN;
|
|
|
|
|
2012-11-12 12:57:48 +01:00
|
|
|
void set_current_mon(HTMLOuterWindow*,IMoniker*,DWORD) DECLSPEC_HIDDEN;
|
|
|
|
void set_current_uri(HTMLOuterWindow*,IUri*) DECLSPEC_HIDDEN;
|