tune up debug a bit

This commit is contained in:
Cameron Kaiser 2017-09-03 18:31:58 -07:00
parent 023db21f45
commit 150b92b0f6
3 changed files with 19 additions and 3 deletions

View File

@ -7109,12 +7109,14 @@ nsContentUtils::IsForbiddenSystemRequestHeader(const nsACString& aHeader)
static const char *kInvalidHeaders[] = {
"accept-charset", "accept-encoding", "access-control-request-headers",
"access-control-request-method", "connection", "content-length",
"cookie", "cookie2", "content-transfer-encoding", "date", "dnt",
"expect", "host", "keep-alive", "origin", "referer", "te", "trailer",
"transfer-encoding", "upgrade", "via"
"cookie", "cookie2", "date", "dnt", "expect", "host", "keep-alive",
"origin", "referer", "te", "trailer", "transfer-encoding", "upgrade", "via"
};
for (uint32_t i = 0; i < ArrayLength(kInvalidHeaders); ++i) {
if (aHeader.LowerCaseEqualsASCII(kInvalidHeaders[i])) {
#if DEBUG
fprintf(stderr, "offending header was %s\n", kInvalidHeaders[i]);
#endif
return true;
}
}
@ -7125,8 +7127,17 @@ nsContentUtils::IsForbiddenSystemRequestHeader(const nsACString& aHeader)
bool
nsContentUtils::IsForbiddenResponseHeader(const nsACString& aHeader)
{
#if DEBUG
if (aHeader.LowerCaseEqualsASCII("set-cookie") ||
aHeader.LowerCaseEqualsASCII("set-cookie2")) {
NS_WARNING("attempt to access set-cookie header");
return true;
}
return false;
#else
return (aHeader.LowerCaseEqualsASCII("set-cookie") ||
aHeader.LowerCaseEqualsASCII("set-cookie2"));
#endif
}
// static

View File

@ -4896,8 +4896,10 @@ nsImageRenderer::ComputeIntrinsicSize()
appUnitsPerDevPixel));
}
} else {
/* This is an obnoxious assertion.
NS_ASSERTION(mImageElementSurface.GetSourceSurface(),
"Surface should be ready.");
*/
IntSize surfaceSize = mImageElementSurface.mSize;
result.SetSize(
nsSize(nsPresContext::CSSPixelsToAppUnits(surfaceSize.width),

View File

@ -960,6 +960,8 @@ nsHtml5StreamParser::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext)
rv = threadRetargetableRequest->RetargetDeliveryTo(mThread);
}
// We never do anything with this, so there's no need to check it.
#if(0)
if (NS_FAILED(rv)) {
// for now skip warning if we're on child process, since we don't support
// off-main thread delivery there yet. This will change with bug 1015466
@ -967,6 +969,7 @@ nsHtml5StreamParser::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext)
NS_WARNING("Failed to retarget HTML data delivery to the parser thread.");
}
}
#endif
if (mCharsetSource == kCharsetFromParentFrame) {
// Remember this in case chardet overwrites mCharsetSource