Jacek Caban : mshtml: Moved image_factory to HTMLInnerWindow.
Alexandre Julliard
julliard at winehq.org
Tue Jun 26 13:34:14 CDT 2012
Module: wine
Branch: master
Commit: b85631bab675b867a1d3f7c2f0bca6e0a0b8a417
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b85631bab675b867a1d3f7c2f0bca6e0a0b8a417
Author: Jacek Caban <jacek at codeweavers.com>
Date: Tue Jun 26 12:32:27 2012 +0200
mshtml: Moved image_factory to HTMLInnerWindow.
---
dlls/mshtml/htmlimg.c | 7 +++++--
dlls/mshtml/htmlwindow.c | 21 +++++++++++++--------
dlls/mshtml/mshtml_private.h | 6 +++---
3 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c
index 300218b..adb40d5 100644
--- a/dlls/mshtml/htmlimg.c
+++ b/dlls/mshtml/htmlimg.c
@@ -920,11 +920,13 @@ static dispex_static_data_t HTMLImageElementFactory_dispex = {
HTMLImageElementFactory_iface_tids
};
-HTMLImageElementFactory *HTMLImageElementFactory_Create(HTMLOuterWindow *window)
+HRESULT HTMLImageElementFactory_Create(HTMLInnerWindow *window, HTMLImageElementFactory **ret_val)
{
HTMLImageElementFactory *ret;
ret = heap_alloc(sizeof(HTMLImageElementFactory));
+ if(!ret)
+ return E_OUTOFMEMORY;
ret->IHTMLImageElementFactory_iface.lpVtbl = &HTMLImageElementFactoryVtbl;
ret->ref = 1;
@@ -933,5 +935,6 @@ HTMLImageElementFactory *HTMLImageElementFactory_Create(HTMLOuterWindow *window)
init_dispex(&ret->dispex, (IUnknown*)&ret->IHTMLImageElementFactory_iface,
&HTMLImageElementFactory_dispex);
- return ret;
+ *ret_val = ret;
+ return S_OK;
}
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c
index dc6d9af..5852a26 100644
--- a/dlls/mshtml/htmlwindow.c
+++ b/dlls/mshtml/htmlwindow.c
@@ -192,11 +192,6 @@ static void release_outer_window(HTMLOuterWindow *This)
if(This->frame_element)
This->frame_element->content_window = NULL;
- if(This->image_factory) {
- This->image_factory->window = NULL;
- IHTMLImageElementFactory_Release(&This->image_factory->IHTMLImageElementFactory_iface);
- }
-
if(This->location) {
This->location->window = NULL;
IHTMLLocation_Release(&This->location->IHTMLLocation_iface);
@@ -228,6 +223,11 @@ static void release_inner_window(HTMLInnerWindow *This)
heap_free(This->global_props[i].name);
heap_free(This->global_props);
+ if(This->image_factory) {
+ This->image_factory->window = NULL;
+ IHTMLImageElementFactory_Release(&This->image_factory->IHTMLImageElementFactory_iface);
+ }
+
if(This->option_factory) {
This->option_factory->window = NULL;
IHTMLOptionElementFactory_Release(&This->option_factory->IHTMLOptionElementFactory_iface);
@@ -647,12 +647,17 @@ static HRESULT WINAPI HTMLWindow2_prompt(IHTMLWindow2 *iface, BSTR message,
static HRESULT WINAPI HTMLWindow2_get_Image(IHTMLWindow2 *iface, IHTMLImageElementFactory **p)
{
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
- HTMLOuterWindow *window = This->outer_window;
+ HTMLInnerWindow *window = This->inner_window;
TRACE("(%p)->(%p)\n", This, p);
- if(!window->image_factory)
- window->image_factory = HTMLImageElementFactory_Create(window);
+ if(!window->image_factory) {
+ HRESULT hres;
+
+ hres = HTMLImageElementFactory_Create(window, &window->image_factory);
+ if(FAILED(hres))
+ return hres;
+ }
*p = &window->image_factory->IHTMLImageElementFactory_iface;
IHTMLImageElementFactory_AddRef(*p);
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 31532cd..d9f0639 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -278,7 +278,7 @@ typedef struct {
LONG ref;
- HTMLOuterWindow *window;
+ HTMLInnerWindow *window;
} HTMLImageElementFactory;
struct HTMLLocation {
@@ -335,7 +335,6 @@ struct HTMLOuterWindow {
IInternetSecurityManager *secmgr;
- HTMLImageElementFactory *image_factory;
HTMLLocation *location;
IHTMLScreen *screen;
IOmHistory *history;
@@ -355,6 +354,7 @@ struct HTMLInnerWindow {
IHTMLEventObj *event;
+ HTMLImageElementFactory *image_factory;
HTMLOptionElementFactory *option_factory;
global_prop_t *global_props;
@@ -663,7 +663,7 @@ HRESULT update_window_doc(HTMLOuterWindow*) DECLSPEC_HIDDEN;
HTMLOuterWindow *nswindow_to_window(const nsIDOMWindow*) DECLSPEC_HIDDEN;
void get_top_window(HTMLOuterWindow*,HTMLOuterWindow**) DECLSPEC_HIDDEN;
HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow*,HTMLOptionElementFactory**) DECLSPEC_HIDDEN;
-HTMLImageElementFactory *HTMLImageElementFactory_Create(HTMLOuterWindow*) DECLSPEC_HIDDEN;
+HRESULT HTMLImageElementFactory_Create(HTMLInnerWindow*,HTMLImageElementFactory**) DECLSPEC_HIDDEN;
HRESULT HTMLLocation_Create(HTMLOuterWindow*,HTMLLocation**) DECLSPEC_HIDDEN;
IOmNavigator *OmNavigator_Create(void) DECLSPEC_HIDDEN;
HRESULT HTMLScreen_Create(IHTMLScreen**) DECLSPEC_HIDDEN;
More information about the wine-cvs
mailing list