mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 19:10:21 +00:00
mshtml: Don't store NSContainer in nsWineURI.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
bd9cdb3b65
commit
842207e260
|
@ -57,7 +57,6 @@ struct nsWineURI {
|
|||
|
||||
LONG ref;
|
||||
|
||||
NSContainer *container;
|
||||
windowref_t *window_ref;
|
||||
nsChannelBSC *channel_bsc;
|
||||
IUri *uri;
|
||||
|
@ -157,7 +156,7 @@ static HRESULT combine_url(IUri *base_uri, const WCHAR *rel_url, IUri **ret)
|
|||
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)
|
||||
{
|
||||
|
@ -305,7 +304,7 @@ HRESULT load_nsuri(HTMLOuterWindow *window, nsWineURI *uri, nsIInputStream *post
|
|||
|
||||
if(window->uri_nofrag) {
|
||||
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)) {
|
||||
nsres = nsIDocShellLoadInfo_SetReferrer(load_info, (nsIURI*)&referrer_uri->nsIFileURL_iface);
|
||||
assert(nsres == NS_OK);
|
||||
|
@ -330,20 +329,6 @@ HRESULT load_nsuri(HTMLOuterWindow *window, nsWineURI *uri, nsIInputStream *post
|
|||
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)
|
||||
{
|
||||
if(This->window_ref) {
|
||||
|
@ -356,9 +341,6 @@ static void set_uri_window(nsWineURI *This, HTMLOuterWindow *window)
|
|||
if(window) {
|
||||
windowref_addref(window->window_ref);
|
||||
This->window_ref = window->window_ref;
|
||||
|
||||
if(window->doc_obj)
|
||||
set_uri_nscontainer(This, window->doc_obj->nscontainer);
|
||||
}else {
|
||||
This->window_ref = NULL;
|
||||
}
|
||||
|
@ -1115,22 +1097,8 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
|
|||
|
||||
if(This->uri->is_doc_uri) {
|
||||
window = get_channel_window(This);
|
||||
if(window) {
|
||||
if(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) {
|
||||
|
@ -2356,8 +2324,6 @@ static nsrefcnt NSAPI nsURI_Release(nsIFileURL *iface)
|
|||
if(!ref) {
|
||||
if(This->window_ref)
|
||||
windowref_release(This->window_ref);
|
||||
if(This->container)
|
||||
nsIWebBrowserChrome_Release(&This->container->nsIWebBrowserChrome_iface);
|
||||
if(This->uri)
|
||||
IUri_Release(This->uri);
|
||||
if(This->uri_builder)
|
||||
|
@ -2860,7 +2826,7 @@ static nsresult NSAPI nsURI_Clone(nsIFileURL *iface, nsIURI **_retval)
|
|||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
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)) {
|
||||
WARN("create_nsuri failed: %08x\n", nsres);
|
||||
return nsres;
|
||||
|
@ -3042,7 +3008,7 @@ static nsresult NSAPI nsURI_CloneIgnoreRef(nsIFileURL *iface, nsIURI **_retval)
|
|||
if(!uri)
|
||||
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);
|
||||
IUri_Release(uri);
|
||||
if(NS_FAILED(nsres)) {
|
||||
|
@ -3438,7 +3404,7 @@ static const nsIStandardURLVtbl nsStandardURLVtbl = {
|
|||
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)
|
||||
{
|
||||
nsWineURI *ret;
|
||||
|
@ -3453,7 +3419,6 @@ static nsresult create_nsuri(IUri *iuri, HTMLOuterWindow *window, NSContainer *c
|
|||
ret->ref = 1;
|
||||
ret->is_mutable = TRUE;
|
||||
|
||||
set_uri_nscontainer(ret, container);
|
||||
set_uri_window(ret, window);
|
||||
|
||||
IUri_AddRef(iuri);
|
||||
|
@ -3481,8 +3446,7 @@ HRESULT create_doc_uri(HTMLOuterWindow *window, IUri *iuri, nsWineURI **ret)
|
|||
nsWineURI *uri;
|
||||
nsresult nsres;
|
||||
|
||||
nsres = create_nsuri(iuri, window, window->doc_obj ? window->doc_obj->nscontainer : NULL,
|
||||
NULL, &uri);
|
||||
nsres = create_nsuri(iuri, window, NULL, &uri);
|
||||
if(NS_FAILED(nsres))
|
||||
return E_FAIL;
|
||||
|
||||
|
@ -3533,7 +3497,7 @@ HRESULT create_redirect_nschannel(const WCHAR *url, nsChannel *orig_channel, nsC
|
|||
|
||||
if(orig_channel->uri->window_ref)
|
||||
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);
|
||||
if(NS_FAILED(nsres))
|
||||
return E_FAIL;
|
||||
|
@ -3909,7 +3873,7 @@ static nsresult NSAPI nsIOServiceHook_NewURI(nsIIOServiceHook *iface, const nsAC
|
|||
if(FAILED(hres))
|
||||
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);
|
||||
if(base_wine_uri)
|
||||
nsIFileURL_Release(&base_wine_uri->nsIFileURL_iface);
|
||||
|
@ -4025,11 +3989,6 @@ nsresult on_start_uri_open(NSContainer *nscontainer, nsIURI *uri, cpp_bool *_ret
|
|||
if(!wine_uri->is_doc_uri) {
|
||||
wine_uri->is_doc_uri = TRUE;
|
||||
|
||||
if(!wine_uri->container) {
|
||||
nsIWebBrowserChrome_AddRef(&nscontainer->nsIWebBrowserChrome_iface);
|
||||
wine_uri->container = nscontainer;
|
||||
}
|
||||
|
||||
if(nscontainer->doc)
|
||||
*_retval = translate_url(nscontainer->doc, wine_uri);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue