Convert some of nisheeth's debugging code into PR_LOG()'s so everyone can share. Implement the GetName() method for the dummy layout channel. r=nisheeth, sr=jst

This commit is contained in:
waterson%netscape.com 2001-04-13 23:24:25 +00:00
Родитель 5fb258f72f
Коммит e1850afc18
2 изменённых файлов: 46 добавлений и 16 удалений

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

@ -693,7 +693,8 @@ public:
// nsIRequest
NS_IMETHOD GetName(PRUnichar* *result) {
return NS_ERROR_NOT_IMPLEMENTED;
*result = ToNewUnicode(NS_LITERAL_STRING("about:layout-dummy-request"));
return NS_OK;
}
NS_IMETHOD IsPending(PRBool *_retval) { *_retval = PR_TRUE; return NS_OK; }
NS_IMETHOD GetStatus(nsresult *status) { *status = NS_OK; return NS_OK; }
@ -5643,13 +5644,26 @@ PresShell::ReflowCommandAdded(nsIReflowCommand* aRC)
aRC->SetFlags(flags);
mRCCreatedDuringLoad++;
#ifdef PR_LOGGING
if (PR_LOG_TEST(gLog, PR_LOG_DEBUG)) {
nsIFrame* target;
aRC->GetTarget(target);
nsCOMPtr<nsIAtom> type;
target->GetFrameType(getter_AddRefs(type));
nsAutoString typeStr;
type->ToString(typeStr);
PR_LOG(gLog, PR_LOG_DEBUG,
("presshell=%p, ReflowCommandAdded(%p) target=%p[%s] mRCCreatedDuringLoad=%d\n",
this, aRC, target, NS_ConvertUCS2toUTF8(typeStr).get(), mRCCreatedDuringLoad));
}
#endif
if (!mDummyLayoutRequest) {
AddDummyLayoutRequest();
}
#ifdef DEBUG_nisheeth
printf("presshell=%p, mRCCreatedDuringLoad=%d\n", this, mRCCreatedDuringLoad);
#endif
}
}
return NS_OK;
@ -5664,9 +5678,10 @@ PresShell::ReflowCommandRemoved(nsIReflowCommand* aRC)
aRC->GetFlags(&flags);
if (flags & NS_RC_CREATED_DURING_DOCUMENT_LOAD) {
mRCCreatedDuringLoad--;
#ifdef DEBUG_nisheeth
printf("presshell=%p, mRCCreatedDuringLoad=%d\n", this, mRCCreatedDuringLoad);
#endif
PR_LOG(gLog, PR_LOG_DEBUG,
("presshell=%p, ReflowCommandRemoved(%p) mRCCreatedDuringLoad=%d\n",
this, aRC, mRCCreatedDuringLoad));
}
}
return NS_OK;

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

@ -693,7 +693,8 @@ public:
// nsIRequest
NS_IMETHOD GetName(PRUnichar* *result) {
return NS_ERROR_NOT_IMPLEMENTED;
*result = ToNewUnicode(NS_LITERAL_STRING("about:layout-dummy-request"));
return NS_OK;
}
NS_IMETHOD IsPending(PRBool *_retval) { *_retval = PR_TRUE; return NS_OK; }
NS_IMETHOD GetStatus(nsresult *status) { *status = NS_OK; return NS_OK; }
@ -5643,13 +5644,26 @@ PresShell::ReflowCommandAdded(nsIReflowCommand* aRC)
aRC->SetFlags(flags);
mRCCreatedDuringLoad++;
#ifdef PR_LOGGING
if (PR_LOG_TEST(gLog, PR_LOG_DEBUG)) {
nsIFrame* target;
aRC->GetTarget(target);
nsCOMPtr<nsIAtom> type;
target->GetFrameType(getter_AddRefs(type));
nsAutoString typeStr;
type->ToString(typeStr);
PR_LOG(gLog, PR_LOG_DEBUG,
("presshell=%p, ReflowCommandAdded(%p) target=%p[%s] mRCCreatedDuringLoad=%d\n",
this, aRC, target, NS_ConvertUCS2toUTF8(typeStr).get(), mRCCreatedDuringLoad));
}
#endif
if (!mDummyLayoutRequest) {
AddDummyLayoutRequest();
}
#ifdef DEBUG_nisheeth
printf("presshell=%p, mRCCreatedDuringLoad=%d\n", this, mRCCreatedDuringLoad);
#endif
}
}
return NS_OK;
@ -5664,9 +5678,10 @@ PresShell::ReflowCommandRemoved(nsIReflowCommand* aRC)
aRC->GetFlags(&flags);
if (flags & NS_RC_CREATED_DURING_DOCUMENT_LOAD) {
mRCCreatedDuringLoad--;
#ifdef DEBUG_nisheeth
printf("presshell=%p, mRCCreatedDuringLoad=%d\n", this, mRCCreatedDuringLoad);
#endif
PR_LOG(gLog, PR_LOG_DEBUG,
("presshell=%p, ReflowCommandRemoved(%p) mRCCreatedDuringLoad=%d\n",
this, aRC, mRCCreatedDuringLoad));
}
}
return NS_OK;