added debug code for netlib weirdage

This commit is contained in:
peterl%netscape.com 1999-07-24 19:04:22 +00:00
parent 600dc2854c
commit 4d52afc607
3 changed files with 42 additions and 0 deletions

View File

@ -313,6 +313,10 @@ public:
nsVoidArray mPendingAlternateSheets; // alternates waiting for load to start
nsHashtable mSheetMapTable; // map to insertion index arrays
#ifdef NS_DEBUG
PRBool mSyncCallback;
#endif
};
SheetLoadData::SheetLoadData(CSSLoaderImpl* aLoader, nsIURI* aURL,
@ -764,6 +768,10 @@ CSSLoaderImpl::DidLoadStyle(nsIUnicharStreamLoader* aLoader,
SheetLoadData* aLoadData,
nsresult aStatus)
{
#ifdef NS_DEBUG
NS_ASSERTION(! mSyncCallback, "getting synchronous callback from netlib");
#endif
if (NS_SUCCEEDED(aStatus) && (0 < aStyleData.Length()) && (mDocument)) {
nsresult result;
nsIUnicharInputStream* uin = nsnull;
@ -1068,12 +1076,18 @@ CSSLoaderImpl::LoadSheet(URLKey& aKey, SheetLoadData* aData)
#else
nsIURI* urlClone = CloneURL(aKey.mURL); // don't give the key to netlib, it munges it
if (urlClone) {
#endif
#ifdef NS_DEBUG
mSyncCallback = PR_TRUE;
#endif
result = NS_NewUnicharStreamLoader(&loader, urlClone,
#ifdef NECKO
nsCOMPtr<nsILoadGroup>(mDocument->GetDocumentLoadGroup()),
#endif
DoneLoadingStyle, aData);
#ifdef NS_DEBUG
mSyncCallback = PR_FALSE;
#endif
NS_RELEASE(urlClone);
if (NS_SUCCEEDED(result)) {
mLoadingSheets.Put(&aKey, aData);

View File

@ -313,6 +313,10 @@ public:
nsVoidArray mPendingAlternateSheets; // alternates waiting for load to start
nsHashtable mSheetMapTable; // map to insertion index arrays
#ifdef NS_DEBUG
PRBool mSyncCallback;
#endif
};
SheetLoadData::SheetLoadData(CSSLoaderImpl* aLoader, nsIURI* aURL,
@ -764,6 +768,10 @@ CSSLoaderImpl::DidLoadStyle(nsIUnicharStreamLoader* aLoader,
SheetLoadData* aLoadData,
nsresult aStatus)
{
#ifdef NS_DEBUG
NS_ASSERTION(! mSyncCallback, "getting synchronous callback from netlib");
#endif
if (NS_SUCCEEDED(aStatus) && (0 < aStyleData.Length()) && (mDocument)) {
nsresult result;
nsIUnicharInputStream* uin = nsnull;
@ -1068,12 +1076,18 @@ CSSLoaderImpl::LoadSheet(URLKey& aKey, SheetLoadData* aData)
#else
nsIURI* urlClone = CloneURL(aKey.mURL); // don't give the key to netlib, it munges it
if (urlClone) {
#endif
#ifdef NS_DEBUG
mSyncCallback = PR_TRUE;
#endif
result = NS_NewUnicharStreamLoader(&loader, urlClone,
#ifdef NECKO
nsCOMPtr<nsILoadGroup>(mDocument->GetDocumentLoadGroup()),
#endif
DoneLoadingStyle, aData);
#ifdef NS_DEBUG
mSyncCallback = PR_FALSE;
#endif
NS_RELEASE(urlClone);
if (NS_SUCCEEDED(result)) {
mLoadingSheets.Put(&aKey, aData);

View File

@ -313,6 +313,10 @@ public:
nsVoidArray mPendingAlternateSheets; // alternates waiting for load to start
nsHashtable mSheetMapTable; // map to insertion index arrays
#ifdef NS_DEBUG
PRBool mSyncCallback;
#endif
};
SheetLoadData::SheetLoadData(CSSLoaderImpl* aLoader, nsIURI* aURL,
@ -764,6 +768,10 @@ CSSLoaderImpl::DidLoadStyle(nsIUnicharStreamLoader* aLoader,
SheetLoadData* aLoadData,
nsresult aStatus)
{
#ifdef NS_DEBUG
NS_ASSERTION(! mSyncCallback, "getting synchronous callback from netlib");
#endif
if (NS_SUCCEEDED(aStatus) && (0 < aStyleData.Length()) && (mDocument)) {
nsresult result;
nsIUnicharInputStream* uin = nsnull;
@ -1068,12 +1076,18 @@ CSSLoaderImpl::LoadSheet(URLKey& aKey, SheetLoadData* aData)
#else
nsIURI* urlClone = CloneURL(aKey.mURL); // don't give the key to netlib, it munges it
if (urlClone) {
#endif
#ifdef NS_DEBUG
mSyncCallback = PR_TRUE;
#endif
result = NS_NewUnicharStreamLoader(&loader, urlClone,
#ifdef NECKO
nsCOMPtr<nsILoadGroup>(mDocument->GetDocumentLoadGroup()),
#endif
DoneLoadingStyle, aData);
#ifdef NS_DEBUG
mSyncCallback = PR_FALSE;
#endif
NS_RELEASE(urlClone);
if (NS_SUCCEEDED(result)) {
mLoadingSheets.Put(&aKey, aData);