Commit 842207e2 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Don't store NSContainer in nsWineURI.

parent bd9cdb3b
...@@ -57,7 +57,6 @@ struct nsWineURI { ...@@ -57,7 +57,6 @@ struct nsWineURI {
LONG ref; LONG ref;
NSContainer *container;
windowref_t *window_ref; windowref_t *window_ref;
nsChannelBSC *channel_bsc; nsChannelBSC *channel_bsc;
IUri *uri; IUri *uri;
...@@ -157,7 +156,7 @@ static HRESULT combine_url(IUri *base_uri, const WCHAR *rel_url, IUri **ret) ...@@ -157,7 +156,7 @@ static HRESULT combine_url(IUri *base_uri, const WCHAR *rel_url, IUri **ret)
return hres; return hres;
} }
static nsresult create_nsuri(IUri*,HTMLOuterWindow*,NSContainer*,const char*,nsWineURI**); static nsresult create_nsuri(IUri*,HTMLOuterWindow*,const char*,nsWineURI**);
static const char *debugstr_nsacstr(const nsACString *nsstr) static const char *debugstr_nsacstr(const nsACString *nsstr)
{ {
...@@ -305,7 +304,7 @@ HRESULT load_nsuri(HTMLOuterWindow *window, nsWineURI *uri, nsIInputStream *post ...@@ -305,7 +304,7 @@ HRESULT load_nsuri(HTMLOuterWindow *window, nsWineURI *uri, nsIInputStream *post
if(window->uri_nofrag) { if(window->uri_nofrag) {
nsWineURI *referrer_uri; nsWineURI *referrer_uri;
nsres = create_nsuri(window->uri_nofrag, window, window->doc_obj ? window->doc_obj->nscontainer : NULL, NULL, &referrer_uri); nsres = create_nsuri(window->uri_nofrag, window, NULL, &referrer_uri);
if(NS_SUCCEEDED(nsres)) { if(NS_SUCCEEDED(nsres)) {
nsres = nsIDocShellLoadInfo_SetReferrer(load_info, (nsIURI*)&referrer_uri->nsIFileURL_iface); nsres = nsIDocShellLoadInfo_SetReferrer(load_info, (nsIURI*)&referrer_uri->nsIFileURL_iface);
assert(nsres == NS_OK); assert(nsres == NS_OK);
...@@ -330,20 +329,6 @@ HRESULT load_nsuri(HTMLOuterWindow *window, nsWineURI *uri, nsIInputStream *post ...@@ -330,20 +329,6 @@ HRESULT load_nsuri(HTMLOuterWindow *window, nsWineURI *uri, nsIInputStream *post
return S_OK; return S_OK;
} }
static void set_uri_nscontainer(nsWineURI *This, NSContainer *nscontainer)
{
if(This->container) {
if(This->container == nscontainer)
return;
TRACE("Changing %p -> %p\n", This->container, nscontainer);
nsIWebBrowserChrome_Release(&This->container->nsIWebBrowserChrome_iface);
}
if(nscontainer)
nsIWebBrowserChrome_AddRef(&nscontainer->nsIWebBrowserChrome_iface);
This->container = nscontainer;
}
static void set_uri_window(nsWineURI *This, HTMLOuterWindow *window) static void set_uri_window(nsWineURI *This, HTMLOuterWindow *window)
{ {
if(This->window_ref) { if(This->window_ref) {
...@@ -356,9 +341,6 @@ static void set_uri_window(nsWineURI *This, HTMLOuterWindow *window) ...@@ -356,9 +341,6 @@ static void set_uri_window(nsWineURI *This, HTMLOuterWindow *window)
if(window) { if(window) {
windowref_addref(window->window_ref); windowref_addref(window->window_ref);
This->window_ref = window->window_ref; This->window_ref = window->window_ref;
if(window->doc_obj)
set_uri_nscontainer(This, window->doc_obj->nscontainer);
}else { }else {
This->window_ref = NULL; This->window_ref = NULL;
} }
...@@ -1115,22 +1097,8 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen ...@@ -1115,22 +1097,8 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
if(This->uri->is_doc_uri) { if(This->uri->is_doc_uri) {
window = get_channel_window(This); window = get_channel_window(This);
if(window) { if(window)
set_uri_window(This->uri, window); set_uri_window(This->uri, window);
}else if(This->uri->container) {
BOOL b;
/* nscontainer->doc should be NULL which means navigation to a new window */
if(This->uri->container->doc)
FIXME("nscontainer->doc = %p\n", This->uri->container->doc);
nsres = before_async_open(This, This->uri->container, &b);
if(NS_FAILED(nsres))
return nsres;
if(b)
FIXME("Navigation not cancelled\n");
return NS_ERROR_UNEXPECTED;
}
} }
if(!window) { if(!window) {
...@@ -2356,8 +2324,6 @@ static nsrefcnt NSAPI nsURI_Release(nsIFileURL *iface) ...@@ -2356,8 +2324,6 @@ static nsrefcnt NSAPI nsURI_Release(nsIFileURL *iface)
if(!ref) { if(!ref) {
if(This->window_ref) if(This->window_ref)
windowref_release(This->window_ref); windowref_release(This->window_ref);
if(This->container)
nsIWebBrowserChrome_Release(&This->container->nsIWebBrowserChrome_iface);
if(This->uri) if(This->uri)
IUri_Release(This->uri); IUri_Release(This->uri);
if(This->uri_builder) if(This->uri_builder)
...@@ -2860,7 +2826,7 @@ static nsresult NSAPI nsURI_Clone(nsIFileURL *iface, nsIURI **_retval) ...@@ -2860,7 +2826,7 @@ static nsresult NSAPI nsURI_Clone(nsIFileURL *iface, nsIURI **_retval)
return NS_ERROR_UNEXPECTED; return NS_ERROR_UNEXPECTED;
nsres = create_nsuri(This->uri, This->window_ref ? This->window_ref->window : NULL, nsres = create_nsuri(This->uri, This->window_ref ? This->window_ref->window : NULL,
This->container, This->origin_charset, &wine_uri); This->origin_charset, &wine_uri);
if(NS_FAILED(nsres)) { if(NS_FAILED(nsres)) {
WARN("create_nsuri failed: %08x\n", nsres); WARN("create_nsuri failed: %08x\n", nsres);
return nsres; return nsres;
...@@ -3042,7 +3008,7 @@ static nsresult NSAPI nsURI_CloneIgnoreRef(nsIFileURL *iface, nsIURI **_retval) ...@@ -3042,7 +3008,7 @@ static nsresult NSAPI nsURI_CloneIgnoreRef(nsIFileURL *iface, nsIURI **_retval)
if(!uri) if(!uri)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
nsres = create_nsuri(uri, This->window_ref ? This->window_ref->window : NULL, This->container, nsres = create_nsuri(uri, This->window_ref ? This->window_ref->window : NULL,
This->origin_charset, &wine_uri); This->origin_charset, &wine_uri);
IUri_Release(uri); IUri_Release(uri);
if(NS_FAILED(nsres)) { if(NS_FAILED(nsres)) {
...@@ -3438,7 +3404,7 @@ static const nsIStandardURLVtbl nsStandardURLVtbl = { ...@@ -3438,7 +3404,7 @@ static const nsIStandardURLVtbl nsStandardURLVtbl = {
nsStandardURL_SetDefaultPort nsStandardURL_SetDefaultPort
}; };
static nsresult create_nsuri(IUri *iuri, HTMLOuterWindow *window, NSContainer *container, static nsresult create_nsuri(IUri *iuri, HTMLOuterWindow *window,
const char *origin_charset, nsWineURI **_retval) const char *origin_charset, nsWineURI **_retval)
{ {
nsWineURI *ret; nsWineURI *ret;
...@@ -3453,7 +3419,6 @@ static nsresult create_nsuri(IUri *iuri, HTMLOuterWindow *window, NSContainer *c ...@@ -3453,7 +3419,6 @@ static nsresult create_nsuri(IUri *iuri, HTMLOuterWindow *window, NSContainer *c
ret->ref = 1; ret->ref = 1;
ret->is_mutable = TRUE; ret->is_mutable = TRUE;
set_uri_nscontainer(ret, container);
set_uri_window(ret, window); set_uri_window(ret, window);
IUri_AddRef(iuri); IUri_AddRef(iuri);
...@@ -3481,8 +3446,7 @@ HRESULT create_doc_uri(HTMLOuterWindow *window, IUri *iuri, nsWineURI **ret) ...@@ -3481,8 +3446,7 @@ HRESULT create_doc_uri(HTMLOuterWindow *window, IUri *iuri, nsWineURI **ret)
nsWineURI *uri; nsWineURI *uri;
nsresult nsres; nsresult nsres;
nsres = create_nsuri(iuri, window, window->doc_obj ? window->doc_obj->nscontainer : NULL, nsres = create_nsuri(iuri, window, NULL, &uri);
NULL, &uri);
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
return E_FAIL; return E_FAIL;
...@@ -3533,7 +3497,7 @@ HRESULT create_redirect_nschannel(const WCHAR *url, nsChannel *orig_channel, nsC ...@@ -3533,7 +3497,7 @@ HRESULT create_redirect_nschannel(const WCHAR *url, nsChannel *orig_channel, nsC
if(orig_channel->uri->window_ref) if(orig_channel->uri->window_ref)
window = orig_channel->uri->window_ref->window; window = orig_channel->uri->window_ref->window;
nsres = create_nsuri(iuri, window, NULL, NULL, &uri); nsres = create_nsuri(iuri, window, NULL, &uri);
IUri_Release(iuri); IUri_Release(iuri);
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
return E_FAIL; return E_FAIL;
...@@ -3909,7 +3873,7 @@ static nsresult NSAPI nsIOServiceHook_NewURI(nsIIOServiceHook *iface, const nsAC ...@@ -3909,7 +3873,7 @@ static nsresult NSAPI nsIOServiceHook_NewURI(nsIIOServiceHook *iface, const nsAC
if(FAILED(hres)) if(FAILED(hres))
return NS_SUCCESS_DEFAULT_ACTION; return NS_SUCCESS_DEFAULT_ACTION;
nsres = create_nsuri(urlmon_uri, window, NULL, NULL, &wine_uri); nsres = create_nsuri(urlmon_uri, window, NULL, &wine_uri);
IUri_Release(urlmon_uri); IUri_Release(urlmon_uri);
if(base_wine_uri) if(base_wine_uri)
nsIFileURL_Release(&base_wine_uri->nsIFileURL_iface); nsIFileURL_Release(&base_wine_uri->nsIFileURL_iface);
...@@ -4025,11 +3989,6 @@ nsresult on_start_uri_open(NSContainer *nscontainer, nsIURI *uri, cpp_bool *_ret ...@@ -4025,11 +3989,6 @@ nsresult on_start_uri_open(NSContainer *nscontainer, nsIURI *uri, cpp_bool *_ret
if(!wine_uri->is_doc_uri) { if(!wine_uri->is_doc_uri) {
wine_uri->is_doc_uri = TRUE; wine_uri->is_doc_uri = TRUE;
if(!wine_uri->container) {
nsIWebBrowserChrome_AddRef(&nscontainer->nsIWebBrowserChrome_iface);
wine_uri->container = nscontainer;
}
if(nscontainer->doc) if(nscontainer->doc)
*_retval = translate_url(nscontainer->doc, wine_uri); *_retval = translate_url(nscontainer->doc, wine_uri);
} }
......
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