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

View File

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

View File

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