Commit 739ff120 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Store security manager in HTMLWindow instead of HTMLDocumentNode.

parent 643c66ba
......@@ -1912,8 +1912,6 @@ static void HTMLDocumentNode_destructor(HTMLDOMNode *iface)
release_nsevents(This);
if(This->catmgr)
ICatInformation_Release(This->catmgr);
if(This->secmgr)
IInternetSecurityManager_Release(This->secmgr);
detach_selection(This);
detach_ranges(This);
......@@ -2013,7 +2011,6 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLWindow *wi
HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_obj, HTMLWindow *window, HTMLDocumentNode **ret)
{
HTMLDocumentNode *doc;
HRESULT hres;
doc = alloc_doc_node(doc_obj, window);
if(!doc)
......@@ -2030,12 +2027,6 @@ HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_ob
doc->node.vtbl = &HTMLDocumentNodeImplVtbl;
doc->node.cp_container = &doc->basedoc.cp_container;
hres = CoInternetCreateSecurityManager(NULL, &doc->secmgr, 0);
if(FAILED(hres)) {
htmldoc_release(&doc->basedoc);
return hres;
}
*ret = doc;
return S_OK;
}
......
......@@ -236,6 +236,9 @@ static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
window_set_docnode(This, NULL);
release_children(This);
if(This->secmgr)
IInternetSecurityManager_Release(This->secmgr);
if(This->frame_element)
This->frame_element->content_window = NULL;
......@@ -2217,6 +2220,7 @@ static dispex_static_data_t HTMLWindow_dispex = {
HRESULT HTMLWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, HTMLWindow *parent, HTMLWindow **ret)
{
HTMLWindow *window;
HRESULT hres;
window = heap_alloc_zero(sizeof(HTMLWindow));
if(!window)
......@@ -2251,6 +2255,12 @@ HRESULT HTMLWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, HTML
window->readystate = READYSTATE_UNINITIALIZED;
list_init(&window->script_hosts);
hres = CoInternetCreateSecurityManager(NULL, &window->secmgr, 0);
if(FAILED(hres)) {
IHTMLWindow2_Release(&window->IHTMLWindow2_iface);
return hres;
}
window->task_magic = get_task_target_magic();
update_window_doc(window);
......
......@@ -295,6 +295,8 @@ struct HTMLWindow {
SCRIPTMODE scriptmode;
struct list script_hosts;
IInternetSecurityManager *secmgr;
HTMLOptionElementFactory *option_factory;
HTMLImageElementFactory *image_factory;
HTMLLocation *location;
......@@ -611,7 +613,6 @@ struct HTMLDocumentNode {
BOOL content_ready;
event_target_t *body_event_target;
IInternetSecurityManager *secmgr;
ICatInformation *catmgr;
nsDocumentEventListener *nsevent_listener;
BOOL *event_vector;
......
......@@ -83,7 +83,7 @@ static HRESULT WINAPI InternetHostSecurityManager_ProcessUrlAction(IInternetHost
url = This->basedoc.window->url ? This->basedoc.window->url : about_blankW;
return IInternetSecurityManager_ProcessUrlAction(This->secmgr, url, dwAction, pPolicy, cbPolicy,
return IInternetSecurityManager_ProcessUrlAction(This->basedoc.window->secmgr, url, dwAction, pPolicy, cbPolicy,
pContext, cbContext, dwFlags, dwReserved);
}
......@@ -121,7 +121,7 @@ static HRESULT confirm_safety(HTMLDocumentNode *This, const WCHAR *url, struct C
/* FIXME: Check URLACTION_ACTIVEX_OVERRIDE_SCRIPT_SAFETY */
hres = IInternetSecurityManager_ProcessUrlAction(This->secmgr, url, URLACTION_SCRIPT_SAFE_ACTIVEX,
hres = IInternetSecurityManager_ProcessUrlAction(This->basedoc.window->secmgr, url, URLACTION_SCRIPT_SAFE_ACTIVEX,
(BYTE*)&policy, sizeof(policy), NULL, 0, 0, 0);
if(FAILED(hres) || policy != URLPOLICY_ALLOW) {
*ret = URLPOLICY_DISALLOW;
......@@ -187,7 +187,7 @@ static HRESULT WINAPI InternetHostSecurityManager_QueryCustomPolicy(IInternetHos
url = This->basedoc.window->url ? This->basedoc.window->url : about_blankW;
hres = IInternetSecurityManager_QueryCustomPolicy(This->secmgr, url, guidKey, ppPolicy, pcbPolicy,
hres = IInternetSecurityManager_QueryCustomPolicy(This->basedoc.window->secmgr, url, guidKey, ppPolicy, pcbPolicy,
pContext, cbContext, dwReserved);
if(hres != HRESULT_FROM_WIN32(ERROR_NOT_FOUND))
return hres;
......
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