diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index 77829707102..077cbb2991e 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.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 \ No newline at end of file diff --git a/layout/base/src/makefile.win b/layout/base/src/makefile.win index dd85f7ebc2f..84452da4ea0 100644 --- a/layout/base/src/makefile.win +++ b/layout/base/src/makefile.win @@ -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 \ diff --git a/layout/base/src/nsPresContext.cpp b/layout/base/src/nsPresContext.cpp index 77829707102..077cbb2991e 100644 --- a/layout/base/src/nsPresContext.cpp +++ b/layout/base/src/nsPresContext.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 \ No newline at end of file diff --git a/layout/base/src/nsPresContext.h b/layout/base/src/nsPresContext.h index 1611c704d7d..729bc168fa1 100644 --- a/layout/base/src/nsPresContext.h +++ b/layout/base/src/nsPresContext.h @@ -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();