Make nsPresContext implement the nsITimeRecorder interface. This interface is used by the pres shell to tell the pres context to stop the stopwatch that measures time spent in style resolution.

This commit is contained in:
nisheeth%netscape.com 1999-09-17 20:32:45 +00:00
Родитель 70f342ee82
Коммит 04cc0030fb
4 изменённых файлов: 71 добавлений и 1 удалений

Просмотреть файл

@ -1021,4 +1021,31 @@ nsPresContext::GetEventStateManager(nsIEventStateManager** aManager)
return NS_OK;
}
// nsITimeRecorder implementation
#ifdef RAPTOR_PERF_METRICS
NS_IMETHODIMP
nsPresContext::ResetTimer(PRUint32 aTimerID)
{
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::StartTimer(PRUint32 aTimerID)
{
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::StopTimer(PRUint32 aTimerID)
{
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::PrintTimer(PRUint32 aTimerID)
{
return NS_OK;
}
#endif

Просмотреть файл

@ -22,6 +22,10 @@ DEFINES=-D_IMPL_NS_LAYOUT -DWIN32_LEAN_AND_MEAN
!if defined(XP_NEW_SELECTION)
DEFINES = $(DEFINES) -DXP_NEW_SELECTION
!endif
!if defined(MOZ_PERF)
DEFINES = $(DEFINES) -DRAPTOR_PERF_METRICS
!endif
CPPSRCS = \
nsCommentNode.cpp \

Просмотреть файл

@ -1021,4 +1021,31 @@ nsPresContext::GetEventStateManager(nsIEventStateManager** aManager)
return NS_OK;
}
// nsITimeRecorder implementation
#ifdef RAPTOR_PERF_METRICS
NS_IMETHODIMP
nsPresContext::ResetTimer(PRUint32 aTimerID)
{
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::StartTimer(PRUint32 aTimerID)
{
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::StopTimer(PRUint32 aTimerID)
{
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::PrintTimer(PRUint32 aTimerID)
{
return NS_OK;
}
#endif

Просмотреть файл

@ -28,10 +28,18 @@
#include "nsIPref.h"
#include "nsIURL.h"
#include "nsIEventStateManager.h"
#ifdef RAPTOR_PERF_METRICS
#include "nsITimeRecorder.h"
#define NS_TIMER_STYLE_RESOLUTION 1
#endif
// Base class for concrete presentation context classes
class nsPresContext : public nsIPresContext {
class nsPresContext : public nsIPresContext
#ifdef RAPTOR_PERF_METRICS
, public nsITimeRecorder
#endif
{
public:
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
@ -115,6 +123,10 @@ public:
NS_IMETHOD GetDeviceContext(nsIDeviceContext** aResult) const;
NS_IMETHOD GetEventStateManager(nsIEventStateManager** aManager);
#ifdef RAPTOR_PERF_METRICS
NS_DECL_NSITIMERECORDER
#endif
protected:
nsPresContext();
virtual ~nsPresContext();