[webkit-reviews] review denied: [Bug 114672] should null check mainResourceLoader() before use it : [Attachment 199622] remove redundant words in test case.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 13 10:27:22 PDT 2013


Brent Fulgham <bfulgham at webkit.org> has denied Mary Wu <mawu at blackberry.com>'s
request for review:
Bug 114672: should null check mainResourceLoader() before use it
https://bugs.webkit.org/show_bug.cgi?id=114672

Attachment 199622: remove redundant words in test case.
https://bugs.webkit.org/attachment.cgi?id=199622&action=review

------- Additional Comments from Brent Fulgham <bfulgham at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=199622&action=review


Looks like a nice change.  I had a few syntax corrections as well as some
concerns about the clarify of the change.

> LayoutTests/ChangeLog:3
> +	   should null check mainResourceLoader() before use it

Should null check mainResourceLoader() before using it.

> LayoutTests/ChangeLog:8
> +	   Add a test to make sure mainResourceLoader() null-check before used.


.... mainResourceLoader() is null-checked before use.

> Source/WebCore/ChangeLog:3
> +	   should null check mainResourceLoader() before use it

Should null check mainResourceLoader() before using it.

> Source/WebCore/loader/DocumentLoader.cpp:516
> +	       ASSERT(mainResourceLoader());

Why do we only assert here, where we provide actual protection in the other
routines you modified?	This would still be a crash, wouldn't it?

> Source/WebCore/loader/DocumentLoader.cpp:681
> +	   InspectorInstrumentation::continueWithPolicyDownload(m_frame, this,
mainResourceLoader() ? mainResourceLoader()->identifier() : 0, m_response);

I think using this ternary operator inline in the method call is sort of hard
to read.  I would prefer to see something like:

unsigned long identifier = mainResourceLoader() ?
mainResourceLoader()->identifier() : 0;
InspectorInstrumentation::continueWithPolicyDownload(m_frame, this, identifier,
m_response);

> Source/WebCore/loader/DocumentLoader.cpp:694
> +	   InspectorInstrumentation::continueWithPolicyIgnore(m_frame, this,
mainResourceLoader() ? mainResourceLoader()->identifier() : 0, m_response);

Ditto.


More information about the webkit-reviews mailing list