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

mshtml: Store scheme in nsWineURI instead of nsChannel.

parent 4870355a
...@@ -47,7 +47,6 @@ typedef struct { ...@@ -47,7 +47,6 @@ typedef struct {
REQUEST_METHOD request_method; REQUEST_METHOD request_method;
struct list response_headers; struct list response_headers;
struct list request_headers; struct list request_headers;
UINT url_scheme;
} nsChannel; } nsChannel;
typedef struct BSCallbackVtbl BSCallbackVtbl; typedef struct BSCallbackVtbl BSCallbackVtbl;
......
...@@ -65,6 +65,7 @@ struct nsWineURI { ...@@ -65,6 +65,7 @@ struct nsWineURI {
IUriBuilder *uri_builder; IUriBuilder *uri_builder;
BOOL is_doc_uri; BOOL is_doc_uri;
BOOL is_mutable; BOOL is_mutable;
DWORD scheme;
}; };
static BOOL ensure_uri(nsWineURI *This) static BOOL ensure_uri(nsWineURI *This)
...@@ -321,7 +322,7 @@ static void set_uri_window(nsWineURI *This, HTMLOuterWindow *window) ...@@ -321,7 +322,7 @@ static void set_uri_window(nsWineURI *This, HTMLOuterWindow *window)
static inline BOOL is_http_channel(nsChannel *This) static inline BOOL is_http_channel(nsChannel *This)
{ {
return This->url_scheme == URL_SCHEME_HTTP || This->url_scheme == URL_SCHEME_HTTPS; return This->uri->scheme == URL_SCHEME_HTTP || This->uri->scheme == URL_SCHEME_HTTPS;
} }
static http_header_t *find_http_header(struct list *headers, const WCHAR *name, int len) static http_header_t *find_http_header(struct list *headers, const WCHAR *name, int len)
...@@ -2814,6 +2815,7 @@ static const nsIStandardURLVtbl nsStandardURLVtbl = { ...@@ -2814,6 +2815,7 @@ static const nsIStandardURLVtbl nsStandardURLVtbl = {
static nsresult create_nsuri(IUri *iuri, HTMLOuterWindow *window, NSContainer *container, nsWineURI **_retval) static nsresult create_nsuri(IUri *iuri, HTMLOuterWindow *window, NSContainer *container, nsWineURI **_retval)
{ {
nsWineURI *ret = heap_alloc_zero(sizeof(nsWineURI)); nsWineURI *ret = heap_alloc_zero(sizeof(nsWineURI));
HRESULT hres;
ret->nsIURL_iface.lpVtbl = &nsURLVtbl; ret->nsIURL_iface.lpVtbl = &nsURLVtbl;
ret->nsIStandardURL_iface.lpVtbl = &nsStandardURLVtbl; ret->nsIStandardURL_iface.lpVtbl = &nsStandardURLVtbl;
...@@ -2826,6 +2828,10 @@ static nsresult create_nsuri(IUri *iuri, HTMLOuterWindow *window, NSContainer *c ...@@ -2826,6 +2828,10 @@ static nsresult create_nsuri(IUri *iuri, HTMLOuterWindow *window, NSContainer *c
IUri_AddRef(iuri); IUri_AddRef(iuri);
ret->uri = iuri; ret->uri = iuri;
hres = IUri_GetScheme(iuri, &ret->scheme);
if(FAILED(hres))
ret->scheme = URL_SCHEME_UNKNOWN;
TRACE("retval=%p\n", ret); TRACE("retval=%p\n", ret);
*_retval = ret; *_retval = ret;
return NS_OK; return NS_OK;
...@@ -2856,7 +2862,6 @@ HRESULT create_doc_uri(HTMLOuterWindow *window, WCHAR *url, nsWineURI **ret) ...@@ -2856,7 +2862,6 @@ HRESULT create_doc_uri(HTMLOuterWindow *window, WCHAR *url, nsWineURI **ret)
static nsresult create_nschannel(nsWineURI *uri, nsChannel **ret) static nsresult create_nschannel(nsWineURI *uri, nsChannel **ret)
{ {
nsChannel *channel; nsChannel *channel;
HRESULT hres;
if(!ensure_uri(uri)) if(!ensure_uri(uri))
return NS_ERROR_UNEXPECTED; return NS_ERROR_UNEXPECTED;
...@@ -2876,10 +2881,6 @@ static nsresult create_nschannel(nsWineURI *uri, nsChannel **ret) ...@@ -2876,10 +2881,6 @@ static nsresult create_nschannel(nsWineURI *uri, nsChannel **ret)
nsIURL_AddRef(&uri->nsIURL_iface); nsIURL_AddRef(&uri->nsIURL_iface);
channel->uri = uri; channel->uri = uri;
hres = IUri_GetScheme(uri->uri, &channel->url_scheme);
if(FAILED(hres))
channel->url_scheme = URL_SCHEME_UNKNOWN;
*ret = channel; *ret = channel;
return NS_OK; return NS_OK;
} }
......
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