Commit 15c7470a authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml: Move HTMLPerformanceNavigation related fields to the window.

parent 6dc7c3cd
...@@ -535,9 +535,6 @@ typedef struct { ...@@ -535,9 +535,6 @@ typedef struct {
LONG ref; LONG ref;
ULONG navigation_type;
ULONG redirect_count;
ULONGLONG navigation_start_time; ULONGLONG navigation_start_time;
ULONGLONG unload_event_start_time; ULONGLONG unload_event_start_time;
ULONGLONG unload_event_end_time; ULONGLONG unload_event_end_time;
...@@ -647,6 +644,9 @@ struct HTMLInnerWindow { ...@@ -647,6 +644,9 @@ struct HTMLInnerWindow {
IDispatch *mutation_observer_ctor; IDispatch *mutation_observer_ctor;
nsChannelBSC *bscallback; nsChannelBSC *bscallback;
struct list bindings; struct list bindings;
ULONG navigation_type;
ULONG redirect_count;
}; };
typedef enum { typedef enum {
......
...@@ -1351,9 +1351,9 @@ static HRESULT nsChannelBSC_start_binding(BSCallback *bsc) ...@@ -1351,9 +1351,9 @@ static HRESULT nsChannelBSC_start_binding(BSCallback *bsc)
DWORD flags = This->bsc.window->base.outer_window->load_flags; DWORD flags = This->bsc.window->base.outer_window->load_flags;
if(flags & BINDING_FROMHIST) if(flags & BINDING_FROMHIST)
This->bsc.window->performance_timing->navigation_type = 2; /* TYPE_BACK_FORWARD */ This->bsc.window->navigation_type = 2; /* TYPE_BACK_FORWARD */
if(flags & BINDING_REFRESH) if(flags & BINDING_REFRESH)
This->bsc.window->performance_timing->navigation_type = 1; /* TYPE_RELOAD */ This->bsc.window->navigation_type = 1; /* TYPE_RELOAD */
This->bsc.window->base.outer_window->base.inner_window->doc->skip_mutation_notif = FALSE; This->bsc.window->base.outer_window->base.inner_window->doc->skip_mutation_notif = FALSE;
This->bsc.window->performance_timing->navigation_start_time = get_time_stamp(); This->bsc.window->performance_timing->navigation_start_time = get_time_stamp();
...@@ -1726,7 +1726,7 @@ static HRESULT nsChannelBSC_on_progress(BSCallback *bsc, ULONG progress, ULONG t ...@@ -1726,7 +1726,7 @@ static HRESULT nsChannelBSC_on_progress(BSCallback *bsc, ULONG progress, ULONG t
break; break;
case BINDSTATUS_REDIRECTING: case BINDSTATUS_REDIRECTING:
if(This->is_doc_channel) { if(This->is_doc_channel) {
This->bsc.window->performance_timing->redirect_count++; This->bsc.window->redirect_count++;
if(!This->bsc.window->performance_timing->redirect_time) if(!This->bsc.window->performance_timing->redirect_time)
This->bsc.window->performance_timing->redirect_time = get_time_stamp(); This->bsc.window->performance_timing->redirect_time = get_time_stamp();
} }
......
...@@ -1977,7 +1977,7 @@ typedef struct { ...@@ -1977,7 +1977,7 @@ typedef struct {
DispatchEx dispex; DispatchEx dispex;
IHTMLPerformanceNavigation IHTMLPerformanceNavigation_iface; IHTMLPerformanceNavigation IHTMLPerformanceNavigation_iface;
HTMLPerformanceTiming *timing; HTMLInnerWindow *window;
} HTMLPerformanceNavigation; } HTMLPerformanceNavigation;
static inline HTMLPerformanceNavigation *impl_from_IHTMLPerformanceNavigation(IHTMLPerformanceNavigation *iface) static inline HTMLPerformanceNavigation *impl_from_IHTMLPerformanceNavigation(IHTMLPerformanceNavigation *iface)
...@@ -2068,7 +2068,7 @@ static HRESULT WINAPI HTMLPerformanceNavigation_get_type(IHTMLPerformanceNavigat ...@@ -2068,7 +2068,7 @@ static HRESULT WINAPI HTMLPerformanceNavigation_get_type(IHTMLPerformanceNavigat
TRACE("(%p)->(%p)\n", This, p); TRACE("(%p)->(%p)\n", This, p);
*p = This->timing->navigation_type; *p = This->window->navigation_type;
return S_OK; return S_OK;
} }
...@@ -2078,7 +2078,7 @@ static HRESULT WINAPI HTMLPerformanceNavigation_get_redirectCount(IHTMLPerforman ...@@ -2078,7 +2078,7 @@ static HRESULT WINAPI HTMLPerformanceNavigation_get_redirectCount(IHTMLPerforman
TRACE("(%p)->(%p)\n", This, p); TRACE("(%p)->(%p)\n", This, p);
*p = This->timing->redirect_count; *p = This->window->redirect_count;
return S_OK; return S_OK;
} }
...@@ -2120,17 +2120,17 @@ static inline HTMLPerformanceNavigation *HTMLPerformanceNavigation_from_Dispatch ...@@ -2120,17 +2120,17 @@ static inline HTMLPerformanceNavigation *HTMLPerformanceNavigation_from_Dispatch
static void HTMLPerformanceNavigation_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb) static void HTMLPerformanceNavigation_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{ {
HTMLPerformanceNavigation *This = HTMLPerformanceNavigation_from_DispatchEx(dispex); HTMLPerformanceNavigation *This = HTMLPerformanceNavigation_from_DispatchEx(dispex);
if(This->timing) if(This->window)
note_cc_edge((nsISupports*)&This->timing->IHTMLPerformanceTiming_iface, "timing", cb); note_cc_edge((nsISupports*)&This->window->base.IHTMLWindow2_iface, "window", cb);
} }
static void HTMLPerformanceNavigation_unlink(DispatchEx *dispex) static void HTMLPerformanceNavigation_unlink(DispatchEx *dispex)
{ {
HTMLPerformanceNavigation *This = HTMLPerformanceNavigation_from_DispatchEx(dispex); HTMLPerformanceNavigation *This = HTMLPerformanceNavigation_from_DispatchEx(dispex);
if(This->timing) { if(This->window) {
HTMLPerformanceTiming *timing = This->timing; HTMLInnerWindow *window = This->window;
This->timing = NULL; This->window = NULL;
IHTMLPerformanceTiming_Release(&timing->IHTMLPerformanceTiming_iface); IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
} }
} }
...@@ -2161,6 +2161,7 @@ typedef struct { ...@@ -2161,6 +2161,7 @@ typedef struct {
DispatchEx dispex; DispatchEx dispex;
IHTMLPerformance IHTMLPerformance_iface; IHTMLPerformance IHTMLPerformance_iface;
HTMLInnerWindow *window;
IHTMLPerformanceNavigation *navigation; IHTMLPerformanceNavigation *navigation;
HTMLPerformanceTiming *timing; HTMLPerformanceTiming *timing;
} HTMLPerformance; } HTMLPerformance;
...@@ -2262,8 +2263,8 @@ static HRESULT WINAPI HTMLPerformance_get_navigation(IHTMLPerformance *iface, ...@@ -2262,8 +2263,8 @@ static HRESULT WINAPI HTMLPerformance_get_navigation(IHTMLPerformance *iface,
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
navigation->IHTMLPerformanceNavigation_iface.lpVtbl = &HTMLPerformanceNavigationVtbl; navigation->IHTMLPerformanceNavigation_iface.lpVtbl = &HTMLPerformanceNavigationVtbl;
navigation->timing = This->timing; navigation->window = This->window;
IHTMLPerformanceTiming_AddRef(&This->timing->IHTMLPerformanceTiming_iface); IHTMLWindow2_AddRef(&This->window->base.IHTMLWindow2_iface);
init_dispatch(&navigation->dispex, (IUnknown*)&navigation->IHTMLPerformanceNavigation_iface, init_dispatch(&navigation->dispex, (IUnknown*)&navigation->IHTMLPerformanceNavigation_iface,
&HTMLPerformanceNavigation_dispex, dispex_compat_mode(&This->dispex)); &HTMLPerformanceNavigation_dispex, dispex_compat_mode(&This->dispex));
...@@ -2323,6 +2324,8 @@ static inline HTMLPerformance *HTMLPerformance_from_DispatchEx(DispatchEx *iface ...@@ -2323,6 +2324,8 @@ static inline HTMLPerformance *HTMLPerformance_from_DispatchEx(DispatchEx *iface
static void HTMLPerformance_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb) static void HTMLPerformance_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{ {
HTMLPerformance *This = HTMLPerformance_from_DispatchEx(dispex); HTMLPerformance *This = HTMLPerformance_from_DispatchEx(dispex);
if(This->window)
note_cc_edge((nsISupports*)&This->window->base.IHTMLWindow2_iface, "window", cb);
if(This->navigation) if(This->navigation)
note_cc_edge((nsISupports*)This->navigation, "navigation", cb); note_cc_edge((nsISupports*)This->navigation, "navigation", cb);
if(This->timing) if(This->timing)
...@@ -2332,6 +2335,11 @@ static void HTMLPerformance_traverse(DispatchEx *dispex, nsCycleCollectionTraver ...@@ -2332,6 +2335,11 @@ static void HTMLPerformance_traverse(DispatchEx *dispex, nsCycleCollectionTraver
static void HTMLPerformance_unlink(DispatchEx *dispex) static void HTMLPerformance_unlink(DispatchEx *dispex)
{ {
HTMLPerformance *This = HTMLPerformance_from_DispatchEx(dispex); HTMLPerformance *This = HTMLPerformance_from_DispatchEx(dispex);
if(This->window) {
HTMLInnerWindow *window = This->window;
This->window = NULL;
IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
}
unlink_ref(&This->navigation); unlink_ref(&This->navigation);
if(This->timing) { if(This->timing) {
HTMLPerformanceTiming *timing = This->timing; HTMLPerformanceTiming *timing = This->timing;
...@@ -2373,6 +2381,8 @@ HRESULT create_performance(HTMLInnerWindow *window, IHTMLPerformance **ret) ...@@ -2373,6 +2381,8 @@ HRESULT create_performance(HTMLInnerWindow *window, IHTMLPerformance **ret)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
performance->IHTMLPerformance_iface.lpVtbl = &HTMLPerformanceVtbl; performance->IHTMLPerformance_iface.lpVtbl = &HTMLPerformanceVtbl;
performance->window = window;
IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
init_dispatch(&performance->dispex, (IUnknown*)&performance->IHTMLPerformance_iface, init_dispatch(&performance->dispex, (IUnknown*)&performance->IHTMLPerformance_iface,
&HTMLPerformance_dispex, compat_mode); &HTMLPerformance_dispex, compat_mode);
......
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