RESOLVED FIXED 63286
Add NSURLResponse wrapper in ResourceResponse when USE(CFNETWORK) is enabled
https://bugs.webkit.org/show_bug.cgi?id=63286
Summary Add NSURLResponse wrapper in ResourceResponse when USE(CFNETWORK) is enabled
Pratik Solanki
Reported 2011-06-23 14:01:38 PDT
This is part of the move to the CFNetwork based loader on Mac - bug 51836. In order to send back NSURLResponse objects to WebKit on Mac, we need to have a wrapper NSURLResponse in ResourceResponse.
Attachments
Patch (6.45 KB, patch)
2011-06-23 14:05 PDT, Pratik Solanki
no flags
Patch (6.45 KB, patch)
2011-06-23 14:14 PDT, Pratik Solanki
no flags
Patch v3 - fixes some layout tests by creating correct NSURLResponses (6.52 KB, patch)
2011-06-28 11:08 PDT, Pratik Solanki
ddkilzer: review+
Pratik Solanki
Comment 1 2011-06-23 14:05:10 PDT
Pratik Solanki
Comment 2 2011-06-23 14:14:03 PDT
Pratik Solanki
Comment 3 2011-06-28 11:08:13 PDT
Created attachment 98943 [details] Patch v3 - fixes some layout tests by creating correct NSURLResponses
Jessie Berlin
Comment 4 2011-07-11 11:25:16 PDT
Comment on attachment 98943 [details] Patch v3 - fixes some layout tests by creating correct NSURLResponses Unofficial r=me!
David Kilzer (:ddkilzer)
Comment 5 2011-07-11 11:42:10 PDT
Comment on attachment 98943 [details] Patch v3 - fixes some layout tests by creating correct NSURLResponses View in context: https://bugs.webkit.org/attachment.cgi?id=98943&action=review r=me > Source/WebCore/platform/network/mac/ResourceResponseMac.mm:56 > + // Work around a mistake in the NSURLResponse class. Would be nice to document this as <rdar://problem/3346574> (per our discussion on IRC). > Source/WebCore/platform/network/mac/ResourceResponseMac.mm:77 > + if (!m_cfResponse) > + return nil; Is there ever a case where you have an m_nsResponse but not a m_cfResponse (in which case you could make the m_cfResponse from the m_nsResponse)? Or is this ASSERT-ed elsewhere during construction so it's not possible to get into this state? Could some of this logic be simplified by doing an early return if m_isNull is true: if (m_isNull) return nil;
Pratik Solanki
Comment 6 2011-07-11 22:31:28 PDT
Comment on attachment 98943 [details] Patch v3 - fixes some layout tests by creating correct NSURLResponses View in context: https://bugs.webkit.org/attachment.cgi?id=98943&action=review >> Source/WebCore/platform/network/mac/ResourceResponseMac.mm:77 >> + return nil; > > Is there ever a case where you have an m_nsResponse but not a m_cfResponse (in which case you could make the m_cfResponse from the m_nsResponse)? Or is this ASSERT-ed elsewhere during construction so it's not possible to get into this state? > > Could some of this logic be simplified by doing an early return if m_isNull is true: > > if (m_isNull) > return nil; Hmm. I can't recall the exact reasons for the way the code is. I know I had updated this part of the patch because of some failures in layout tests. But this does feel a bit more complicated than it needs to be. I should be able to simplify this I think. I'll check this in right now and look into simplification in bug 64342.
Pratik Solanki
Comment 7 2011-07-12 10:51:39 PDT
Note You need to log in before you can comment on or make changes to this bug.