[Webkit-unassigned] [Bug 61345] lazily init ResourceResponse suggested filename.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 26 11:13:56 PDT 2011


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





--- Comment #12 from Stephanie Lewis <slewis at apple.com>  2011-05-26 11:13:55 PST ---
Copying some comments over from the bug about the crashes

Comment #7 From Brady Eidson 2011-05-25 08:47:29 PST (-) [reply]
(In reply to comment #6)
> m_isNull was added in <http://trac.webkit.org/changeset/18586>. At that point it seemed to represent whether the underlying NSURLResponse was null.
> 
> <http://trac.webkit.org/changeset/24372> seems to have introduced the other meaning, where it was possible for m_isNull to be false even though there was no underlying NSURLResponse.

24372's change seems like a mistake.  The original purpose of "m_isNull" is to track whether the platform response is null, and it's somewhat apparent the class most uses it that way internally - except for this exception.

When this is fixed, the patch should take the opportunity to rename m_isNull to m_isPlatformResponseNull so that type of mistake would be more obvious in the future.


Comment #10 From Stephanie Lewis 2011-05-25 15:48:51 PST (-) [reply]
I agree with Brady in ResourceResponseBase m_inNull means some fields have been initialized.  In ResourceResponseCFNet and ResourceResponseMac m_isNull means that the platform is null.  Unfortunately ResourceResponseBase exposes m_isNull to other places with an isNull() call so the first definition has spread. 

It seems like it would be easier to make ResourceResponse adopt ResourceResponseBase's idea of isNull than to revert back to the original meaning, or we could add a flag to ResourceResponse to stand for platform is null.


Comment #11 From Stephanie Lewis 2011-05-25 16:25:07 PST (-) [reply]
m_isNull is only used in the platform sense in 4 places 
a) and b) when initializing a ResourceResponse.  I think it is Ok to set a ResourceResponse as not null if it has a platform base so nothing changes
c)  when returning the platform response.  This already checks whether the platform response exists so no change
d) when initializing.  Where I got into trouble.  There is even an ASSERT here that says if we are null we should also not have a response.  If it had gone the other way I would have caught the crash earlier :( (if we aren't null, do we have a platform response?)  Either way,  adding a check here for the platform response should fix the bug.

Working up a patch now.

-- 
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