[webkit-reviews] review granted: [Bug 111946] XSSAuditor doesn't need a copy of the original document's body. : [Attachment 192387] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Mar 10 17:31:14 PDT 2013


Darin Adler <darin at apple.com> has granted Mike West <mkwst at chromium.org>'s
request for review:
Bug 111946: XSSAuditor doesn't need a copy of the original document's body.
https://bugs.webkit.org/show_bug.cgi?id=111946

Attachment 192387: Patch
https://bugs.webkit.org/attachment.cgi?id=192387&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=192387&action=review


> Source/WebCore/html/parser/XSSAuditor.cpp:336
> +	   if (!m_reportURL.isEmpty())
>	       m_reportURL = KURL();

This is now a strange sequence. It says “make all URLs null except for the
empty URL”; having logic that goes out of its way to preserve the empty URL
rather than replacing it with null is strange. I suggest an unconditional
assignment without an if statement.

> Source/WebCore/html/parser/XSSAuditorDelegate.cpp:83
> +	       FormData* formData =
frameLoader->documentLoader()->originalRequest().httpBody();
> +	       if (formData)
> +		   httpBody = formData->flattenToString();

It’s sometimes considered good style to write code like this with the
assignment in the if statement itself. I like it that way.


More information about the webkit-reviews mailing list