[Webkit-unassigned] [Bug 58646] CSP policy violations should log to the console

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 20 12:09:16 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=58646


Eric Seidel <eric at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #90318|review?, commit-queue?      |review+, commit-queue-
               Flag|                            |




--- Comment #6 from Eric Seidel <eric at webkit.org>  2011-04-20 12:09:16 PST ---
(From update of attachment 90318)
View in context: https://bugs.webkit.org/attachment.cgi?id=90318&action=review

Looks fine.  The only nit which really matters is the repeating of all that logging code.

> Source/WebCore/page/ContentSecurityPolicy.cpp:492
> +    if (!allowed) {

I might have reversed these ifs to flatten these blocks:
if (allowed)
    return allowed; (or simply true;)

But this is also OK.

> Source/WebCore/page/ContentSecurityPolicy.cpp:495
> +        if (Frame* frame = m_document->frame())
> +            frame->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, consoleMessage, 1, String());

Seems like these two lines want to be a helper.  We repeat them 7 times. :)

> Source/WebCore/page/ContentSecurityPolicy.cpp:702
> +        m_scriptSrc = adoptPtr(new CSPDirective(value, m_document->securityOrigin()));

I would have added an origin() or securityOrigin() private method.  BUt this is OK.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list