mshtml: Associate PluginHost with containing HTMLDocumentDode.
This commit is contained in:
parent
d9dcafab91
commit
b962fff243
|
@ -35,6 +35,7 @@
|
||||||
|
|
||||||
#include "mshtml_private.h"
|
#include "mshtml_private.h"
|
||||||
#include "htmlevent.h"
|
#include "htmlevent.h"
|
||||||
|
#include "pluginhost.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||||
|
|
||||||
|
@ -1897,6 +1898,7 @@ static void HTMLDocumentNode_destructor(HTMLDOMNode *iface)
|
||||||
|
|
||||||
detach_selection(This);
|
detach_selection(This);
|
||||||
detach_ranges(This);
|
detach_ranges(This);
|
||||||
|
detach_plugin_hosts(This);
|
||||||
release_nodes(This);
|
release_nodes(This);
|
||||||
|
|
||||||
if(This->nsdoc) {
|
if(This->nsdoc) {
|
||||||
|
@ -1982,6 +1984,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLWindow *wi
|
||||||
list_init(&doc->bindings);
|
list_init(&doc->bindings);
|
||||||
list_init(&doc->selection_list);
|
list_init(&doc->selection_list);
|
||||||
list_init(&doc->range_list);
|
list_init(&doc->range_list);
|
||||||
|
list_init(&doc->plugin_hosts);
|
||||||
|
|
||||||
return doc;
|
return doc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -618,6 +618,7 @@ struct HTMLDocumentNode {
|
||||||
struct list bindings;
|
struct list bindings;
|
||||||
struct list selection_list;
|
struct list selection_list;
|
||||||
struct list range_list;
|
struct list range_list;
|
||||||
|
struct list plugin_hosts;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define HTMLWINDOW2(x) ((IHTMLWindow2*) &(x)->lpHTMLWindow2Vtbl)
|
#define HTMLWINDOW2(x) ((IHTMLWindow2*) &(x)->lpHTMLWindow2Vtbl)
|
||||||
|
|
|
@ -272,7 +272,7 @@ static NPError CDECL NPP_New(NPMIMEType pluginType, NPP instance, UINT16 mode, I
|
||||||
PluginHost *host;
|
PluginHost *host;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
hres = create_plugin_host(obj, &host);
|
hres = create_plugin_host(window->doc, obj, &host);
|
||||||
nsIDOMElement_Release(nselem);
|
nsIDOMElement_Release(nselem);
|
||||||
IUnknown_Release(obj);
|
IUnknown_Release(obj);
|
||||||
if(SUCCEEDED(hres))
|
if(SUCCEEDED(hres))
|
||||||
|
|
|
@ -160,6 +160,7 @@ static ULONG WINAPI PHClientSite_Release(IOleClientSite *iface)
|
||||||
TRACE("(%p) ref=%d\n", This, ref);
|
TRACE("(%p) ref=%d\n", This, ref);
|
||||||
|
|
||||||
if(!ref) {
|
if(!ref) {
|
||||||
|
list_remove(&This->entry);
|
||||||
if(This->plugin_unk)
|
if(This->plugin_unk)
|
||||||
IUnknown_Release(This->plugin_unk);
|
IUnknown_Release(This->plugin_unk);
|
||||||
heap_free(This);
|
heap_free(This);
|
||||||
|
@ -731,7 +732,18 @@ static const IServiceProviderVtbl ServiceProviderVtbl = {
|
||||||
PHServiceProvider_QueryService
|
PHServiceProvider_QueryService
|
||||||
};
|
};
|
||||||
|
|
||||||
HRESULT create_plugin_host(IUnknown *unk, PluginHost **ret)
|
void detach_plugin_hosts(HTMLDocumentNode *doc)
|
||||||
|
{
|
||||||
|
PluginHost *iter;
|
||||||
|
|
||||||
|
while(!list_empty(&doc->plugin_hosts)) {
|
||||||
|
iter = LIST_ENTRY(list_head(&doc->plugin_hosts), PluginHost, entry);
|
||||||
|
list_remove(&iter->entry);
|
||||||
|
iter->doc = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT create_plugin_host(HTMLDocumentNode *doc, IUnknown *unk, PluginHost **ret)
|
||||||
{
|
{
|
||||||
PluginHost *host;
|
PluginHost *host;
|
||||||
|
|
||||||
|
@ -753,6 +765,9 @@ HRESULT create_plugin_host(IUnknown *unk, PluginHost **ret)
|
||||||
IUnknown_AddRef(unk);
|
IUnknown_AddRef(unk);
|
||||||
host->plugin_unk = unk;
|
host->plugin_unk = unk;
|
||||||
|
|
||||||
|
host->doc = doc;
|
||||||
|
list_add_tail(&doc->plugin_hosts, &host->entry);
|
||||||
|
|
||||||
*ret = host;
|
*ret = host;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,11 @@ typedef struct {
|
||||||
|
|
||||||
IUnknown *plugin_unk;
|
IUnknown *plugin_unk;
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
|
|
||||||
|
HTMLDocumentNode *doc;
|
||||||
|
struct list entry;
|
||||||
} PluginHost;
|
} PluginHost;
|
||||||
|
|
||||||
HRESULT create_plugin_host(IUnknown*,PluginHost**);
|
HRESULT create_plugin_host(HTMLDocumentNode*,IUnknown*,PluginHost**);
|
||||||
void update_plugin_window(PluginHost*,HWND,const RECT*);
|
void update_plugin_window(PluginHost*,HWND,const RECT*);
|
||||||
|
void detach_plugin_hosts(HTMLDocumentNode*);
|
||||||
|
|
Loading…
Reference in New Issue