We now use the new RAPTOR_STOPWATCH_DEBUGTRACE macro to annotate all manipulations of the timers.

This commit is contained in:
nisheeth%netscape.com 1999-10-11 23:42:56 +00:00
Родитель ca7599a7f9
Коммит 7890852e87
7 изменённых файлов: 177 добавлений и 19 удалений

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

@ -616,6 +616,7 @@ nsIStyleContext* StyleSetImpl::ResolveStyleFor(nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
PRBool aForceUnique)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: StyleSetImpl::ResolveStyleFor(), this=%p\n", this));
NS_START_STOPWATCH(mStyleResolutionWatch)
nsIStyleContext* result = nsnull;
@ -659,6 +660,7 @@ nsIStyleContext* StyleSetImpl::ResolveStyleFor(nsIPresContext* aPresContext,
}
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: StyleSetImpl::ResolveStyleFor(), this=%p\n", this));
NS_STOP_STOPWATCH(mStyleResolutionWatch)
return result;
}
@ -704,6 +706,7 @@ nsIStyleContext* StyleSetImpl::ResolvePseudoStyleFor(nsIPresContext* aPresContex
nsIStyleContext* aParentContext,
PRBool aForceUnique)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: StyleSetImpl::ResolvePseudoStyleFor(), this=%p\n", this));
NS_START_STOPWATCH(mStyleResolutionWatch)
nsIStyleContext* result = nsnull;
@ -749,6 +752,7 @@ nsIStyleContext* StyleSetImpl::ResolvePseudoStyleFor(nsIPresContext* aPresContex
}
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: StyleSetImpl::ResolvePseudoStyleFor(), this=%p\n", this));
NS_STOP_STOPWATCH(mStyleResolutionWatch)
return result;
}
@ -759,6 +763,7 @@ nsIStyleContext* StyleSetImpl::ProbePseudoStyleFor(nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
PRBool aForceUnique)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: StyleSetImpl::ProbePseudoStyleFor(), this=%p\n", this));
NS_START_STOPWATCH(mStyleResolutionWatch)
nsIStyleContext* result = nsnull;
@ -802,7 +807,8 @@ nsIStyleContext* StyleSetImpl::ProbePseudoStyleFor(nsIPresContext* aPresContext,
}
}
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: StyleSetImpl::ProbePseudoStyleFor(), this=%p\n", this));
NS_STOP_STOPWATCH(mStyleResolutionWatch)
return result;
}

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

@ -271,10 +271,12 @@ public:
void NotifyBody() {
PRInt32 currentCount;
mBody->ChildCount(currentCount);
if (mBodyChildCount < currentCount) {
NS_SAVE_STOPWATCH_STATE(mWatch)
if (mBodyChildCount < currentCount) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Save and stop: nsHTMLContentSink::Notify()\n"));
NS_SAVE_STOPWATCH_STATE(mWatch)
NS_STOP_STOPWATCH(mWatch)
mDocument->ContentAppended(mBody, mBodyChildCount);
RAPTOR_STOPWATCH_DEBUGTRACE(("Restore: nsHTMLContentSink::Notify()\n"));
NS_RESTORE_STOPWATCH_STATE(mWatch)
}
mBodyChildCount = currentCount;
@ -1702,12 +1704,14 @@ HTMLContentSink::Init(nsIDocument* aDoc,
nsIURI* aURL,
nsIWebShell* aContainer)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Reset and start: nsHTMLContentSink::Init(), this=%p\n", this));
NS_RESET_AND_START_STOPWATCH(mWatch)
NS_PRECONDITION(nsnull != aDoc, "null ptr");
NS_PRECONDITION(nsnull != aURL, "null ptr");
NS_PRECONDITION(nsnull != aContainer, "null ptr");
if ((nsnull == aDoc) || (nsnull == aURL) || (nsnull == aContainer)) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::Init()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_ERROR_NULL_POINTER;
}
@ -1735,6 +1739,7 @@ HTMLContentSink::Init(nsIDocument* aDoc,
// Make root part
nsresult rv = NS_NewHTMLHtmlElement(&mRoot, nsHTMLAtoms::html);
if (NS_OK != rv) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::Init()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -1744,12 +1749,14 @@ HTMLContentSink::Init(nsIDocument* aDoc,
// Make head part
nsIAtom* atom = NS_NewAtom("head");
if (nsnull == atom) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::Init()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_ERROR_OUT_OF_MEMORY;
}
rv = NS_NewHTMLHeadElement(&mHead, atom);
NS_RELEASE(atom);
if (NS_OK != rv) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::Init()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -1766,6 +1773,7 @@ HTMLContentSink::Init(nsIDocument* aDoc,
this, spec));
nsCRT::free(spec);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::Init()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_OK;
}
@ -1783,8 +1791,9 @@ HTMLContentSink::DidBuildModel(PRInt32 aQualityLevel)
{
// NRA Dump stopwatch stop info here
#ifdef RAPTOR_PERF_METRICS
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::DidBuildModel(), this=%p\n", this));
NS_STOP_STOPWATCH(mWatch)
RAPTOR_STOPWATCH_TRACE(("Content creation time: "));
RAPTOR_STOPWATCH_TRACE(("Content creation time (this=%p): ", this));
mWatch.Print();
RAPTOR_STOPWATCH_TRACE(("\n"));
#endif
@ -1859,12 +1868,14 @@ HTMLContentSink::SetParser(nsIParser* aParser)
NS_IMETHODIMP
HTMLContentSink::BeginContext(PRInt32 aPosition)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::BeginContext()\n"));
NS_START_STOPWATCH(mWatch)
NS_PRECONDITION(aPosition > -1, "out of bounds");
// Create new context
SinkContext* sc = new SinkContext(this);
if (nsnull == sc) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::BeginContext()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_ERROR_OUT_OF_MEMORY;
}
@ -1878,6 +1889,7 @@ HTMLContentSink::BeginContext(PRInt32 aPosition)
mContextStack.AppendElement(mCurrentContext);
mCurrentContext = sc;
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::BeginContext()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_OK;
}
@ -1885,6 +1897,7 @@ HTMLContentSink::BeginContext(PRInt32 aPosition)
NS_IMETHODIMP
HTMLContentSink::EndContext(PRInt32 aPosition)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::EndContext()\n"));
NS_START_STOPWATCH(mWatch)
NS_PRECONDITION(mCurrentContext != nsnull && aPosition > -1, "non-existing context");
@ -1910,6 +1923,7 @@ HTMLContentSink::EndContext(PRInt32 aPosition)
mCurrentContext = sc;
mContextStack.RemoveElementAt(n);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::EndContext()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_OK;
}
@ -1918,6 +1932,7 @@ HTMLContentSink::EndContext(PRInt32 aPosition)
NS_IMETHODIMP
HTMLContentSink::SetTitle(const nsString& aValue)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::SetTitle()\n"));
NS_START_STOPWATCH(mWatch)
NS_ASSERTION(mCurrentContext == mHeadContext, "SetTitle not in head");
@ -1928,6 +1943,7 @@ HTMLContentSink::SetTitle(const nsString& aValue)
// If the title was already set then don't try to overwrite it
// when a new title is encountered - For backwards compatiblity
//*mTitle = aValue;
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::SetTitle()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_OK;
}
@ -1956,6 +1972,7 @@ HTMLContentSink::SetTitle(const nsString& aValue)
NS_RELEASE(it);
}
NS_RELEASE(atom);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::SetTitle()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_OK;
}
@ -1975,6 +1992,7 @@ HTMLContentSink::OpenHTML(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::CloseHTML(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::CloseHTML()\n"));
NS_START_STOPWATCH(mWatch)
SINK_TRACE_NODE(SINK_TRACE_CALLS,
"HTMLContentSink::CloseHTML", aNode, this);
@ -1983,6 +2001,7 @@ HTMLContentSink::CloseHTML(const nsIParserNode& aNode)
delete mHeadContext;
mHeadContext = nsnull;
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::CloseHTML()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_OK;
}
@ -1990,6 +2009,7 @@ HTMLContentSink::CloseHTML(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::OpenHead(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::OpenHead()\n"));
NS_START_STOPWATCH(mWatch)
SINK_TRACE_NODE(SINK_TRACE_CALLS,
"HTMLContentSink::OpenHead", aNode, this);
@ -1997,12 +2017,14 @@ HTMLContentSink::OpenHead(const nsIParserNode& aNode)
if (nsnull == mHeadContext) {
mHeadContext = new SinkContext(this);
if (nsnull == mHeadContext) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenHead()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_ERROR_OUT_OF_MEMORY;
}
mHeadContext->SetPreAppend(PR_TRUE);
rv = mHeadContext->Begin(eHTMLTag_head, mHead);
if (NS_OK != rv) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenHead()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2016,6 +2038,7 @@ HTMLContentSink::OpenHead(const nsIParserNode& aNode)
NS_IF_RELEASE(sco);
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenHead()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2023,12 +2046,14 @@ HTMLContentSink::OpenHead(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::CloseHead(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::CloseHead()\n"));
NS_START_STOPWATCH(mWatch)
SINK_TRACE_NODE(SINK_TRACE_CALLS,
"HTMLContentSink::CloseHead", aNode, this);
PRInt32 n = mContextStack.Count() - 1;
mCurrentContext = (SinkContext*) mContextStack.ElementAt(n);
mContextStack.RemoveElementAt(n);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::CloseHead()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_OK;
}
@ -2036,6 +2061,7 @@ HTMLContentSink::CloseHead(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::OpenBody(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::OpenBody()\n"));
NS_START_STOPWATCH(mWatch)
//NS_PRECONDITION(nsnull == mBody, "parser called OpenBody twice");
@ -2046,6 +2072,7 @@ HTMLContentSink::OpenBody(const nsIParserNode& aNode)
nsIScriptContextOwner* sco = mDocument->GetScriptContextOwner();
AddAttributes(aNode,mBody,sco,PR_TRUE);
NS_IF_RELEASE(sco);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenBody()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_OK;
}
@ -2056,6 +2083,7 @@ HTMLContentSink::OpenBody(const nsIParserNode& aNode)
nsresult rv = mCurrentContext->OpenContainer(aNode);
mCurrentContext->SetPreAppend(PR_FALSE);
if (NS_OK != rv) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenBody()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2063,6 +2091,7 @@ HTMLContentSink::OpenBody(const nsIParserNode& aNode)
mBodyChildCount = 0;
NS_ADDREF(mBody);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenBody()\n"));
NS_STOP_STOPWATCH(mWatch)
StartLayout();
return NS_OK;
@ -2071,6 +2100,7 @@ HTMLContentSink::OpenBody(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::CloseBody(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::CloseBody()\n"));
NS_START_STOPWATCH(mWatch)
SINK_TRACE_NODE(SINK_TRACE_CALLS,
"HTMLContentSink::CloseBody", aNode, this);
@ -2078,6 +2108,7 @@ HTMLContentSink::CloseBody(const nsIParserNode& aNode)
PRBool didFlush;
nsresult rv = mCurrentContext->FlushText(&didFlush);
if (NS_OK != rv) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::CloseBody()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2088,6 +2119,7 @@ HTMLContentSink::CloseBody(const nsIParserNode& aNode)
NotifyBody();
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::CloseBody()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_OK;
}
@ -2095,6 +2127,7 @@ HTMLContentSink::CloseBody(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::OpenForm(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::OpenForm()\n"));
NS_START_STOPWATCH(mWatch)
nsresult result = NS_OK;
nsIHTMLContent* content = nsnull;
@ -2147,7 +2180,8 @@ HTMLContentSink::OpenForm(const nsIParserNode& aNode)
if (mCurrentForm) {
mHTMLDocument->AddForm(mCurrentForm);
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenForm()\n"));
NS_STOP_STOPWATCH(mWatch)
return result;
}
@ -2157,6 +2191,7 @@ HTMLContentSink::OpenForm(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::CloseForm(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::CloseForm()\n"));
NS_START_STOPWATCH(mWatch)
nsresult result = NS_OK;
@ -2182,6 +2217,7 @@ HTMLContentSink::CloseForm(const nsIParserNode& aNode)
NS_RELEASE(mCurrentForm);
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::CloseForm()\n"));
NS_STOP_STOPWATCH(mWatch)
return result;
}
@ -2189,6 +2225,7 @@ HTMLContentSink::CloseForm(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::OpenFrameset(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::OpenFrameset()\n"));
NS_START_STOPWATCH(mWatch)
SINK_TRACE_NODE(SINK_TRACE_CALLS,
"HTMLContentSink::OpenFrameset", aNode, this);
@ -2199,6 +2236,7 @@ HTMLContentSink::OpenFrameset(const nsIParserNode& aNode)
NS_ADDREF(mFrameset);
}
mInMonolithicContainer++;
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenFrameset()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2206,6 +2244,7 @@ HTMLContentSink::OpenFrameset(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::CloseFrameset(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::CloseFrameset()\n"));
NS_START_STOPWATCH(mWatch)
SINK_TRACE_NODE(SINK_TRACE_CALLS,
"HTMLContentSink::CloseFrameset", aNode, this);
@ -2214,6 +2253,7 @@ HTMLContentSink::CloseFrameset(const nsIParserNode& aNode)
nsIHTMLContent* fs = sc->mStack[sc->mStackPos-1].mContent;
PRBool done = fs == mFrameset;
nsresult rv = sc->CloseContainer(aNode);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::CloseFrameset()\n"));
NS_STOP_STOPWATCH(mWatch)
if (done) {
StartLayout();
@ -2224,6 +2264,7 @@ HTMLContentSink::CloseFrameset(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::OpenMap(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::OpenMap()\n"));
NS_START_STOPWATCH(mWatch)
nsresult rv = NS_OK;
SINK_TRACE_NODE(SINK_TRACE_CALLS,
@ -2233,6 +2274,7 @@ HTMLContentSink::OpenMap(const nsIParserNode& aNode)
// HTML 4.0 says that MAP elements can have block content
// as children.
rv = mCurrentContext->OpenContainer(aNode);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenMap()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2240,6 +2282,7 @@ HTMLContentSink::OpenMap(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::CloseMap(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::CloseMap()\n"));
NS_START_STOPWATCH(mWatch)
nsresult rv = NS_OK;
SINK_TRACE_NODE(SINK_TRACE_CALLS,
@ -2248,6 +2291,7 @@ HTMLContentSink::CloseMap(const nsIParserNode& aNode)
NS_IF_RELEASE(mCurrentDOMMap);
rv = mCurrentContext->CloseContainer(aNode);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::CloseMap()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2255,14 +2299,17 @@ HTMLContentSink::CloseMap(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::OpenContainer(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::OpenContainer()\n"));
NS_START_STOPWATCH(mWatch)
nsresult rv = NS_OK;
// XXX work around parser bug
if (eHTMLTag_frameset == aNode.GetNodeType()) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenContainer()\n"));
NS_STOP_STOPWATCH(mWatch)
return OpenFrameset(aNode);
}
rv = mCurrentContext->OpenContainer(aNode);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenContainer()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2270,14 +2317,17 @@ HTMLContentSink::OpenContainer(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::CloseContainer(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::CloseContainer()\n"));
NS_START_STOPWATCH(mWatch)
nsresult rv = NS_OK;
// XXX work around parser bug
if (eHTMLTag_frameset == aNode.GetNodeType()) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::CloseContainer()\n"));
NS_STOP_STOPWATCH(mWatch)
return CloseFrameset(aNode);
}
rv = mCurrentContext->CloseContainer(aNode);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::CloseContainer()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2285,6 +2335,7 @@ HTMLContentSink::CloseContainer(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::AddLeaf(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::AddLeaf()\n"));
NS_START_STOPWATCH(mWatch)
nsresult rv;
@ -2324,6 +2375,7 @@ HTMLContentSink::AddLeaf(const nsIParserNode& aNode)
break;
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::AddLeaf()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2335,9 +2387,11 @@ HTMLContentSink::AddLeaf(const nsIParserNode& aNode)
* @return error code
*/
nsresult HTMLContentSink::AddComment(const nsIParserNode& aNode) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::AddComment()\n"));
NS_START_STOPWATCH(mWatch)
nsresult rv = NS_OK;
rv = mCurrentContext->AddComment(aNode);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::AddComment()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2349,7 +2403,7 @@ nsresult HTMLContentSink::AddComment(const nsIParserNode& aNode) {
* @return error code
*/
nsresult HTMLContentSink::AddProcessingInstruction(const nsIParserNode& aNode) {
nsresult result= NS_OK;
nsresult result= NS_OK;
NS_START_STOPWATCH(mWatch)
// Implementation of AddProcessingInstruction() should start here
@ -2366,10 +2420,12 @@ NS_IMETHODIMP
HTMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
nsresult rv = NS_OK;
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::AddDocTypeDecl()\n"));
NS_START_STOPWATCH(mWatch)
rv=mHTMLDocument->AddDocTypeDecl(aNode.GetText(),(nsDTDMode)aMode);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::AddDocTypeDecl()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -3393,6 +3449,7 @@ HTMLContentSink::ProcessSCRIPTTag(const nsIParserNode& aNode)
// Don't include script loading and evaluation in the stopwatch
// that is measuring content creation time
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::ProcessSCRIPTTag()\n"));
NS_STOP_STOPWATCH(mWatch)
// Don't process scripts that aren't JavaScript and don't process

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

@ -828,6 +828,7 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
}
if (nsnull != root) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Reset and start: Frame Creation: PresShell::InitialReflow(), this=%p\n", this));
NS_RESET_AND_START_STOPWATCH(mFrameCreationWatch)
if (nsnull == mRootFrame) {
// Have style sheet processor construct a frame for the
@ -840,10 +841,12 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
mStyleSet->ContentInserted(mPresContext, nsnull, root, 0);
NS_RELEASE(root);
VERIFY_STYLE_TREE;
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: Frame Creation: PresShell::InitialReflow(), this=%p\n", this));
NS_STOP_STOPWATCH(mFrameCreationWatch)
}
if (nsnull != mRootFrame) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Reset and start: Reflow: PresShell::InitialReflow(), this=%p\n", this));
NS_RESET_AND_START_STOPWATCH(mReflowWatch)
// Kick off a top-down reflow
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
@ -883,6 +886,7 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
}
NS_IF_RELEASE(rcx);
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, ("exit nsPresShell::InitialReflow"));
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: Reflow: PresShell::InitialReflow(), this=%p\n", this));
NS_STOP_STOPWATCH(mReflowWatch)
}
@ -1158,6 +1162,7 @@ PresShell::BeginLoad(nsIDocument *aDocument)
nsresult rv = NS_OK;
nsCOMPtr<nsITimeRecorder> watch = do_QueryInterface(mStyleSet, &rv);
if (NS_SUCCEEDED(rv) && watch) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Reset: Style Resolution: PresShell::BeginLoad(), this=%p\n", this));
watch->ResetTimer(NS_TIMER_STYLE_RESOLUTION);
}
#endif
@ -1169,12 +1174,15 @@ PresShell::EndLoad(nsIDocument *aDocument)
{
#ifdef RAPTOR_PERF_METRICS
// Dump reflow, style resolution and frame construction times here.
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: Reflow: PresShell::EndLoad(), this=%p\n", this));
NS_STOP_STOPWATCH(mReflowWatch)
RAPTOR_STOPWATCH_TRACE(("Reflow time: "));
RAPTOR_STOPWATCH_TRACE(("Reflow time (this=%p): ", this));
mReflowWatch.Print();
RAPTOR_STOPWATCH_TRACE(("\n"));
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: Frame Creation: PresShell::EndLoad(), this=%p\n", this));
NS_STOP_STOPWATCH(mFrameCreationWatch)
RAPTOR_STOPWATCH_TRACE(("Frame construction plus style resolution time: "));
RAPTOR_STOPWATCH_TRACE(("Frame construction plus style resolution time (this=%p): ", this));
mFrameCreationWatch.Print();
RAPTOR_STOPWATCH_TRACE(("\n"));
@ -1182,8 +1190,9 @@ PresShell::EndLoad(nsIDocument *aDocument)
nsresult rv = NS_OK;
nsCOMPtr<nsITimeRecorder> watch = do_QueryInterface(mStyleSet, &rv);
if (NS_SUCCEEDED(rv) && watch) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: Style Resolution: PresShell::EndLoad(), this=%p\n", this));
watch->StopTimer(NS_TIMER_STYLE_RESOLUTION);
RAPTOR_STOPWATCH_TRACE(("Style resolution time: "));
RAPTOR_STOPWATCH_TRACE(("Style resolution time (this=%p): ", this));
watch->PrintTimer(NS_TIMER_STYLE_RESOLUTION);
RAPTOR_STOPWATCH_TRACE(("\n"));
}
@ -1253,6 +1262,7 @@ PresShell::CancelReflowCommand(nsIFrame* aTargetFrame)
NS_IMETHODIMP
PresShell::ProcessReflowCommands()
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: Reflow: PresShell::ProcessReflowCommands(), this=%p\n", this));
NS_START_STOPWATCH(mReflowWatch)
if (0 != mReflowCommands.Count()) {
nsHTMLReflowMetrics desiredSize(nsnull);
@ -1316,6 +1326,7 @@ PresShell::ProcessReflowCommands()
#endif
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: Reflow: PresShell::ProcessReflowCommands(), this=%p\n", this));
NS_STOP_STOPWATCH(mReflowWatch)
return NS_OK;
}
@ -1704,6 +1715,7 @@ PresShell::ContentAppended(nsIDocument *aDocument,
PRInt32 aNewIndexInContainer)
{
EnterReflowLock();
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: Frame Creation: PresShell::ContentAppended(), this=%p\n", this));
NS_START_STOPWATCH(mFrameCreationWatch)
nsresult rv = mStyleSet->ContentAppended(mPresContext, aContainer, aNewIndexInContainer);
VERIFY_STYLE_TREE;
@ -1718,6 +1730,7 @@ PresShell::ContentAppended(nsIDocument *aDocument,
mFrameManager->RestoreFrameState(frame, mHistoryState);
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: Frame Creation: PresShell::ContentAppended(), this=%p\n", this));
NS_STOP_STOPWATCH(mFrameCreationWatch)
ExitReflowLock();
return rv;

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

@ -616,6 +616,7 @@ nsIStyleContext* StyleSetImpl::ResolveStyleFor(nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
PRBool aForceUnique)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: StyleSetImpl::ResolveStyleFor(), this=%p\n", this));
NS_START_STOPWATCH(mStyleResolutionWatch)
nsIStyleContext* result = nsnull;
@ -659,6 +660,7 @@ nsIStyleContext* StyleSetImpl::ResolveStyleFor(nsIPresContext* aPresContext,
}
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: StyleSetImpl::ResolveStyleFor(), this=%p\n", this));
NS_STOP_STOPWATCH(mStyleResolutionWatch)
return result;
}
@ -704,6 +706,7 @@ nsIStyleContext* StyleSetImpl::ResolvePseudoStyleFor(nsIPresContext* aPresContex
nsIStyleContext* aParentContext,
PRBool aForceUnique)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: StyleSetImpl::ResolvePseudoStyleFor(), this=%p\n", this));
NS_START_STOPWATCH(mStyleResolutionWatch)
nsIStyleContext* result = nsnull;
@ -749,6 +752,7 @@ nsIStyleContext* StyleSetImpl::ResolvePseudoStyleFor(nsIPresContext* aPresContex
}
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: StyleSetImpl::ResolvePseudoStyleFor(), this=%p\n", this));
NS_STOP_STOPWATCH(mStyleResolutionWatch)
return result;
}
@ -759,6 +763,7 @@ nsIStyleContext* StyleSetImpl::ProbePseudoStyleFor(nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
PRBool aForceUnique)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: StyleSetImpl::ProbePseudoStyleFor(), this=%p\n", this));
NS_START_STOPWATCH(mStyleResolutionWatch)
nsIStyleContext* result = nsnull;
@ -802,7 +807,8 @@ nsIStyleContext* StyleSetImpl::ProbePseudoStyleFor(nsIPresContext* aPresContext,
}
}
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: StyleSetImpl::ProbePseudoStyleFor(), this=%p\n", this));
NS_STOP_STOPWATCH(mStyleResolutionWatch)
return result;
}

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

@ -828,6 +828,7 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
}
if (nsnull != root) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Reset and start: Frame Creation: PresShell::InitialReflow(), this=%p\n", this));
NS_RESET_AND_START_STOPWATCH(mFrameCreationWatch)
if (nsnull == mRootFrame) {
// Have style sheet processor construct a frame for the
@ -840,10 +841,12 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
mStyleSet->ContentInserted(mPresContext, nsnull, root, 0);
NS_RELEASE(root);
VERIFY_STYLE_TREE;
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: Frame Creation: PresShell::InitialReflow(), this=%p\n", this));
NS_STOP_STOPWATCH(mFrameCreationWatch)
}
if (nsnull != mRootFrame) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Reset and start: Reflow: PresShell::InitialReflow(), this=%p\n", this));
NS_RESET_AND_START_STOPWATCH(mReflowWatch)
// Kick off a top-down reflow
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
@ -883,6 +886,7 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
}
NS_IF_RELEASE(rcx);
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, ("exit nsPresShell::InitialReflow"));
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: Reflow: PresShell::InitialReflow(), this=%p\n", this));
NS_STOP_STOPWATCH(mReflowWatch)
}
@ -1158,6 +1162,7 @@ PresShell::BeginLoad(nsIDocument *aDocument)
nsresult rv = NS_OK;
nsCOMPtr<nsITimeRecorder> watch = do_QueryInterface(mStyleSet, &rv);
if (NS_SUCCEEDED(rv) && watch) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Reset: Style Resolution: PresShell::BeginLoad(), this=%p\n", this));
watch->ResetTimer(NS_TIMER_STYLE_RESOLUTION);
}
#endif
@ -1169,12 +1174,15 @@ PresShell::EndLoad(nsIDocument *aDocument)
{
#ifdef RAPTOR_PERF_METRICS
// Dump reflow, style resolution and frame construction times here.
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: Reflow: PresShell::EndLoad(), this=%p\n", this));
NS_STOP_STOPWATCH(mReflowWatch)
RAPTOR_STOPWATCH_TRACE(("Reflow time: "));
RAPTOR_STOPWATCH_TRACE(("Reflow time (this=%p): ", this));
mReflowWatch.Print();
RAPTOR_STOPWATCH_TRACE(("\n"));
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: Frame Creation: PresShell::EndLoad(), this=%p\n", this));
NS_STOP_STOPWATCH(mFrameCreationWatch)
RAPTOR_STOPWATCH_TRACE(("Frame construction plus style resolution time: "));
RAPTOR_STOPWATCH_TRACE(("Frame construction plus style resolution time (this=%p): ", this));
mFrameCreationWatch.Print();
RAPTOR_STOPWATCH_TRACE(("\n"));
@ -1182,8 +1190,9 @@ PresShell::EndLoad(nsIDocument *aDocument)
nsresult rv = NS_OK;
nsCOMPtr<nsITimeRecorder> watch = do_QueryInterface(mStyleSet, &rv);
if (NS_SUCCEEDED(rv) && watch) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: Style Resolution: PresShell::EndLoad(), this=%p\n", this));
watch->StopTimer(NS_TIMER_STYLE_RESOLUTION);
RAPTOR_STOPWATCH_TRACE(("Style resolution time: "));
RAPTOR_STOPWATCH_TRACE(("Style resolution time (this=%p): ", this));
watch->PrintTimer(NS_TIMER_STYLE_RESOLUTION);
RAPTOR_STOPWATCH_TRACE(("\n"));
}
@ -1253,6 +1262,7 @@ PresShell::CancelReflowCommand(nsIFrame* aTargetFrame)
NS_IMETHODIMP
PresShell::ProcessReflowCommands()
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: Reflow: PresShell::ProcessReflowCommands(), this=%p\n", this));
NS_START_STOPWATCH(mReflowWatch)
if (0 != mReflowCommands.Count()) {
nsHTMLReflowMetrics desiredSize(nsnull);
@ -1316,6 +1326,7 @@ PresShell::ProcessReflowCommands()
#endif
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: Reflow: PresShell::ProcessReflowCommands(), this=%p\n", this));
NS_STOP_STOPWATCH(mReflowWatch)
return NS_OK;
}
@ -1704,6 +1715,7 @@ PresShell::ContentAppended(nsIDocument *aDocument,
PRInt32 aNewIndexInContainer)
{
EnterReflowLock();
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: Frame Creation: PresShell::ContentAppended(), this=%p\n", this));
NS_START_STOPWATCH(mFrameCreationWatch)
nsresult rv = mStyleSet->ContentAppended(mPresContext, aContainer, aNewIndexInContainer);
VERIFY_STYLE_TREE;
@ -1718,6 +1730,7 @@ PresShell::ContentAppended(nsIDocument *aDocument,
mFrameManager->RestoreFrameState(frame, mHistoryState);
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: Frame Creation: PresShell::ContentAppended(), this=%p\n", this));
NS_STOP_STOPWATCH(mFrameCreationWatch)
ExitReflowLock();
return rv;

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

@ -271,10 +271,12 @@ public:
void NotifyBody() {
PRInt32 currentCount;
mBody->ChildCount(currentCount);
if (mBodyChildCount < currentCount) {
NS_SAVE_STOPWATCH_STATE(mWatch)
if (mBodyChildCount < currentCount) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Save and stop: nsHTMLContentSink::Notify()\n"));
NS_SAVE_STOPWATCH_STATE(mWatch)
NS_STOP_STOPWATCH(mWatch)
mDocument->ContentAppended(mBody, mBodyChildCount);
RAPTOR_STOPWATCH_DEBUGTRACE(("Restore: nsHTMLContentSink::Notify()\n"));
NS_RESTORE_STOPWATCH_STATE(mWatch)
}
mBodyChildCount = currentCount;
@ -1702,12 +1704,14 @@ HTMLContentSink::Init(nsIDocument* aDoc,
nsIURI* aURL,
nsIWebShell* aContainer)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Reset and start: nsHTMLContentSink::Init(), this=%p\n", this));
NS_RESET_AND_START_STOPWATCH(mWatch)
NS_PRECONDITION(nsnull != aDoc, "null ptr");
NS_PRECONDITION(nsnull != aURL, "null ptr");
NS_PRECONDITION(nsnull != aContainer, "null ptr");
if ((nsnull == aDoc) || (nsnull == aURL) || (nsnull == aContainer)) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::Init()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_ERROR_NULL_POINTER;
}
@ -1735,6 +1739,7 @@ HTMLContentSink::Init(nsIDocument* aDoc,
// Make root part
nsresult rv = NS_NewHTMLHtmlElement(&mRoot, nsHTMLAtoms::html);
if (NS_OK != rv) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::Init()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -1744,12 +1749,14 @@ HTMLContentSink::Init(nsIDocument* aDoc,
// Make head part
nsIAtom* atom = NS_NewAtom("head");
if (nsnull == atom) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::Init()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_ERROR_OUT_OF_MEMORY;
}
rv = NS_NewHTMLHeadElement(&mHead, atom);
NS_RELEASE(atom);
if (NS_OK != rv) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::Init()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -1766,6 +1773,7 @@ HTMLContentSink::Init(nsIDocument* aDoc,
this, spec));
nsCRT::free(spec);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::Init()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_OK;
}
@ -1783,8 +1791,9 @@ HTMLContentSink::DidBuildModel(PRInt32 aQualityLevel)
{
// NRA Dump stopwatch stop info here
#ifdef RAPTOR_PERF_METRICS
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::DidBuildModel(), this=%p\n", this));
NS_STOP_STOPWATCH(mWatch)
RAPTOR_STOPWATCH_TRACE(("Content creation time: "));
RAPTOR_STOPWATCH_TRACE(("Content creation time (this=%p): ", this));
mWatch.Print();
RAPTOR_STOPWATCH_TRACE(("\n"));
#endif
@ -1859,12 +1868,14 @@ HTMLContentSink::SetParser(nsIParser* aParser)
NS_IMETHODIMP
HTMLContentSink::BeginContext(PRInt32 aPosition)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::BeginContext()\n"));
NS_START_STOPWATCH(mWatch)
NS_PRECONDITION(aPosition > -1, "out of bounds");
// Create new context
SinkContext* sc = new SinkContext(this);
if (nsnull == sc) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::BeginContext()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_ERROR_OUT_OF_MEMORY;
}
@ -1878,6 +1889,7 @@ HTMLContentSink::BeginContext(PRInt32 aPosition)
mContextStack.AppendElement(mCurrentContext);
mCurrentContext = sc;
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::BeginContext()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_OK;
}
@ -1885,6 +1897,7 @@ HTMLContentSink::BeginContext(PRInt32 aPosition)
NS_IMETHODIMP
HTMLContentSink::EndContext(PRInt32 aPosition)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::EndContext()\n"));
NS_START_STOPWATCH(mWatch)
NS_PRECONDITION(mCurrentContext != nsnull && aPosition > -1, "non-existing context");
@ -1910,6 +1923,7 @@ HTMLContentSink::EndContext(PRInt32 aPosition)
mCurrentContext = sc;
mContextStack.RemoveElementAt(n);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::EndContext()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_OK;
}
@ -1918,6 +1932,7 @@ HTMLContentSink::EndContext(PRInt32 aPosition)
NS_IMETHODIMP
HTMLContentSink::SetTitle(const nsString& aValue)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::SetTitle()\n"));
NS_START_STOPWATCH(mWatch)
NS_ASSERTION(mCurrentContext == mHeadContext, "SetTitle not in head");
@ -1928,6 +1943,7 @@ HTMLContentSink::SetTitle(const nsString& aValue)
// If the title was already set then don't try to overwrite it
// when a new title is encountered - For backwards compatiblity
//*mTitle = aValue;
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::SetTitle()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_OK;
}
@ -1956,6 +1972,7 @@ HTMLContentSink::SetTitle(const nsString& aValue)
NS_RELEASE(it);
}
NS_RELEASE(atom);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::SetTitle()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_OK;
}
@ -1975,6 +1992,7 @@ HTMLContentSink::OpenHTML(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::CloseHTML(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::CloseHTML()\n"));
NS_START_STOPWATCH(mWatch)
SINK_TRACE_NODE(SINK_TRACE_CALLS,
"HTMLContentSink::CloseHTML", aNode, this);
@ -1983,6 +2001,7 @@ HTMLContentSink::CloseHTML(const nsIParserNode& aNode)
delete mHeadContext;
mHeadContext = nsnull;
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::CloseHTML()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_OK;
}
@ -1990,6 +2009,7 @@ HTMLContentSink::CloseHTML(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::OpenHead(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::OpenHead()\n"));
NS_START_STOPWATCH(mWatch)
SINK_TRACE_NODE(SINK_TRACE_CALLS,
"HTMLContentSink::OpenHead", aNode, this);
@ -1997,12 +2017,14 @@ HTMLContentSink::OpenHead(const nsIParserNode& aNode)
if (nsnull == mHeadContext) {
mHeadContext = new SinkContext(this);
if (nsnull == mHeadContext) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenHead()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_ERROR_OUT_OF_MEMORY;
}
mHeadContext->SetPreAppend(PR_TRUE);
rv = mHeadContext->Begin(eHTMLTag_head, mHead);
if (NS_OK != rv) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenHead()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2016,6 +2038,7 @@ HTMLContentSink::OpenHead(const nsIParserNode& aNode)
NS_IF_RELEASE(sco);
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenHead()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2023,12 +2046,14 @@ HTMLContentSink::OpenHead(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::CloseHead(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::CloseHead()\n"));
NS_START_STOPWATCH(mWatch)
SINK_TRACE_NODE(SINK_TRACE_CALLS,
"HTMLContentSink::CloseHead", aNode, this);
PRInt32 n = mContextStack.Count() - 1;
mCurrentContext = (SinkContext*) mContextStack.ElementAt(n);
mContextStack.RemoveElementAt(n);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::CloseHead()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_OK;
}
@ -2036,6 +2061,7 @@ HTMLContentSink::CloseHead(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::OpenBody(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::OpenBody()\n"));
NS_START_STOPWATCH(mWatch)
//NS_PRECONDITION(nsnull == mBody, "parser called OpenBody twice");
@ -2046,6 +2072,7 @@ HTMLContentSink::OpenBody(const nsIParserNode& aNode)
nsIScriptContextOwner* sco = mDocument->GetScriptContextOwner();
AddAttributes(aNode,mBody,sco,PR_TRUE);
NS_IF_RELEASE(sco);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenBody()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_OK;
}
@ -2056,6 +2083,7 @@ HTMLContentSink::OpenBody(const nsIParserNode& aNode)
nsresult rv = mCurrentContext->OpenContainer(aNode);
mCurrentContext->SetPreAppend(PR_FALSE);
if (NS_OK != rv) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenBody()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2063,6 +2091,7 @@ HTMLContentSink::OpenBody(const nsIParserNode& aNode)
mBodyChildCount = 0;
NS_ADDREF(mBody);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenBody()\n"));
NS_STOP_STOPWATCH(mWatch)
StartLayout();
return NS_OK;
@ -2071,6 +2100,7 @@ HTMLContentSink::OpenBody(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::CloseBody(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::CloseBody()\n"));
NS_START_STOPWATCH(mWatch)
SINK_TRACE_NODE(SINK_TRACE_CALLS,
"HTMLContentSink::CloseBody", aNode, this);
@ -2078,6 +2108,7 @@ HTMLContentSink::CloseBody(const nsIParserNode& aNode)
PRBool didFlush;
nsresult rv = mCurrentContext->FlushText(&didFlush);
if (NS_OK != rv) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::CloseBody()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2088,6 +2119,7 @@ HTMLContentSink::CloseBody(const nsIParserNode& aNode)
NotifyBody();
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::CloseBody()\n"));
NS_STOP_STOPWATCH(mWatch)
return NS_OK;
}
@ -2095,6 +2127,7 @@ HTMLContentSink::CloseBody(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::OpenForm(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::OpenForm()\n"));
NS_START_STOPWATCH(mWatch)
nsresult result = NS_OK;
nsIHTMLContent* content = nsnull;
@ -2147,7 +2180,8 @@ HTMLContentSink::OpenForm(const nsIParserNode& aNode)
if (mCurrentForm) {
mHTMLDocument->AddForm(mCurrentForm);
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenForm()\n"));
NS_STOP_STOPWATCH(mWatch)
return result;
}
@ -2157,6 +2191,7 @@ HTMLContentSink::OpenForm(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::CloseForm(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::CloseForm()\n"));
NS_START_STOPWATCH(mWatch)
nsresult result = NS_OK;
@ -2182,6 +2217,7 @@ HTMLContentSink::CloseForm(const nsIParserNode& aNode)
NS_RELEASE(mCurrentForm);
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::CloseForm()\n"));
NS_STOP_STOPWATCH(mWatch)
return result;
}
@ -2189,6 +2225,7 @@ HTMLContentSink::CloseForm(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::OpenFrameset(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::OpenFrameset()\n"));
NS_START_STOPWATCH(mWatch)
SINK_TRACE_NODE(SINK_TRACE_CALLS,
"HTMLContentSink::OpenFrameset", aNode, this);
@ -2199,6 +2236,7 @@ HTMLContentSink::OpenFrameset(const nsIParserNode& aNode)
NS_ADDREF(mFrameset);
}
mInMonolithicContainer++;
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenFrameset()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2206,6 +2244,7 @@ HTMLContentSink::OpenFrameset(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::CloseFrameset(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::CloseFrameset()\n"));
NS_START_STOPWATCH(mWatch)
SINK_TRACE_NODE(SINK_TRACE_CALLS,
"HTMLContentSink::CloseFrameset", aNode, this);
@ -2214,6 +2253,7 @@ HTMLContentSink::CloseFrameset(const nsIParserNode& aNode)
nsIHTMLContent* fs = sc->mStack[sc->mStackPos-1].mContent;
PRBool done = fs == mFrameset;
nsresult rv = sc->CloseContainer(aNode);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::CloseFrameset()\n"));
NS_STOP_STOPWATCH(mWatch)
if (done) {
StartLayout();
@ -2224,6 +2264,7 @@ HTMLContentSink::CloseFrameset(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::OpenMap(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::OpenMap()\n"));
NS_START_STOPWATCH(mWatch)
nsresult rv = NS_OK;
SINK_TRACE_NODE(SINK_TRACE_CALLS,
@ -2233,6 +2274,7 @@ HTMLContentSink::OpenMap(const nsIParserNode& aNode)
// HTML 4.0 says that MAP elements can have block content
// as children.
rv = mCurrentContext->OpenContainer(aNode);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenMap()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2240,6 +2282,7 @@ HTMLContentSink::OpenMap(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::CloseMap(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::CloseMap()\n"));
NS_START_STOPWATCH(mWatch)
nsresult rv = NS_OK;
SINK_TRACE_NODE(SINK_TRACE_CALLS,
@ -2248,6 +2291,7 @@ HTMLContentSink::CloseMap(const nsIParserNode& aNode)
NS_IF_RELEASE(mCurrentDOMMap);
rv = mCurrentContext->CloseContainer(aNode);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::CloseMap()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2255,14 +2299,17 @@ HTMLContentSink::CloseMap(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::OpenContainer(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::OpenContainer()\n"));
NS_START_STOPWATCH(mWatch)
nsresult rv = NS_OK;
// XXX work around parser bug
if (eHTMLTag_frameset == aNode.GetNodeType()) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenContainer()\n"));
NS_STOP_STOPWATCH(mWatch)
return OpenFrameset(aNode);
}
rv = mCurrentContext->OpenContainer(aNode);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::OpenContainer()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2270,14 +2317,17 @@ HTMLContentSink::OpenContainer(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::CloseContainer(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::CloseContainer()\n"));
NS_START_STOPWATCH(mWatch)
nsresult rv = NS_OK;
// XXX work around parser bug
if (eHTMLTag_frameset == aNode.GetNodeType()) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::CloseContainer()\n"));
NS_STOP_STOPWATCH(mWatch)
return CloseFrameset(aNode);
}
rv = mCurrentContext->CloseContainer(aNode);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::CloseContainer()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2285,6 +2335,7 @@ HTMLContentSink::CloseContainer(const nsIParserNode& aNode)
NS_IMETHODIMP
HTMLContentSink::AddLeaf(const nsIParserNode& aNode)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::AddLeaf()\n"));
NS_START_STOPWATCH(mWatch)
nsresult rv;
@ -2324,6 +2375,7 @@ HTMLContentSink::AddLeaf(const nsIParserNode& aNode)
break;
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::AddLeaf()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2335,9 +2387,11 @@ HTMLContentSink::AddLeaf(const nsIParserNode& aNode)
* @return error code
*/
nsresult HTMLContentSink::AddComment(const nsIParserNode& aNode) {
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::AddComment()\n"));
NS_START_STOPWATCH(mWatch)
nsresult rv = NS_OK;
rv = mCurrentContext->AddComment(aNode);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::AddComment()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -2349,7 +2403,7 @@ nsresult HTMLContentSink::AddComment(const nsIParserNode& aNode) {
* @return error code
*/
nsresult HTMLContentSink::AddProcessingInstruction(const nsIParserNode& aNode) {
nsresult result= NS_OK;
nsresult result= NS_OK;
NS_START_STOPWATCH(mWatch)
// Implementation of AddProcessingInstruction() should start here
@ -2366,10 +2420,12 @@ NS_IMETHODIMP
HTMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
nsresult rv = NS_OK;
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: nsHTMLContentSink::AddDocTypeDecl()\n"));
NS_START_STOPWATCH(mWatch)
rv=mHTMLDocument->AddDocTypeDecl(aNode.GetText(),(nsDTDMode)aMode);
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::AddDocTypeDecl()\n"));
NS_STOP_STOPWATCH(mWatch)
return rv;
}
@ -3393,6 +3449,7 @@ HTMLContentSink::ProcessSCRIPTTag(const nsIParserNode& aNode)
// Don't include script loading and evaluation in the stopwatch
// that is measuring content creation time
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::ProcessSCRIPTTag()\n"));
NS_STOP_STOPWATCH(mWatch)
// Don't process scripts that aren't JavaScript and don't process

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

@ -616,6 +616,7 @@ nsIStyleContext* StyleSetImpl::ResolveStyleFor(nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
PRBool aForceUnique)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: StyleSetImpl::ResolveStyleFor(), this=%p\n", this));
NS_START_STOPWATCH(mStyleResolutionWatch)
nsIStyleContext* result = nsnull;
@ -659,6 +660,7 @@ nsIStyleContext* StyleSetImpl::ResolveStyleFor(nsIPresContext* aPresContext,
}
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: StyleSetImpl::ResolveStyleFor(), this=%p\n", this));
NS_STOP_STOPWATCH(mStyleResolutionWatch)
return result;
}
@ -704,6 +706,7 @@ nsIStyleContext* StyleSetImpl::ResolvePseudoStyleFor(nsIPresContext* aPresContex
nsIStyleContext* aParentContext,
PRBool aForceUnique)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: StyleSetImpl::ResolvePseudoStyleFor(), this=%p\n", this));
NS_START_STOPWATCH(mStyleResolutionWatch)
nsIStyleContext* result = nsnull;
@ -749,6 +752,7 @@ nsIStyleContext* StyleSetImpl::ResolvePseudoStyleFor(nsIPresContext* aPresContex
}
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: StyleSetImpl::ResolvePseudoStyleFor(), this=%p\n", this));
NS_STOP_STOPWATCH(mStyleResolutionWatch)
return result;
}
@ -759,6 +763,7 @@ nsIStyleContext* StyleSetImpl::ProbePseudoStyleFor(nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
PRBool aForceUnique)
{
RAPTOR_STOPWATCH_DEBUGTRACE(("Start: StyleSetImpl::ProbePseudoStyleFor(), this=%p\n", this));
NS_START_STOPWATCH(mStyleResolutionWatch)
nsIStyleContext* result = nsnull;
@ -802,7 +807,8 @@ nsIStyleContext* StyleSetImpl::ProbePseudoStyleFor(nsIPresContext* aPresContext,
}
}
}
RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: StyleSetImpl::ProbePseudoStyleFor(), this=%p\n", this));
NS_STOP_STOPWATCH(mStyleResolutionWatch)
return result;
}