Commit dcfdcfea authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Add IHTMLPerformance::navigation property implementation.

parent ced8ce55
......@@ -200,6 +200,7 @@ typedef struct EventTarget EventTarget;
XIID(IHTMLOptionElement) \
XIID(IHTMLOptionElementFactory) \
XIID(IHTMLPerformance) \
XIID(IHTMLPerformanceNavigation) \
XIID(IHTMLPluginsCollection) \
XIID(IHTMLRect) \
XIID(IHTMLScreen) \
......
......@@ -1323,8 +1323,160 @@ IOmNavigator *OmNavigator_Create(void)
typedef struct {
DispatchEx dispex;
IHTMLPerformanceNavigation IHTMLPerformanceNavigation_iface;
LONG ref;
} HTMLPerformanceNavigation;
static inline HTMLPerformanceNavigation *impl_from_IHTMLPerformanceNavigation(IHTMLPerformanceNavigation *iface)
{
return CONTAINING_RECORD(iface, HTMLPerformanceNavigation, IHTMLPerformanceNavigation_iface);
}
static HRESULT WINAPI HTMLPerformanceNavigation_QueryInterface(IHTMLPerformanceNavigation *iface, REFIID riid, void **ppv)
{
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
if(IsEqualGUID(&IID_IUnknown, riid)) {
*ppv = &This->IHTMLPerformanceNavigation_iface;
}else if(IsEqualGUID(&IID_IHTMLPerformanceNavigation, riid)) {
*ppv = &This->IHTMLPerformanceNavigation_iface;
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
return *ppv ? S_OK : E_NOINTERFACE;
}else {
WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
*ppv = NULL;
return E_NOINTERFACE;
}
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
static ULONG WINAPI HTMLPerformanceNavigation_AddRef(IHTMLPerformanceNavigation *iface)
{
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
LONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref);
return ref;
}
static ULONG WINAPI HTMLPerformanceNavigation_Release(IHTMLPerformanceNavigation *iface)
{
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
LONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref);
if(!ref) {
release_dispex(&This->dispex);
heap_free(This);
}
return ref;
}
static HRESULT WINAPI HTMLPerformanceNavigation_GetTypeInfoCount(IHTMLPerformanceNavigation *iface, UINT *pctinfo)
{
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
FIXME("(%p)->(%p)\n", This, pctinfo);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLPerformanceNavigation_GetTypeInfo(IHTMLPerformanceNavigation *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo)
{
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
}
static HRESULT WINAPI HTMLPerformanceNavigation_GetIDsOfNames(IHTMLPerformanceNavigation *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames,
LCID lcid, DISPID *rgDispId)
{
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
lcid, rgDispId);
}
static HRESULT WINAPI HTMLPerformanceNavigation_Invoke(IHTMLPerformanceNavigation *iface, DISPID dispIdMember,
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
pDispParams, pVarResult, pExcepInfo, puArgErr);
}
static HRESULT WINAPI HTMLPerformanceNavigation_get_type(IHTMLPerformanceNavigation *iface, ULONG *p)
{
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
FIXME("(%p)->(%p) returning TYPE_NAVIGATE\n", This, p);
*p = 0; /* TYPE_NAVIGATE */
return S_OK;
}
static HRESULT WINAPI HTMLPerformanceNavigation_get_redirectCount(IHTMLPerformanceNavigation *iface, ULONG *p)
{
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLPerformanceNavigation_toString(IHTMLPerformanceNavigation *iface, BSTR *string)
{
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
FIXME("(%p)->(%p)\n", This, string);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLPerformanceNavigation_toJSON(IHTMLPerformanceNavigation *iface, VARIANT *p)
{
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static const IHTMLPerformanceNavigationVtbl HTMLPerformanceNavigationVtbl = {
HTMLPerformanceNavigation_QueryInterface,
HTMLPerformanceNavigation_AddRef,
HTMLPerformanceNavigation_Release,
HTMLPerformanceNavigation_GetTypeInfoCount,
HTMLPerformanceNavigation_GetTypeInfo,
HTMLPerformanceNavigation_GetIDsOfNames,
HTMLPerformanceNavigation_Invoke,
HTMLPerformanceNavigation_get_type,
HTMLPerformanceNavigation_get_redirectCount,
HTMLPerformanceNavigation_toString,
HTMLPerformanceNavigation_toJSON
};
static const tid_t HTMLPerformanceNavigation_iface_tids[] = {
IHTMLPerformanceNavigation_tid,
0
};
static dispex_static_data_t HTMLPerformanceNavigation_dispex = {
NULL,
IHTMLPerformanceNavigation_tid,
HTMLPerformanceNavigation_iface_tids
};
typedef struct {
DispatchEx dispex;
IHTMLPerformance IHTMLPerformance_iface;
LONG ref;
IHTMLPerformanceNavigation *navigation;
} HTMLPerformance;
static inline HTMLPerformance *impl_from_IHTMLPerformance(IHTMLPerformance *iface)
......@@ -1372,6 +1524,8 @@ static ULONG WINAPI HTMLPerformance_Release(IHTMLPerformance *iface)
TRACE("(%p) ref=%d\n", This, ref);
if(!ref) {
if(This->navigation)
IHTMLPerformanceNavigation_Release(This->navigation);
release_dispex(&This->dispex);
heap_free(This);
}
......@@ -1418,8 +1572,26 @@ static HRESULT WINAPI HTMLPerformance_get_navigation(IHTMLPerformance *iface,
IHTMLPerformanceNavigation **p)
{
HTMLPerformance *This = impl_from_IHTMLPerformance(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
if(!This->navigation) {
HTMLPerformanceNavigation *navigation;
navigation = heap_alloc_zero(sizeof(*navigation));
if(!navigation)
return E_OUTOFMEMORY;
navigation->IHTMLPerformanceNavigation_iface.lpVtbl = &HTMLPerformanceNavigationVtbl;
navigation->ref = 1;
init_dispex(&navigation->dispex, (IUnknown*)&navigation->IHTMLPerformanceNavigation_iface,
&HTMLPerformanceNavigation_dispex);
This->navigation = &navigation->IHTMLPerformanceNavigation_iface;
}
IHTMLPerformanceNavigation_AddRef(*p = This->navigation);
return S_OK;
}
static HRESULT WINAPI HTMLPerformance_get_timing(IHTMLPerformance *iface, IHTMLPerformanceTiming **p)
......
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