Bug 1030245 - When dumping the display list dump, ensure up to 1024 characters of each line in the dump is output. r=kats

This commit is contained in:
Benoit Girard 2014-07-03 09:12:09 -04:00
parent e2bb6330dc
commit a47d9fc5c0

View File

@ -2979,7 +2979,16 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram
ss << "</body></html>";
}
fprintf(gfxUtils::sDumpPaintFile, "%s", ss.str().c_str());
char line[1024];
while (!ss.eof()) {
ss.getline(line, sizeof(line));
fprintf_stderr(gfxUtils::sDumpPaintFile, "%s", line);
if (ss.fail()) {
// line was too long, skip to next newline
ss.clear();
ss.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
}
if (gfxUtils::sDumpPaintingToFile) {
fclose(gfxUtils::sDumpPaintFile);