From ba965a8d7928a84c94aa696bed6b34dd2044ed8c Mon Sep 17 00:00:00 2001 From: "nisheeth%netscape.com" Date: Mon, 20 Sep 1999 06:55:24 +0000 Subject: [PATCH] Add calls to reset and print the stopwatch maintained by the styleset for tracking style resolution time. --- layout/base/nsPresShell.cpp | 19 +++++++++++++++++-- layout/html/base/src/nsPresShell.cpp | 19 +++++++++++++++++-- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 1ebd13e45e84..717b1cdfc76a 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -1147,7 +1147,15 @@ PresShell::EndUpdate(nsIDocument *aDocument) NS_IMETHODIMP PresShell::BeginLoad(nsIDocument *aDocument) -{ +{ +#ifdef RAPTOR_PERF_METRICS + // Reset style resolution stopwatch maintained by style set + nsresult rv = NS_OK; + nsCOMPtr watch = do_QueryInterface(mStyleSet, &rv); + if (NS_SUCCEEDED(rv) && watch) { + watch->ResetTimer(NS_TIMER_STYLE_RESOLUTION); + } +#endif return NS_OK; } @@ -1155,13 +1163,20 @@ NS_IMETHODIMP PresShell::EndLoad(nsIDocument *aDocument) { #ifdef RAPTOR_PERF_METRICS - // NRA Dump reflow, style resolution and frame construction times here. + // Dump reflow, style resolution and frame construction times here. printf("Reflow time: "); mReflowWatch.Print(); printf("\n"); printf("Frame construction plus style resolution time: "); mFrameCreationWatch.Print(); printf("\n"); + + // Print style resolution stopwatch maintained by style set + nsresult rv = NS_OK; + nsCOMPtr watch = do_QueryInterface(mStyleSet, &rv); + if (NS_SUCCEEDED(rv) && watch) { + watch->PrintTimer(NS_TIMER_STYLE_RESOLUTION); + } #endif return NS_OK; } diff --git a/layout/html/base/src/nsPresShell.cpp b/layout/html/base/src/nsPresShell.cpp index 1ebd13e45e84..717b1cdfc76a 100644 --- a/layout/html/base/src/nsPresShell.cpp +++ b/layout/html/base/src/nsPresShell.cpp @@ -1147,7 +1147,15 @@ PresShell::EndUpdate(nsIDocument *aDocument) NS_IMETHODIMP PresShell::BeginLoad(nsIDocument *aDocument) -{ +{ +#ifdef RAPTOR_PERF_METRICS + // Reset style resolution stopwatch maintained by style set + nsresult rv = NS_OK; + nsCOMPtr watch = do_QueryInterface(mStyleSet, &rv); + if (NS_SUCCEEDED(rv) && watch) { + watch->ResetTimer(NS_TIMER_STYLE_RESOLUTION); + } +#endif return NS_OK; } @@ -1155,13 +1163,20 @@ NS_IMETHODIMP PresShell::EndLoad(nsIDocument *aDocument) { #ifdef RAPTOR_PERF_METRICS - // NRA Dump reflow, style resolution and frame construction times here. + // Dump reflow, style resolution and frame construction times here. printf("Reflow time: "); mReflowWatch.Print(); printf("\n"); printf("Frame construction plus style resolution time: "); mFrameCreationWatch.Print(); printf("\n"); + + // Print style resolution stopwatch maintained by style set + nsresult rv = NS_OK; + nsCOMPtr watch = do_QueryInterface(mStyleSet, &rv); + if (NS_SUCCEEDED(rv) && watch) { + watch->PrintTimer(NS_TIMER_STYLE_RESOLUTION); + } #endif return NS_OK; }